Click to See Complete Forum and Search --> : Scrolling Menu compatibility


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

fredmv
12-22-2003, 03:03 AM
All you should need to change is one CSS property of your <div> to get it working correctly in more browsers. Change this:print("<div id=\"chimenu\" style=\"position:absolute;To this:print("<div id=\"chimenu\" style=\"position:fixed;

MCP
12-23-2003, 02:30 AM
Thanks for your suggestion. I added that line, and now the menu does scroll with the window in Netscape. However, it is positioning itself vertically at the very top of the window. I would like the menu to stay about 100 pixels below the top of the window. I've got this working in IE. Does anyone know how to get it working for the AOL and Netscape browsers?
Thanks.

::: EDIT :::
I figured out how to get the menu to drop down vertically in Netsape. I changed the
top:0px; to top:90px; Thanks everyone for your help. I'll definately recommend this forum. :D

JustKIDn
01-21-2004, 11:29 PM
Originally posted by fredmv
All you should need to change is one CSS property of your <div> to get it working correctly in more browsers. Change this:print("<div id=\"chimenu\" style=\"position:absolute;To this:print("<div id=\"chimenu\" style=\"position:fixed;

Thanks for that help.

I've been trying to fix this for something similar every since I started using Mozilla and now Firebird.

It works great now.

fredmv
01-21-2004, 11:41 PM
Originally posted by JustKIDn
Thanks for that help.

I've been trying to fix this for something similar every since I started using Mozilla and now Firebird.

It works great now. No problem. Although, it doesn't work in IE, just so you're aware, and you'll have to use this hack (http://devnull.tagsoup.com/fixed/) to get it working correctly.

Also... Isn't Mozilla the best? :D

JustKIDn
01-22-2004, 12:36 AM
I really don't much care if ie (ie. incompatible) doesn't work.
As long as it works in the important browsers.

Yes Mozilla IS the best. At least Firebird is!

Now if we could just get some JavaScripts to be written correctly to work in Mozilla.

I've got at least one more script I'm trying to figure out how to fix. It's nothing important.

It's just one of those where the objects (in this case it's a bunch of little balls) chase the mouse around the screen.

It has a few <div> lines like the one listed above. But changing them to 'Fixed' didn't help for this problem.

Oh well!