api.scrollToY function is running recursively in scroll event only , is there any way to stop it?
$('.scroll-pane').bind('scroll',function (e) {
api.scrollToY(100)
return false;
});
api.scrollToY function is running recursively in scroll event only , is there any way to stop it?
$('.scroll-pane').bind('scroll',function (e) {
api.scrollToY(100)
return false;
});
I don't understand, but if you need to listen an event like scroll or resize (that fires tons of times) you can use a debouncer for your function. Underscore library have one very useful. See more:
http://davidwalsh.name/javascript-debounce-function
You can modify easy to change
resizetoscroll