Last updated: 01 Aug 2008
Absolute Floating Menu Close Link/Button
The javascript demonstrated on this page is a close button/link option for the
Absolute Floating Menu
script.
Script demonstration
Click the buttons to show/hide the floating menu box.
Show the floating menu
Hide the floating menu
Script source code
To use the script perform the following steps:
<script type="text/javascript"><!--
/* Script by: www.jtricks.com
* Version: 20080801
* Latest version:
* www.jtricks.com/javascript/navigation/floating_close.html
*/
floatingMenu.hide = function()
{
floatingMenu.menu.style.display='none';
return false;
}
floatingMenu.show = function()
{
floatingMenu.menu.style.display='block';
return false;
}
//--></script>
- When you need to hide the menu, call
floatingMenu.hide().
- When you need to show the menu again, call
floatingMenu.show(). For example:
<button onclick="floatingMenu.show()">Show</button>
<button onclick="floatingMenu.hide()">Hide</button>
<a href="#" onclick="return floatingMenu.show()">Show</a>
<a href="#" onclick="return floatingMenu.hide()"">Hide</a>
Browser compatibility
The javascript snippet above was tested on the following user agents:
| Mozilla/Netscape |
Firefox 2.0.x |
Ok. |
| Firefox 1.5 |
Ok. |
| Firefox 1.0.x |
Ok. |
| Microsoft |
Internet Explorer 7.0 |
Ok. |
| Internet Explorer 6.0 |
Ok. |
| Opera |
Opera 9.x |
Ok. |
| Opera 8.x |
Ok. |
| KHTML |
Konqueror 3.5.5 |
Ok. |
| Safari 3.1.2 |
Ok. |
No Javascript or Javascript turned off |
Any |
The show/hide effect just will not happen. |