首页 > Web开发 > 详细

jQuery滑动到锚点

时间:2014-09-15 17:23:49      阅读:284      评论:0      收藏:0      [点我收藏+]
<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;    
    });    
});

jQuery滑动到锚点

原文:http://www.cnblogs.com/lweiruil/p/3973059.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!