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

c# - SelectList with Dictionary, add values to the Dictionary after it's assigned to SelectList -

javascript - Chart.js - setting tooltip z-index -

how can i manage url using .htaccess in php? -