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?
}
}
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.