CreativeJS | The very best of creative JavaScript and HTML5. Processing.js. CodingForums.com- Web coding and development forums. Get help on JavaScript, PHP, CSS, XML, mySQL, ASP, and more! Absolute Floating Menu - Javascript Tricks and Code Examples. Last updated: 21 Dec 2012 Many web pages are too long to fit on most users' screens. The visitors have to scroll to read the article on the page; however such scrolling hides the navigation menus (or a shopping cart contents) usually located at the top of the page. The javascript shown here allows to create dynamic menus which move along with scrolling. Such floating menu will be always visible on screen. The effect is achieved my moving an absolutely-positioned or relatively-positioned DIV box containing the menu markup.
The floating DIV will visibly move towards the specified viewing area spot, slowing as it moves closer to it and finishing the move with a visible snap. Also available: Features include: Floating DIV demonstration Look for the floating box somewhere on the page. Click the buttons to move the floating menu to different corners: Using the javascript Create a DIV element with id of 'floatdiv' which contains the menu markup and add script start code.
See Also Browser compatibility. Create a new Fiddle - jsFiddle - Online Editor for the Web (JavaScript, MooTools, jQuery, Prototype, YUI, Glow and Dojo, HTML, CSS) JavaScript Source: Free JavaScripts, Tutorials, Example Code, Reference, Resources, and Help - JS.