欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

jquery如何實(shí)現(xiàn)錨點(diǎn)鏈接之間的平滑滾動(dòng)

 更新時(shí)間:2013年12月02日 17:38:52   作者:  
實(shí)現(xiàn)錨點(diǎn)鏈接之間的平滑滾動(dòng)的方法有很多,在接下來(lái)的文章中為大家介紹下,jquery是如何實(shí)現(xiàn)的,感興趣的朋友不要錯(cuò)過(guò)
復(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)文章

最新評(píng)論