Hey guys!
I have recently been trying to learn GSAP again after a while and I am trying to implement a horizontal scrolling site.
So far everything is great though I am a little overwhelmed with the available options available (not saying it's a bad thing at all though )
I was able to make the horizontal scroll working based on a code from an example.
Having said that, I am a little stuck on how to implement a vertical scrolling slider that is inside the sections of the horizontal scrolling page.
That is because with the code I have right now, any type of scrolling will make the page scroll left and right.
What I wanted to do is that once the mouse is inside elements with a specific class, the horizontal scroll will stop and will run the vertical scrolling of the content inside that element instead.
I am thinking of setting an event listener and if the mouse if in the div, I will use the pause(). I am not sure though if that is the best way to implement this though.
TLDR; What I am trying to figure out are:
Stopping the horizontal scroll when mouse is inside divs with a specific class
Make vertical scrolling work when mouse is inside those divs
Any suggestion or inputs would be appreciated. Thanks in advance!
-------------------------------------------------
It turns out, that the solution I am looking for is not that complicated at all. What I did was to simply set the `overflow-y` of the slider elements to `scroll` then hide the scrollbar through CSS.
Though I would still need help in actually stopping the horizontal scroll stop happening when the mouse is inside the slider elements because right now, if I am on either the first or the last element of the slider, since there is nothing to scroll - the horizontal scroll happens.