亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

jquery如何實現(xiàn)錨點鏈接之間的平滑滾動

 更新時間:2013年12月02日 17:38:52   作者:  
實現(xiàn)錨點鏈接之間的平滑滾動的方法有很多,在接下來的文章中為大家介紹下,jquery是如何實現(xiàn)的,感興趣的朋友不要錯過
復(fù)制代碼 代碼如下:

$('a[href*=#]').click(function() {
if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {
var $target = $(this.hash);
$target = $target.length && $target || $('[name=' + this.hash.slice(1) + ']');
if ($target.length) {
var targetOffset = $target.offset().top;
$('html,body').animate({
scrollTop: targetOffset
},
500);
return false;
}
}
});

相關(guān)文章

最新評論