是否可以使用两列滚动浏览大量数据?

发布于 2025-02-06 23:00:35 字数 894 浏览 2 评论 0原文

我希望看看我能否获得一些帮助。我正在研究Chrome扩展程序,该扩展可以通过css/js调整来修改站点的布局。

是否可以像以下图显示此页面上的长狭窄文本滚动?

https://play.date/pulp/doc/docs/docs/pulpsscript/

网站

最新尝试解决方案:

var curColumn = 0;

main.onscroll = function(){myFunction()};

function myFunction() {
    if (curColumn==0 && document.documentElement.scrollTop == 0) {
        // do nothing
    }
    else if (curColumn==2 && document.documentElement.scrollBottom == 0) {
        // do nothing
    }
    else {
        // move forward or backward? 
        // where to increment/decrement curColumn?
    }
}

I was hoping to see if I could get some help making this work. I'm working on a Chrome extension that modifies the layout of a site with CSS/js tweaks.

Is it possible to make the long, narrow text on this page scroll like the following diagram displays?

Site: https://play.date/pulp/docs/pulpscript/

Diagram:
enter image description here

Latest attempt at solution:

var curColumn = 0;

main.onscroll = function(){myFunction()};

function myFunction() {
    if (curColumn==0 && document.documentElement.scrollTop == 0) {
        // do nothing
    }
    else if (curColumn==2 && document.documentElement.scrollBottom == 0) {
        // do nothing
    }
    else {
        // move forward or backward? 
        // where to increment/decrement curColumn?
    }
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

在你怀里撒娇 2025-02-13 23:00:35

当然,您将需要JS中的计数器来跟踪当前列,然后在容器元素中您可以添加一个croll方法,当它到达底部或顶部时,它会根据什么移动到文档的另一端当前列是。然后增加或减少列号。

如果列== 0,并且我们到达页面顶部,则不做任何事情,同样对于页面的底部和最后一列。否则,向前或向后移动。

Sure, you would need a counter in JS to keep track of the current column, then in the container element you could add an onscroll method, that when it reaches the bottom or top it will move to the other end of the document based on what the current column is. Then increment or decrement the column number.

If column == 0 and we reach the top of the page, do nothing, likewise for the bottom of the page and the last column. Else, move forward or backward.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文