Hi I tried customizing WordPress twentytwelve by adding a fixed nav bar with twitter bootstrap, i tried the code on a static way it works well, when tried with wordpress, this ain’t working.

have added bootstrap js and css on wordpress functions, carousel and almost all javascript functions are working on the site, here’s my code

HTML

<div class="header">
  <div class="header-1">
    <h1>this is some logo</h1>
  </div>
  <div class="header-2">
    <h3>this is some heading</h3>
  </div>
</div>
<div class="content" style="height:2500px;">
</div>
<div class="footer">
    this is a footer
</div>

CSS

.header-2.affix {
   top: 0;
}

JavaScript:

$('.header-2').affix({
    offset: {
        top: function () {
            return (this.top = $(".header-2").offset().top);
        }
    }
});

must work the way that, after some scrolling, the header-2 must stay on the top. thank you for any help.

Read more here: Bootstrap affix not working with wordpress!


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Related Wordpress search:

, , ,

Wordpress related questions and answers: