Frage

i'm making a website for my school and i need to control if the user scrolls the mouse wheel up or down when the mouse is inside a specific div.

f.e.:http://www.apple.com/pt/iphone-5s/

i want to replicate the slide effect but only in a small portion of the page(the div i spoke of). so how do i control this in javascript? there is no need to find out how much he scrolls, he will only be able to scroll through one slide at a time, just the scroll itself.

War es hilfreich?

Lösung

try this:

http://imakewebthings.github.com/jquery-waypoints

https://github.com/brandonaaron/jquery-mousewheel

the second one is probably the one you want. You can check for the wheel events then check the mouse cursor position. or something like that. However, you need to consider people will access your page with tablets etc, so really scrollwheel events depending on "mouse position" is actually not a great idea.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top