Can certain browsers be forced to ignore the Menu?

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
tepidarium
Mega User
Mega User
Posts: 169
Joined: Sun Oct 05, 2003 4:21 am

Can certain browsers be forced to ignore the Menu?

Post by tepidarium »

Hi,
Is there some way (perhaps some sort of Javascript) to allow Netscape 4 to completely ignore the Milonic Menu code and not load the menu?

Simply omitting the part of the menu code that pertains to NN4 will result in netscape not being able to load the page at all...

Thanks for any advice... :)
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Maybe something like the following would work. Replace the standard lines for loading the menu scripts... i.e., these:

Code: Select all

<SCRIPT language=JavaScript src="milonic_src.js" type=text/javascript></SCRIPT>
<script	language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=mmenuns4.js><\/scr"+"ipt>");
  else _d.write("<scr"+"ipt language=JavaScript src=mmenudom.js><\/scr"+"ipt>");
</script>
<SCRIPT language=JavaScript src="menu_data.js" type=text/javascript></SCRIPT>
with these:

Code: Select all

<script language="javascript">
_NS4 = (document.layers) ? true : false;
if(!_NS4) {
  document.write("<scr"+"ipt language=JavaScript src=milonic_src.js><\/scr"+"ipt>");
  document.write("<scr"+"ipt language=JavaScript src=mmenudom.js><\/scr"+"ipt>");
  document.write("<scr"+"ipt language=JavaScript src=menu_data.js><\/scr"+"ipt>");
}
</script>
Let us know if that works.

Kevin
tepidarium
Mega User
Mega User
Posts: 169
Joined: Sun Oct 05, 2003 4:21 am

Post by tepidarium »

I'll try it and let you know.

Thanks for your response, Kevin!
tepidarium
Mega User
Mega User
Posts: 169
Joined: Sun Oct 05, 2003 4:21 am

Post by tepidarium »

Golly! Kevin - it works!
Check out: http://www.citytech.cuny.edu/mm-xns4.html

Of course, you'll need a copy of N4x to see the result.

This is great. I didn't like the performance of the menu in N4 (loads real slow and can crash the browser) now I can have N4 ignore the menu and I have text links to the main page of the site at the bottom of the page. Now if I could get the menu to hide the flash scroller I'd be set to implement the menu! :)

Thanks for that javascript code!
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

tepidarium wrote:...Of course, you'll need a copy of N4x to see the result.
No way :!: ... I'll just take your word for it!

Glad it helped,

Kevin
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Well, I've got 4.79 and yep it works, no menu!
tepidarium
Mega User
Mega User
Posts: 169
Joined: Sun Oct 05, 2003 4:21 am

Post by tepidarium »

innkeeper9 wrote:Well, I've got 4.79 and yep it works, no menu!
yay! :D :D
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

What do you mean, hide the flash scroller?

Ruth
tepidarium
Mega User
Mega User
Posts: 169
Joined: Sun Oct 05, 2003 4:21 am

Post by tepidarium »

innkeeper9 wrote:What do you mean, hide the flash scroller?

Ruth
The news scroller under the right side of the menu. In some browsers - IE 5.0, 5.5, Safari, 5.2 for the mac, Opera 5 & 7, the menu opens behind the flash movie.

I haven't been able to find a good cross browser dhtml solution (they almost always don't work well in NS4 & others) so Is tick with the flash...

The milonic hide div function does not yet work...so no options really.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

I don't know about the hide div function, but the divhider.js works. I have it on my site which has an applet. http://www.poems2u.com/page0.htmland here's the link for the sample. http://milonic.com/download.php?sampleid=14 The only thing when I first got it I couldn't find the divhider.js file, that's because it's not with the sample, but since it's on the milonic page where the sample is shown it got downloaded the my temp internet files and I just copied it from there. The version on the site is rc31...I'm redoing the menu before I update everything but I did test with the newest 5.03 and it seems to work even better.

Edit: I forgot, it works in nn4.79, and up, Firebird .07, Opera 7. It doesnt' work in Opera 6, and I don't know about macs.

Ruth
Last edited by Ruth on Mon Nov 28, 2005 6:55 pm, edited 1 time in total.
tepidarium
Mega User
Mega User
Posts: 169
Joined: Sun Oct 05, 2003 4:21 am

Post by tepidarium »

innkeeper9 wrote:I don't know about the hide div function, but the divhider.js works. I have it on my site which has an applet. http://www.poems2u.com/page0.htmland here's the link for the sample. http://milonic.com/download.php?sampleid=14 The only thing when I first got it I couldn't find the divhider.js file, that's because it's not with the sample, but since it's on the milonic page where the sample is shown it got downloaded the my temp internet files and I just copied it from there. The version on the site is rc31...I'm redoing the menu before I update everything but I did test with the newest 5.03 and it seems to work even better.

Edit: I forgot, it works in nn4.79, and up, Firebird .07, Opera 7. It doesnt' work in Opera 6, and I don't know about macs.

Ruth
Hmm..I remember using divhider.js and there being a problem. I'll try it again and let you know..thanks for the suggestion.
tepidarium
Mega User
Mega User
Posts: 169
Joined: Sun Oct 05, 2003 4:21 am

Post by tepidarium »

kevin3442 wrote:
tepidarium wrote:...Of course, you'll need a copy of N4x to see the result.
No way :!: ... I'll just take your word for it!

Glad it helped,

Kevin
Kevin - Is there a way to augment the javascript cod you wrote above to include other content other than the menu (ie. so I could provide an alternative text based links) Something like an if then else statement?
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Well, I can't test it on Macs so maybe that was the problem?
tepidarium wrote:
Kevin - Is there a way to augment the javascript cod you wrote above to include other content other than the menu (ie. so I could provide an alternative text based links) Something like an if then else statement?


That's a good question. I wonder if that could be designed to have nn4 choose version 3, and all the others to choose version 5? Not that the menu doesn't work well in nn4, but the design I do causes problems in nn4.

Ruth
tepidarium
Mega User
Mega User
Posts: 169
Joined: Sun Oct 05, 2003 4:21 am

Post by tepidarium »

innkeeper9 wrote:I don't know about the hide div function, but the divhider.js works. I have it on my site which has an applet. http://www.poems2u.com/page0.htmland here's the link for the sample. http://milonic.com/download.php?sampleid=14 The only thing when I first got it I couldn't find the divhider.js file, that's because it's not with the sample, but since it's on the milonic page where the sample is shown it got downloaded the my temp internet files and I just copied it from there. The version on the site is rc31...I'm redoing the menu before I update everything but I did test with the newest 5.03 and it seems to work even better.

Ruth
Hi,

I downloaded the divhider sample again and this is tstrange but the package does not contain any reference to divhider.js in the code nor does it show what to write into the code to make it work... any suggestions...it works great on your site!
tepidarium
Mega User
Mega User
Posts: 169
Joined: Sun Oct 05, 2003 4:21 am

Post by tepidarium »

Innkeeper - I took a look at your menu code and figured out how to do it. The hidediv is working great but there is one problem -- in MAC Safari - after the div hides the flash movie, it does not show it again when the user scrolls off the affected menus

anyone who can help please have a look in MAC Safari:
http://www.citytech.cuny.edu/mm-xns4-div.html


It works great in MAC IE 5.02

P.s. I removed the style postion relative for the div in the meu code because on window resize in netscape 6 for the pc it moves the flash movie all over the page.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

I was just going to give you the info. I noticed that you've got it set inside that particular table cell, and i'm sure that's how it's supposed to work. Mine is the whole table since the applet takes up about 80% of it. Anyway, I don't know about macs... :lol: ... I don't know about pcs either, so I just try various things to see if this or that works. Wonder if you put it outside the whole table in which that flash is, if that might take care of the safari issue? Or perhaps put it outside the <td> in which the flash is. Just a thought.

Ruth
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

innkeeper9 wrote:...here's the link for the sample. http://milonic.com/download.php?sampleid=14 The only thing when I first got it I couldn't find the divhider.js file, that's because it's not with the sample,...
This seems to come sometimes when people download the div hiding sample... divhider.js is not in the downladable version. For anyone who is interested, you can click here to download divhider.js. You should place it in the same folder as the other files you extracted from the downloadable sample.

Kevin
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

innkeeper9 wrote:
tepidarium wrote:
Kevin - Is there a way to augment the javascript cod you wrote above to include other content other than the menu (ie. so I could provide an alternative text based links) Something like an if then else statement?


That's a good question. I wonder if that could be designed to have nn4 choose version 3, and all the others to choose version 5? Not that the menu doesn't work well in nn4, but the design I do causes problems in nn4.

Ruth
Tep: Yes. All things are possible through javascript... well... ok, not really, but many things are and this should be one of them. Generally, like so:

Code: Select all

<script	language="javascript">
_NS4 = (document.layers) ? true : false;
if (_NS4) {
  // do ns4 stuff
}
else {
  // do non-ns4 stuff, like loading menu scripts.
}
</script>
If you want more specifics, maybe we can look at that a bit later. Here's another thought... Could you put some regular html links behind where the menu normally is? They'd always be there (also good for search engine indexing), but when the menu is present, it would cover up the links, so it would be as if they weren't there. But if the menu wasn't present (NS4), the links would be uncovered and available.

Ruth: Very interesting idea (loading v3 menu for NS4). And definitely do-able. I believe tepidarium would still run into the flash problem, although v3 has a div hiding function also (and I also wrote some div hiding scripts for v3 that were definitely effective against NS4).

Kevin
tepidarium
Mega User
Mega User
Posts: 169
Joined: Sun Oct 05, 2003 4:21 am

Post by tepidarium »

kevin3442 wrote: Tep: Yes. All things are possible through javascript... well... ok, not really, but many things are and this should be one of them. Generally, like so:

Code: Select all

<script	language="javascript">
_NS4 = (document.layers) ? true : false;
if (_NS4) {
  // do ns4 stuff
}
else {
  // do non-ns4 stuff, like loading menu scripts.
}
</script>
If you want more specifics, maybe we can look at that a bit later. Here's another thought... Could you put some regular html links behind where the menu normally is? They'd always be there (also good for search engine indexing), but when the menu is present, it would cover up the links, so it would be as if they weren't there. But if the menu wasn't present (NS4), the links would be uncovered and available.
Hi kevin,

Thanks for your response...What do you mean by putting links "behind" the menu? I have the menu locked into a table cell - I don't see how I could place links behind the menu...

as for the javascript, I know zero coding, (i wish I knew it) and I'm not sure of the syntax...
tepidarium
Mega User
Mega User
Posts: 169
Joined: Sun Oct 05, 2003 4:21 am

Post by tepidarium »

Please see next post!
Last edited by tepidarium on Thu Feb 26, 2004 5:20 pm, edited 1 time in total.
Post Reply