just compare scrollTop values while scrolling. Don't forget to use timeout
or helper function like this https://gist.github.com/789765

<https://gist.github.com/789765>Because scroll event is fired depending on
browser and scroll speed very often, f.e. every 20 ms.

2011/1/29 Varun <[email protected]>

> You can track the Mose movement in y direction. creating a temporary
> variable that tracks your Previous y  coordinate and compare it with your
> current y coordinate. Update your tracking variable with each scroll.
>
> Varun
>
> On Jan 29, 2011, at 7:22 AM, Amit Agarwal <[email protected]> wrote:
>
> Hi,
>
> I attached an 'onscroll' handler for the div. Its working fine but I need
> to know which direction did I scroll to. Was it upside or downside.
>
> div.onscroll = function(event){
> //What to do with event object to know the scroll direction?
> }
>
> -Regards
> *Amit Agarwal <http:///www.amitagrwal.com>*
> +91-779-822-8765
>
>  --
> To view archived discussions from the original JSMentors Mailman list:
> <http://www.mail-archive.com/[email protected]/>
> http://www.mail-archive.com/[email protected]/
>
> To search via a non-Google archive, visit here:
> <http://www.mail-archive.com/[email protected]/>
> http://www.mail-archive.com/[email protected]/
>
> To unsubscribe from this group, send email to
>  <[email protected]>
> [email protected]
>
>  --
> To view archived discussions from the original JSMentors Mailman list:
> http://www.mail-archive.com/[email protected]/
>
> To search via a non-Google archive, visit here:
> http://www.mail-archive.com/[email protected]/
>
> To unsubscribe from this group, send email to
> [email protected]<jsmentors%[email protected]>
>



-- 
regards,
Oleg @oleg008
github.com/kof

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to