Here is my code
http://jsfiddle.net/mihaene/7bdkB/
I want a div to slide in, as soon as I scroll down a certain amount of pixel.
It works, but very, very delayed (like 5seconds).
What’s the problem?
Any suggestion would be very much appreciated.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Hi I think the problem is your else block. jQuery is then starting the animation which takes ~300 ms.
So just use the stop() method of jQuery to stop those animations.
On a sidenote: maybe you should think of different if / else statements in order not to get an animation (or stop / restart) with every scrolling event as other suggested.