[JS] How to jump to an anchor slowly

2015-10-29 写技术

How to jump to an anchor slowly?

 

function goto(id){
 var top = jQuery("#"+id).offset().top;
 jQuery("html,body").animate({scrollTop:top},1000);
}

标签: JS

发表评论:

Powered by anycle 湘ICP备15001973号-1