html5导航菜单置顶,固定顶部导航栏插件stickynavbar.js

stickynavbar.js是一个jQuery插件,可以帮助你的导航栏在浏览器窗口中滚动时固定在顶部。它可以指定导航栏自动滚动到某个位置。

ad5d4552d9cbd5f7763e9f3dae0443df.png

$(function () {

$('.header').stickyNavbar({

activeClass: "active", // Class to be added to highlight nav elements

sectionSelector: "scrollto", // Class of the section that is interconnected with nav links

navOffset: 0, // Offset from the default position of this() (nav container)

animDuration: 250, // Duration of jQuery animation

startAt: 0, // Stick the menu at XXXpx from the top of the this() (nav container)

easing: "linear", // Easing type if jqueryEffects = true, use jQuery Easing plugin to extend easing types - gsgd.co.uk/sandbox/jquery/easing

animateCSS: true, // AnimateCSS effect on/off

animateCSSRepeat: false, // Repeat animation everytime user scrolls

bottomAnimation: false, // CSS animation on/off in case we hit the bottom of the page

cssAnimation: "fadeInDown", // AnimateCSS class that will be added to selector

jqueryEffects: false, // jQuery animation on/off

jqueryAnim: "slideDown", // jQuery animation type: fadeIn, show or slideDown

selector: "a", // Selector to which activeClass will be added, either "a" or "li"

mobile: false // If false nav will not stick under 480px width of window

});

});

相关链接

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值