asscroll
asscroll copied to clipboard
Horizontal Scroll Demo
Hey Ash, if you could point us in the right direction regarding horizontal scrolling that would be awesome! I've been tinkering with it but it looks like it's currently unfinished? If I set the <main asscroll-container>
width manually it works, but there's no calculation happening as of yet, right?
Hey @S-n-d, it is functional, you just need the right set up. Usually this can be done with flex and setting the elements to not grow or shrink so they render at their natural width, which would cause a horizontal overflow of the ASScroll container element. I will see if I can put together a quick demo over the next day or two.
@ashthornton thanks for giving a nudge in the right direction. Looking forward to the demo!
It’s only possible to activate horizontalScroll
within asscroll.enable
, right? Is the horizontal scroll only possible with vertical input (touchpad) and with a vertical scrollbar, or am I doing something wrong? Would be nice if we could define the orientation directly when defining the new ASScroll
instance or if we could at least change the input and scrollbar direction inside asscroll.enable
. I think it’s not intuitive to mix up the directions, even though I would like to let the site be scrolled with vertical as well as horizontal input.
Hi @grommas, are you asking if it would be possible to scroll with a horizontal mouse wheel? Or if you could just change the scrollbar location to the bottom and the orientation to horizontal, when in horizontal mode?
Hi @ashthornton, thanks for your reply. Both!
@grommas so the current horizontal scroll functionality is designed to work the way it does now - moving the page horizontally based on vertical scroll position. It's a design decision based on the fact that it is uncommon to have a horizontal scroll wheel on a mouse but I also wanted to allow horizontal page movement.
I think it could be nice if ASScroll detects whether the page has X or Y overflow and adjusts the scrollbar orientation and scroll behaviour accordingly. But this would also need to be interchangeable with allowing horizontal scroll to be controlled with a vertical mouse wheel when required.
It's definitely something I will consider adding in the future, but isn't a priority right now.
Thanks for your answer! I think for trackpad users it’s logical to scroll the x-axis with horizontal swipes. I totally understand, that vertical scroll inputs make sense for some design decisions, but for others it may break with the intention of native horizontal scroll elements.