javascript - bug ScrollTop on Safari ipad -
i responsive website bootstrap anchor html in navigation. in nav bar have logo , when user click on , site scroll top. , works in desktop. in ipad safari when click logo scroll top , working once. , nav bar anchor bug after that.
how fix that?
my code :
$(document).ready(function(){ $('.brand').bind('click',function(){ $('html,body').animate({scrolltop: 0}, 'normal'); }); });
update
try "on" bind method
as of jquery 1.7+ better approach use "on" method not bind.
$(document).ready(function() { $(".brand").on("click", function () { $('body').animate({scrolltop: 0}, 'normal'); alert('image clicked') }); });
thanks ab
Comments
Post a Comment