Anchor html speed with jquery -


i use code format anchor speed, doesn't work on ie (7,8,9 & 10) , firefox. can tell me doing wrong , how optimize anchor speed?

$('a.anchorlinks').on('click', function(e){             e.preventdefault();             var divid = $(this).attr('href');             var position = $(divid).position();             $('body').animate({scrolltop: position.top}, 1000);         }); 

instead of position, use offset() http://api.jquery.com/offset/


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -