Hi all,

Please help me in floating menu. I need this floating function should floting in table td. And should work in all browser. plz help me out soon. Below i have pasted javascript.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<table width="1003" border="0" cellspacing="0" cellpadding="0">
<td width="790" height="90">&nbsp;</td>
<td width="213">&nbsp;</td>
<td height="800">&nbsp;</td>
<td valign="top">
<DIV id=divMenu style="VISIBILITY: visible; WIDTH: 10px; POSITION: absolute; TOP: 10px; HEIGHT: 10px">
<td >
INsert_your_Object Here_Here
<SCRIPT language="JavaScript">
var isDOM = (document.getElementById ? true : false);
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);
var isNS = navigator.appName == "Netscape";
function getRef(id)
if (isDOM) return document.getElementById(id);
if (isIE4) return document.all[id];
if (isNS4) return document.layers[id];

function moveRightEdge()
var yMenuFrom, yMenuTo, yOffset, timeoutNextCheck ;
if (isNS4)
yMenuFrom   = divMenu.top;
yMenuTo     = windows.pageYOffset + 137;
else if (isDOM)
yMenuFrom   = parseInt (divMenu.style.top, 10);
yMenuTo     = (isNS ? window.pageYOffset : document.body.scrollTop) + 30;
//Specify the distance of the  Floating Object from top.
}   timeoutNextCheck = 50;
if (yMenuFrom != yMenuTo)

yOffset = Math.ceil(Math.abs(yMenuTo - yMenuFrom) / 20);
//Specify the floating Speed high=0,slow=500. etc
if (yMenuTo < yMenuFrom)
yOffset = -yOffset;
if (isNS4)
divMenu.top += yOffset;
else if (isDOM)
divMenu.style.left =  120;
//Specifies the distance of the floating object from left.
divMenu.style.top = parseInt (divMenu.style.top, 10) + yOffset;
timeoutNextCheck = 0; //Specifies the speed of reaction .
setTimeout ("moveRightEdge()", timeoutNextCheck);}
if (isNS4) {    var divMenu = document["divMenu"];
divMenu.top = top.pageYOffset + 0;
divMenu.visibility = "visible";
else if (isDOM)
var divMenu = getRef('divMenu');
divMenu.style.top = (isNS ? window.pageYOffset : document.body.scrollTop) + 0;
divMenu.style.visibility = "visible";   moveRightEdge();



Edited by happygeek: fixed formatting

8 Years
Discussion Span
Last Post by raj2476

this script is not working in firefox lawrendc. could u help me out to get to work in other browsers also

This article has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.