jquery scrolltop animation flips on click but then scrolls smoothly -
i've set function:
$(function() { $('.top a').bind('click',function(event){ var $anchor = $(this); $('html, body').stop().animate({ scrolltop: $($anchor.attr('href')).offset().top }, 5000,'easeinoutexpo'); event.preventdefault(); }); });
it work online when click it jumps pixels first , scrolls smoothly top.
there no margin or padding wether on body nor on wrapper. div i'm targeting first element on page , 1 i'm starting right @ bottom , outside wrapper.
what little flip @ first?
Comments
Post a Comment