jquery - Bootstrap navigation bar affix property not accurate after window resize -


I'm having a problem in which the Epix property is included in Bootstrap, it works perfectly fine by using the given jQuery Is done as it is pasted on top of the page after scrolling (as intended). The problem occurs only after the page is loaded and then the window is replaced properly. On the right side of the navigation bar, while scrolling at this point, see the "sticks" demo site at the top right corner

The problem is that the height at which the navigation bar is affixed, the window load , And if the page is changed vertically again, then the height of the page should be "glued" to the height of the page, but no. There is nothing complicated in JS:

  // "sticky" nav bar $ ('# navbar'). Fix ({Offset: {top: $ (window). Hiight ()}}); $ ('# Navbar'). ('Affix.bs.affix', function () {var navHeight = $ ('# navbar'). External head (true); $ ('# body'). CSS ('margin-desktop', naviteite); }); $ ('# Navbar'). ('Affix-top.bs.affix', function () {$ ('# body'). CSS ('margin-top', 0);});  

I basically just want to change the point after changing the size of "rods", but I think $ (window) .resize Any ideas to work with it effectively?

I think the one you are trying to accomplish, Updating from window.resize If this is true, then it will be complete.

  $ (window). Resize (function () {$ ('' #navbar ''). Data ('B.Efix'). Options.offset = $ ('# navbar') offset (). Top;});  

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

How to access user directory in lazarus? -

java - Gradle dependencies: compile project by relative path -