stutrek / scrollmonitor

A simple and fast API to monitor elements as you scroll
MIT License
3.3k stars 243 forks source link

horizontal scrolling #57

Open musicformellons opened 7 years ago

musicformellons commented 7 years ago

Looks nice! Can you use it also for horizontal instead of vertical scrolling?

stutrek commented 7 years ago

Unfortunately you cannot. It's a surprisingly rare feature request.

ferredel commented 7 years ago

Actually it will be very usefull

jwebcat commented 7 years ago

I have to agree horizontal scroll would be useful.

mcfog commented 6 years ago

+1 it would be super useful to carousel

johanneslamers commented 6 years ago

Yes please!

boeledi commented 6 years ago

I don't recommend but if you really want to have or need a quick-win solution (but dirty), clone the not minimized version of scrollMonitor.js (and call it scrollMonitorHoriz.js, e.g.) and apply the following changes to the code:

  1. rename all "scrollMonitor" to "scrollMonitorHoriz"
  2. apply the following replacements (case sensitive):

and this should make the trick but that new version will no longer support the vertical scrolling...

stutrek commented 6 years ago

🤘 Nice hack.

I think there's a second place you'll need to edit if you want it to work in scroll containers too, but if it works keep doing it.

jamesblasco commented 6 years ago

+1 It would be very helpful!