wp enqueue script - Bootstrap sticky menu in WordPress

I have a menu which I have assigned the affix class using the JS and the data-spy methods but it doesn't work, ther

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 badges
Add a comment  | 

1 Answer 1

Reset to default 0

I 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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745181379a4615434.html

相关推荐

  • wp enqueue script - Bootstrap sticky menu in WordPress

    I have a menu which I have assigned the affix class using the JS and the data-spy methods but it doesn't work, ther

    3小时前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信