admin管理员组文章数量:1414621
I have a menu which I have assigned the affix class using the JS and the data-spy methods but it doesn't work, there are no JS errors in my console (firefox or chrome) and the js and css of BS are at 3.3.1. I am using WordPress, the files are all enqueued and everything else works fine.
I have deactivated all the plugins (although none use BS), I have deleted all the other scripts I enqueued
Navigation HTML:
<nav class="navbar navbar-inverse navbar-static-top" id="nav" rol="navigation">
My Affix JS is:
jQuery('#nav').affix({
offset: {
top: 580
}
});
Anyone able to point me in a direction to find the cause?
I have a menu which I have assigned the affix class using the JS and the data-spy methods but it doesn't work, there are no JS errors in my console (firefox or chrome) and the js and css of BS are at 3.3.1. I am using WordPress, the files are all enqueued and everything else works fine.
I have deactivated all the plugins (although none use BS), I have deleted all the other scripts I enqueued
Navigation HTML:
<nav class="navbar navbar-inverse navbar-static-top" id="nav" rol="navigation">
My Affix JS is:
jQuery('#nav').affix({
offset: {
top: 580
}
});
Anyone able to point me in a direction to find the cause?
Share Improve this question edited Apr 6, 2019 at 9:30 fuxia♦ 107k39 gold badges255 silver badges459 bronze badges asked Dec 18, 2014 at 19:05 Gareth GillmanGareth Gillman 1,3221 gold badge10 silver badges18 bronze badges1 Answer
Reset to default 0I see that jQuery is loading in the source, but I did not see the bootstrap js file. Here is an example of how you would properly enqueue bootstrap into WordPress and set jQuery as dependency.
Github Gist to enqueue Bootstrap
本文标签: wp enqueue scriptBootstrap sticky menu in WordPress
版权声明:本文标题:wp enqueue script - Bootstrap sticky menu in WordPress 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745181378a2646481.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论