Floting menu for Browser compatibility

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Jun 2008
Posts: 9
Reputation: raj2476 is an unknown quantity at this point 
Solved Threads: 0
raj2476 raj2476 is offline Offline
Newbie Poster

Floting menu for Browser compatibility

 
0
  #1
Jun 26th, 2008
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.

Thanks
Raj


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

<body>
<table width="1003" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="790" height="90">&nbsp;</td>
<td width="213">&nbsp;</td>
</tr>
<tr>
<td height="800">&nbsp;</td>
<td valign="top">
<DIV id=divMenu style="VISIBILITY: visible; WIDTH: 10px; POSITION: absolute; TOP: 10px; HEIGHT: 10px">
<table>
<tr>
<td >
INsert_your_Object Here_Here
</td>
</tr>
</table>
<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";
moveRightEdge();
}
else if (isDOM)
{
var divMenu = getRef('divMenu');
divMenu.style.top = (isNS ? window.pageYOffset : document.body.scrollTop) + 0;
divMenu.style.visibility = "visible"; moveRightEdge();
}
</SCRIPT>
</DIV>



</td>
</tr>
</table>

</body>
</html>
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 2
Reputation: lawrendc is an unknown quantity at this point 
Solved Threads: 1
lawrendc lawrendc is offline Offline
Newbie Poster

Re: Floting menu for Browser compatibility

 
0
  #2
Jun 26th, 2008
The script work perfect . no error. What do you want??
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 9
Reputation: raj2476 is an unknown quantity at this point 
Solved Threads: 0
raj2476 raj2476 is offline Offline
Newbie Poster

Re: Floting menu for Browser compatibility

 
0
  #3
Jun 27th, 2008
this script is not working in firefox lawrendc. could u help me out to get to work in other browsers also
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC