MCP
12-22-2003, 01:26 AM
I'm trying to get a scrolling menu on my site to be compatible with IE, Netscape, and AOL browsers.
So far it seems to only work in IE. Any suggestions on what I can do to get it working with all three?
JavaScript for scrolling menu:
<script language="JavaScript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
function setVariables() {
var BrowserType = navigator.userAgent;
if (BrowserType.indexOf("MSIE") != 25) {
//if (navigator.appName == "Netscape") {
v=".top=";
dS="document.";
sD="";
y="window.pageYOffset";
}
else {
v=".pixelTop=";
dS="";
sD=".style";
y="document.body.scrollTop";
}
}
function checkLocation() {
object="chimenu";
yy=eval(y) + 90;
eval(dS+object+sD+v+yy);
setTimeout("checkLocation()",10);
}
// End -->
</script>
Load event handlers when page body loads:
<body OnLoad="setVariables();checkLocation()">
PHP code which prints division containing actual menu:
print("<table border=0 width=\"925\" align=\"center\">\n"); // begins page table
print("<tbody>\n<tr>\n<td width=\"200\" align=\"left\" valign=\"top\">\n"); // begins navigation cell
print("<div id=\"chimenu\" style=\"position:absolute; visibility:show; left:50px; top:0px; z-index:2\">\n<table border=0 cellpadding=0>\n<tbody>\n<tr>\n<td>\n"); // sets division for portable menu
require("navbar.php"); // includes navbar
print("</td>\n</tr>\n</tbody>\n</table>\n</div>\n"); // ends division
So far it seems to only work in IE. Any suggestions on what I can do to get it working with all three?
JavaScript for scrolling menu:
<script language="JavaScript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
function setVariables() {
var BrowserType = navigator.userAgent;
if (BrowserType.indexOf("MSIE") != 25) {
//if (navigator.appName == "Netscape") {
v=".top=";
dS="document.";
sD="";
y="window.pageYOffset";
}
else {
v=".pixelTop=";
dS="";
sD=".style";
y="document.body.scrollTop";
}
}
function checkLocation() {
object="chimenu";
yy=eval(y) + 90;
eval(dS+object+sD+v+yy);
setTimeout("checkLocation()",10);
}
// End -->
</script>
Load event handlers when page body loads:
<body OnLoad="setVariables();checkLocation()">
PHP code which prints division containing actual menu:
print("<table border=0 width=\"925\" align=\"center\">\n"); // begins page table
print("<tbody>\n<tr>\n<td width=\"200\" align=\"left\" valign=\"top\">\n"); // begins navigation cell
print("<div id=\"chimenu\" style=\"position:absolute; visibility:show; left:50px; top:0px; z-index:2\">\n<table border=0 cellpadding=0>\n<tbody>\n<tr>\n<td>\n"); // sets division for portable menu
require("navbar.php"); // includes navbar
print("</td>\n</tr>\n</tbody>\n</table>\n</div>\n"); // ends division