首页 > Web开发 > 详细

jquery单页网站导航插件One Page Nav

时间:2016-07-17 13:02:41      阅读:245      评论:0      收藏:0      [点我收藏+]
这是一个轻量级的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

原文:http://www.cnblogs.com/lcf1314/p/5677586.html

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