You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

网站是否可阻止JavaScript函数运行?Holonis滚动脚本失效求助

Fixing Auto-Scroll on Holonis Follower List Page

Hey there, let's break down why your current script isn't working and how to fix it. The core issue is that Holonis's follower list doesn't use the main window/body for scrolling—it's wrapped in a nested scrollable container (like a div or ul) that handles the list's scroll behavior independently. Your original script targets the entire window, which doesn't affect this inner container at all.

Step 1: Identify the Correct Scrollable Container

First, we need to find that inner container:

  • Open your browser's DevTools (press F12 or right-click the follower list and select "Inspect").
  • Look for the parent element of the follower items that has a vertical scrollbar. You can spot it by checking for CSS properties like overflow-y: auto or overflow: scroll in the Styles panel.
  • Note down its selector (e.g., a class name like .follower-list-wrapper or an ID).

Step 2: Modify the Script to Target the Container

Replace your original script with this adjusted version, swapping out the selector for the one you found:

function autoScrolling() {
  // Replace with the selector of your identified scroll container
  const scrollContainer = document.querySelector('.follower-list-wrapper');
  
  if (scrollContainer) {
    // Scroll to the bottom of the container
    scrollContainer.scrollTop = scrollContainer.scrollHeight;
  }
}
setInterval(autoScrolling, 500);

Step 3: Fallback for Hard-to-Find Containers

If you can't easily pinpoint the container's selector, use this script to automatically detect any scrollable element on the page:

function findScrollableContainer() {
  const allElements = document.querySelectorAll('div, ul, ol');
  
  for (const element of allElements) {
    // Check if the element has a scrollable content area
    const isScrollable = element.scrollHeight > element.clientHeight && 
                        getComputedStyle(element).overflowY !== 'visible';
    
    if (isScrollable) {
      return element;
    }
  }
  return null;
}

function autoScrolling() {
  const scrollContainer = findScrollableContainer();
  if (scrollContainer) {
    scrollContainer.scrollTop = scrollContainer.scrollHeight;
  }
}
setInterval(autoScrolling, 500);

Why This Works

Most modern social platforms use nested scroll containers to keep headers/footers fixed while lists scroll. By targeting this specific container instead of the main window, you're interacting with the actual element that controls the follower list's scroll position.

内容的提问来源于stack exchange,提问作者inder

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 12:14:41