views:

334

answers:

1

Hey guys,

I'am scrolling through a page witch jQuery scrollTo. If the page reaches ssome pixels for exaple y= 300 a div slides in.

If i scroll manually i want to slide that div in too.

how do i achieve that?

I've thought about something like a event listener. jQuery.scroll exists but does'n make a difference between "manual" scrolling and "automatic" scrolling (with scrollTo).

Should i take an other attempt?

Thank you!

A: 

If I understand the question correctly the problem is that when listening to the regular scroll event, you don't know how far the page has been scrolled?

Try checking the scrollTop property http://javascript.gakaa.com/div-scrollleft-2-0-scrolltop.aspx.

Something along these lines perhaps:

$('my-selector').attr( 'scrollTop' )
Swizec Teller