
I received some emails asking how to create that Fixed Javascript Sidebar that scrolls with the page. A floating sidebar can be used to give your readers simple navigation options at all times. It can also be used as an advertisement section that stalks your readers…
The sidebar code is created by jtricks.com and can be found here. The hide and show menu option is also created by jtricks but for the their Absolute Floating Menu. In order for the hide and show function to work a slight tweak in the codes will make it work for the Fixed menu.
There is a slight delay when scrolling the Absolute Floating Menu. For setuix.com I prefer the menu to be always there instead of appearing a few seconds later while scrolling. Below are the codes for the sidebar, css codes as appear on setuix.com as well as the tweaked hide and show codes. Place the code below after </head>.
|
<!—Fixed Menu Bar EoF—> <br /> <script type="text/javascript"><!– var fixedMenu = menu: document.getElementById fixedMenu.computeShifts = function() fixedMenu.shiftY = fixedMenu.hasInner fixedMenu.moveMenu = function() if (fixedMenu.currentX != fixedMenu.shiftX if (document.layers) fixedMenu.menu.style.right = ”; fixedMenu.floatMenu = function() // addEvent designed by Aaron Moore //if handler is not already stored, assign it fixedMenu.supportsFixed = function() return false; fixedMenu.init = function() fixedMenu.targetLeft = parseInt(ob.left); if (document.layers) fixedMenu.addEvent(window, ‘onload’, fixedMenu.init); |
Below is the code for the Hide and Show button. You can place the code right after the <!—Fixed Menu Bar EoF—>
|
<!–On/Off Code–> fixedMenu.show = function() |
I placed the Hide button on my Fixed Menu and the Show button on my top menu bar just above my banner. You can place the Show button anywhere on your page as you please. Just insert the following code:
|
<a href="#" onclick="return fixedMenu.show()">Show Menu</a> |
Now place the below code in your style.css file. You can change the layout of your menu with the codes below.
|
#fixeddiv { |
If you have any problems with the codes please leave a comment. And if you like this code please visit the creators here. There are many more codes there.




This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.