是否可以使用两列滚动浏览大量数据?
我希望看看我能否获得一些帮助。我正在研究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/
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当然,您将需要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.