0
I’m using bootstrap in my code
Has a class in the nav
of bootstrap fixing the nav
in the top
navbar-Fixed-top
But I want the nav
just stay fixed when the scroll goes through it.
How do I do that?
An example: This site
0
I’m using bootstrap in my code
Has a class in the nav
of bootstrap fixing the nav
in the top
navbar-Fixed-top
But I want the nav
just stay fixed when the scroll goes through it.
How do I do that?
An example: This site
2
I think there is a plugin able to do this already in bootstrap, affix, do not need any javascript for what I know.
http://getbootstrap.com/2.3.2/javascript.html#affix
The side menu is an example of using affix
1
I found a snippet on Bootsnipp Navbar Affix
Browser other questions tagged jquery html css bootstrap-3
You are not signed in. Login or sign up in order to post.
How do I install affix to my html? I can’t find
– Junior Vilas Boas
I don’t think it requires any installation, just copy the tag and adapt it to what it is needed, here you can find everything about affix https://www.w3schools.com/bootstrap_affix.asp
– K. Chanel
It’s not working. I put
<nav class="navbar navbar-default" data-spy="affix-top" data-offset-top="197">
and still can’t fix @K. Chanel– Junior Vilas Boas
Try it yourself on w3schools.com/bootstrap/bootstrap_affix.Asp to try it out and see how it works
– K. Chanel
the "offset-top" tag determines how many pixels you need to scroll to the top and what activates affix is the 'data-Spy="affix"'
– K. Chanel