jQuery scrollTop - animation stucks at the end of moving
Posted
by
mobsteady
on Stack Overflow
See other posts from Stack Overflow
or by mobsteady
Published on 2012-12-05T04:00:05Z
Indexed on
2012/12/05
5:04 UTC
Read the original article
Hit count: 125
i use jquery the scrollTop function to get my scrolling smooth while switching between different anchors. first, here is the url
this is my jquery script
"ziel" is just the german word for "target", just to let you know why this variable is called "ziel"
$(document).ready(function() {
$('a[href*=#]').bind("click", function(event) {
event.preventDefault();
var ziel = $(this).attr("href");
$('#portraitcontent').animate({
scrollTop: $(ziel).offset().top
}, 3000 , function (){location.hash = ziel;});
});
return false;
});
so how do i get a smooth scrolling without that ugly jumping at the end of the animation? any ideas?
i really don't know what to do. spending hours with that bitch!
thanks for your advices!
© Stack Overflow or respective owner