jquery - How do I stop the duration of the scrollTop -
the directive have works enough far, not every page has same height want stop duration when @ bottom.
this code of directive:
function (scope, elem, attrs) { $(document).on('contentchanged', '#maintext', function () { $("html, body").animate({ scrolltop: 0 }, 0), $("html, body").animate({ scrolltop: $(window).height() }, 4000); }); }
so example @ first page view @ bottom can't go lower , when go next page bit lower continuous scrolling down.
my question how can stop scrolling ?
.animate( properties [, duration] [, easing] [, complete] )
so this:
.animate( {scrolltop:'300px'}, 300, swing, function(){ alert(animation complete! - custom code here!); } )
here jquery .animate function api page: http://api.jquery.com/animate/
Comments
Post a Comment