jquery單頁網站導航外掛程式One Page Nav

來源:互聯網
上載者:User

標籤:

這是一個輕量級的jQuery的單頁網站導航外掛程式。增加了單擊後平滑滾動導航和當你瀏覽不同的部分時自動選擇正確的導航項。

changeHash: false, 改變當使用者單擊導航,就改變changeHash選項為true。

scrollSpeed: 750,

scrollThreshold: 0.5,

filter: ‘‘,

easing: ‘swing‘,

begin: function() { //I get fired when the animation is starting },

end: function() { //I get fired when the animation is ending },

scrollChange: function($currentListItem) { //I get fired when you enter a section and I pass the list item of the section } });



在項目中選擇一個導航→傳入一個選取器過濾選項。


選擇到該導航,調用onePageNav();
$(‘#nav‘).onePageNav(
filter: ‘:not(.external)‘
});

如果你在iOS裝置上單擊連結導航導致 其他連結斷掉,你可以通過滾動操作來解決這個問題

$(‘#nav‘).onePageNav({
begin: function() {
//Hack so you can click other menu items after the initial click
$(‘body‘).append(‘<div id="device-dummy" style="height: 1px;"></div>‘);
},end: function() {
$(‘#device-dummy‘).remove();
}
});

 

jquery單頁網站導航外掛程式One Page Nav

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.