jQuery: Preventing list scroll?
Posted
by Legend
on Stack Overflow
See other posts from Stack Overflow
or by Legend
Published on 2010-06-03T01:16:12Z
Indexed on
2010/06/03
1:24 UTC
Read the original article
Hit count: 292
JavaScript
|jQuery
I have this scenario: Using an ajax query I fetch some data items and push them into a ul
element as an li
element. I use $("ulele").append(new_li_item)
. I wrote my own custom scroll for this ul
element using the following whenever an event is detected:
$("ulele").animate({scrollTop: '+=' + 200}, 'slow');
The problem is when I fire that event and the list scrolls due to the animate
function above, I want to keep it stable for at least a few seconds. When it scrolls down, elements are still being pushed so the list keeps scrolling no matter what. Is there a way I can pause this from happening without really stopping the activity of pushing elements into the ul list?
© Stack Overflow or respective owner