Fixed Navbar Question

in Ideas and script requests
Subscribe to Fixed Navbar Question 5 posts, 3 voices



KasaraEm13 User
FirefoxWindows

Is there an easy way to make it static? As it not follow you down the page as you scroll.

I seem to use a lot of sites that have a fixed top navigation bar and it honestly drives me insane, I feel like it's blocking part of the page I could be looking at and I'm not seeing the full page. I'd like it just to stay at the top of the page and not scroll with me.

 
mike cupcake Scriptwright
FirefoxWindows

It's often done by setting position: fixed; in the CSS. Can be made static with position: static !important; but there's no single fix that'll work on every site - you need to know the ID of the element before you can apply it.

 
KasaraEm13 User
FirefoxWindows

I believe the sites I frequent most use something like this. The bar starts with:
< div class="navbar navbar-fixed-top" >

Sorry, I'm not sure if I understand what ID means here, I don't really knows the terms... Is it possible to override that though?

 
yawns Scriptwright
FirefoxWindows

use GetElementByID function if there is an 'id' property in the

tag, otherwise GetElementsByClassName('navbar navbar-fixed-top') will grab the object based on it's classname.

Check some similar scripts for examples of how to do it - http://userscripts.org/scripts/search?q=navbar&...=

 
mike cupcake Scriptwright
FirefoxWindows

Probably no need for actual scripting, just change the CSS. In Greasemonkey:

GM_addStyle(" .navbar-fixed-top { position: static !important; } ");