简体   繁体   中英

Bootstrap, how make a navbar sticky after scrolling down when using viewport height?

I want to get this effect:

http://jsfiddle.net/ux41b606/

but with use no px but viewport height. I tried but I don't know how to set jQuery if to viewport height.

Here my jsfidlle:

http://jsfiddle.net/80nyn8bh/2/

How can I fix that and get sticky navbar when browser srolling more than 100% viewport ?

Thanks for help.

Ok, I find the answer. I fix this by one line if ($(window).scrollTop() > $(window).height()) and it's working good.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM