`
jhyimu2005
  • 浏览: 181533 次
  • 性别: Icon_minigender_2
  • 来自: 苏州
社区版块
存档分类
最新评论

点击按钮跳到当前页面指定的div和跳到顶部或底部

 
阅读更多

function goTop() {
$('html, body').animate({scrollTop:0}, 'slow');
}

function goDiv(div) {
var a = $("#"+div).offset().top;
$("html,body").animate({scrollTop:a}, 'slow');
}

function goBottom() {
window.scrollTo(0, document.documentElement.scrollHeight-document.documentElement.clientHeight);
}

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics