jQuery類層級外掛程式--返回頂部,底部,去到任何部位

來源:互聯網
上載者:User

標籤:返回頂部   style   blog   http   ar   io   color   使用   sp   

先引入js:
<script type="text/javascript" src="jquery.js" ></script>
<script type="text/javascript" src="towhere.js" ></script>

 

假設頁面:

    <body>        <a href="javascript:;" id="to-bottom">去到底部</a>        <a href="javascript:;" id="to-top">返回頂部</a>        <div id="to-where1">去到500處</div>        <div id="to-where2">去到1000處</div>    </body>

 

使用方法:

    $(function(){        $(‘#to-bottom‘).click(function(){            $.toBottom();        });        $(‘#to-top‘).click(function(){            $.toTop();        });        $(‘#to-where1‘).click(function(){            $.toWhere(500);        });        $(‘#to-where2‘).click(function(){            $.toWhere(1000);        });                /*                  $.toBottom();        去向底部,$.toBottom(0.1)--[0.1-選擇性參數-運動速度],預設0.3         $.toTop();           返回頂部,調整同上         $.toWhere();         到任何處,$.toWhere(500,0.1)--[500-必填到達何處,0.1--可選速度],預設0.3                  */    });

 

外掛程式下載:

http://pan.baidu.com/share/link?shareid=2575574326&uk=3945321701

jQuery類層級外掛程式--返回頂部,底部,去到任何部位

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.