jQuery滑动到锚点

<map name="Map">
<area shape="rect" coords="6,13,149,78" href="#bottom">
<area shape="rect" coords="5,117,144,148" href="#t1">
<area shape="rect" coords="3,149,146,180" href="#t3">
<area shape="rect" coords="4,181,145,212" href="#t2">
<area shape="rect" coords="4,212,141,244" href="#t4">
<area shape="rect" coords="3,242,144,273" href="#t5">
<area shape="rect" coords="3,272,142,309" href="#t6">
<area shape="rect" coords="4,308,144,345" href="#t7">
<area shape="rect" coords="5,347,149,404" href="#t8">
<area shape="rect" coords="6,84,142,117" href="#bottom">
</map>

jQuery(function($) {    

    $("map[name=‘Map‘] area").click(function() {    
        $("html, body").animate({    
            scrollTop: $($(this).attr("href")).offset().top
        }, 1500);    
        return false;    
    });    
});

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。