/    Sign up×
Community /Pin to ProfileBookmark

Scrolling Menu compatibility

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?

[b]JavaScript for scrolling menu:[/b]

[code]
<script language=”JavaScript”>
<!– This script and many more are available free online at –>
<!– The JavaScript Source!! [url]http://javascript.internet.com[/url] –>
<!– 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>
[/code]

[b]Load event handlers when page body loads:[/b]

[code]
<body OnLoad=”setVariables();checkLocation()”>
[/code]

[b]PHP code which prints division containing actual menu:[/b]

[code=php]
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
[/code]

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@fredmvDec 22.2003 — All you should need to change is one CSS property of your [font=courier]<div>[/font] to get it working correctly in more browsers. Change this:print("&lt;div id="chimenu" style="position:absolute;To this:print("&lt;div id="chimenu" style="position:fixed;
Copy linkTweet thisAlerts:
@MCPauthorDec 23.2003 — 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. ?
Copy linkTweet thisAlerts:
@JustKIDnJan 22.2004 — [i]Originally posted by fredmv [/i]

[B]All you should need to change is one CSS property of your [font=courier]<div>[/font] to get it working correctly in more browsers. Change this:print("&lt;div id="chimenu" style="position:absolute;To this:print("&lt;div id="chimenu" style="position:fixed; [/B][/QUOTE]


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.
Copy linkTweet thisAlerts:
@fredmvJan 22.2004 — [i]Originally posted by JustKIDn [/i]

[B]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. [/B]
[/QUOTE]
No problem. Although, it doesn't work in IE, just so you're aware, and you'll have to use [url=http://devnull.tagsoup.com/fixed/]this hack[/url] to get it working correctly.

Also... Isn't Mozilla the best? ?
Copy linkTweet thisAlerts:
@JustKIDnJan 22.2004 — 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!
×

Success!

Help @MCP spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...