Using kevin3442s kc_sideDiv.js

Please note that official support for this menu version has now ceased. There are still plenty of users, though, and the forum is still running. Some of our long-time users may be able to help you out.
Post Reply
Terry
Advanced
Advanced
Posts: 13
Joined: Mon Feb 10, 2003 1:05 pm
Location: UK

Using kevin3442s kc_sideDiv.js

Post by Terry »

Does anyone have kevin3442s functions for hiding Divs working OK on Netscape 7 or Mozilla 1.02 ?
Its fine for me on IE5 but not the above browsers.

Also, anyone know how to mod it so it picks up IE5 on a Mac? I am assuming it does not work for ie5 on a mac but if anyone knows different please tell me!
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Hi Terry,

Before I posted the code, I tested the approach with Netscape 7 under Win2k and it worked fine for me. A couple other users have reported to me that it worked in NS7 under WinXPpro. I also found that it worked in Mozilla 1.1 (never tried 1.02 or 1.2.1) in Windows. Are you able to get the sample contained in the .zip file to work in NS7?

Unfortunately, I don't have any Macs to develop/test with; they're never an issue for what we do. I may have to break down and get one (think that excuse'll go over at home???... "Honey, we need to get a Mac because... ").

I don't know much about it, but if IE5 on the Mac is compliant with the W3C DOM, then document.getElementById() should work, which is what leads up to hiding the DIV in IE5 on a Mac. Of course, this is just a "should", not a "does", since I haven't tested it on a Mac. It'll rely somewhat on the browser testing that's actually internal to mmenu.js (I didn't write much additional browser detection code, just relied on what was already built in. I figured, why reinvent the wheel?). Maybe some additional tests need to be done; it should be relatively straight forward (at least in theory!). Can you try it in IE5 on a Mac? If so, and it won't work, I'd be willing to try some modifications if you'd be willing to test them. Meantime, Can you post a URL to the site in question?

Kevin (3442)
Terry
Advanced
Advanced
Posts: 13
Joined: Mon Feb 10, 2003 1:05 pm
Location: UK

Post by Terry »

kevin3442 wrote: I also found that it worked in Mozilla 1.1 (never tried 1.02 or 1.2.1) in Windows. Are you able to get the sample contained in the .zip file to work in NS7?
Good point, should have thought of that :oops: I will check it out and let you know
kevin3442 wrote: Unfortunately, I don't have any Macs to develop/test with; they're never an issue for what we do. I may have to break down and get one (think that excuse'll go over at home???... "Honey, we need to get a Mac because... ").
I dont either but the graphic designer who tells me what the site is supposed to look like does, and he thinks the rest of the world uses them too, so any Mac problems are BIG in his eyes. I will get him to test it and let you know the results.
kevin3442 wrote: Meantime, Can you post a URL to the site in question?
Kevin (3442)
Its just a couple of test/demo pages for the graphic designer at present, its at http://www.llewellyn.co.uk/rok/test.htm, the Flash problem is at same address/maptest.htm. When the site is finished (if they ever stop changing it) it will be at http://www.rokgroup.com
Terry
Advanced
Advanced
Posts: 13
Joined: Mon Feb 10, 2003 1:05 pm
Location: UK

Post by Terry »

Kevin
Tried your sample in the zip file and Both Mozilla and Netscape work fine :) . Played around with my page that uses the Flash thing again and still no joy :cry: . I have to prepare for a meeting tomorro now but will look again monday. If you have any pointers I would be glad to hear them.
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Hi Terry,

Thanks for posting the URLs... makes it so much easier to figure out what's going on. I had a look at your maptest page and your menu arrays. The bad news is that your forehead will probably hurt a little after you smack yourself ;) but that'll wear off. The good news is that the problem turns out to be easy to fix (at least on the Windows side). The divID parameter in the call to kc_onFunc() is case sensitive. In your html, the div ID = flash. In the function call from the main menu items, you pass 'Flash' (a non-existent div from the code's point of view). If you change one or the other so that both match, it'll work; at least in NS7 and Mozilla. As you know, I can't verify that it'll work on a Mac, in any browser. But I imagine that your graphic designer (my sympathies by the way) will be eager to test the change. I'd sure appreciate it if you could post the result either way, so that I'll know if Macs are a problem with this particular div hiding approach. Thanks!

Hope that helps,

Kevin
Terry
Advanced
Advanced
Posts: 13
Joined: Mon Feb 10, 2003 1:05 pm
Location: UK

Post by Terry »

Ow, Ow, Ow ....... :oops:

Will test on a Mac & report back
Terry
Advanced
Advanced
Posts: 13
Joined: Mon Feb 10, 2003 1:05 pm
Location: UK

Post by Terry »

Still waiting for the Mac user to get back to me however he did ring yesterday to point me toward this site http://www.jaguar.com/uk/ "They have menus over the top of Flash animations" says he, "leave it with me" I said 8) , confident it would be a simple trick like hiding the Flash and replacing it with a gif.

So I visit the site using IE5 on Win2K and after closing down the big 'save £1000' popup I take a look at the menu and the Flash movie. PROBLEM: 8O it appears that the menu entitled 'X-Type' does pull down over the large flash animation on the left without a problem. The Flash movie continues to play with the menu over the top. I dont understand how this is possible :? .

I know they are using 'Cooler Menus' from http://www.dhtmlcentral.com however a quick search of the 'cooler menus forum' indicates (as you would expect) plenty of cooler menus users have the same problem as everyone else with menus dropping behind Flash movies when using IE5 and other browsers of that era. Of course they do I thought, its just DHTML & javascript etc, so how is it that http://www.jaguar.com/uk/ appear to have managed it :?:
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Hi Terry,

Quick question: Were you using IE5 or IE5.5 when visiting the jaguar site? I only ask because IE5.5 doesn't have the problem, but (if memory serves) IE5 does, at least in Windows. I know they still suffer from the same "flash-over-dhtml" problem, because when you visit the site with NS7 or Opera 6.05, their menus/flash behave differently, because these browsers also suffer the "flash-over-dhtml" problem. I do like their added touch of substituting .jpg images in place of the flash when the menus open (curiously, they do this for every menu, not just the ones that would intersect the flash... makes me wonder if that's a function of the menu itself or some add on). Clever trick... wish I had thought of it! However... I'm not above adapting the idea for use in the kc_hideDiv functions.

Kevin

P.S. Shall we start thinking of subtle ways to irritate the graphics designer? ;)
Terry
Advanced
Advanced
Posts: 13
Joined: Mon Feb 10, 2003 1:05 pm
Location: UK

Post by Terry »

Kevin,
Its definitely IE5.0 not 5.5 hence my surprise (running on NT).

Re the substituted jpg images, check out the menu at the botton of the screen, at 800x600 I think some of these will pop-up and intersect with the Flash elements.
Terry
Advanced
Advanced
Posts: 13
Joined: Mon Feb 10, 2003 1:05 pm
Location: UK

Post by Terry »

OK the designer has got back to me re IE5 on Mac OS9.1. Apparently it does not work although it does not fail in the way you might expect :cry: . Rather than the old 'drops behind like IE5 on Windows' problem, the menu does draw over the top of the Flash, however its badly corrupted, ie 10-20px missing along one side or its way out of position :( . Not much help really I know, would be good if we got a second Mac user opinion.

Re 'subtle ways to irritate the graphics designer' I find my mind wanders to this sort of thing with worrying regularity already. Any further input from yourself will however be happily recieved :mrgreen: .
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Terry wrote:Its definitely IE5.0 not 5.5 hence my surprise (running on NT). Re the substituted jpg images, check out the menu at the botton of the screen, at 800x600 I think some of these will pop-up and intersect with the Flash elements.
Hi Terry,

Good point about the bottom menus... I hadn't even noticed them. Now that my brain is back in full working order ("Ow, Ow, Ow...") I may have a solution to the IE5 problem, at least in Windows. I guess I was focusing too much on the hiding code, and just now got around to looking at the actual object/embed for the .swf. Try the following:

(1) Add the following param for the <object> block:

Code: Select all

<param name="wmode" value="transparent">
(2) Add the following attribute inside the opening <embed> tag:

Code: Select all

wmode="transparent"
This is based on an article at the macromedia website, discussing the layering of dhtml and flash elements. Doing this will let the page's background color come through the flash's background, but that shouldn't be a problem for you, since both are white in your design.

To get the menus on top of the flash in IE5, you'll have to disable the hiding for ie5... you can remove the '|| ie5' check in kc_onFunc(). I know this'll work in Windows... I tried it, even using your flash. I don't know about IE5 on the Mac (but we know who can test it!). If it doesn't work on the Mac, you could modify the ie5 test in kc_onFunc(); make it ie5mac (with the appropriate test, of course), then put the || ie5mac in the conditional, along with the other pain in the rear browsers.
its badly corrupted, ie 10-20px missing along one side
I'm not sure about that, other than the possibility of a bug in IE5/Mac. See for example, this recent thread in this forum. Maybe the same solution will solve your menu width problem.
or its way out of position
The positioning problem may require additional intervention.

Let me know how it goes...

Kevin
Terry
Advanced
Advanced
Posts: 13
Joined: Mon Feb 10, 2003 1:05 pm
Location: UK

Post by Terry »

Used the code for the <object> and <Param> tags, disabled the ie5 check on kc_Func() and testing in IE5 on W2k IT WORKS! Thanks Kevin. Also got the designer to test on his Mac but unfortunately no improvement. Tried to sniff for IE5 on a Mac and hide the div if found by modifying the function in kc_Func() as follows:

Code: Select all

function kc_onFunc(divID, menuNames)
{
  var ie5Mac
  var isMac = (navigator.appVersion.indexOf("Mac")!=-1) ? true : false;
  if (isMac){ie5Mac = (navigator.appVersion.indexOf("MSIE 5") != -1)};  // not set in mmenu.js


  if (ns6 || opra || ns4 || ie5Mac || ie4) {
    kc_divVisibility(divID, false);
    menuNames = menuNames.replace(/, /gi, ","); // remove a space after a comma
    kc_reshowDiv(divID, menuNames);
  }
}
But still no improvement on the damn Mac. Maybe its my javascript?
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Hi Terry,

Glad you got it working in IE5 for Windows.

You script changes look OK to me in general, but then again i have no experience with browser detection on Macs. I might suggest four things:

(1) There's already a test coded in mmenu.js for Macs. There's a boolean called mac that is set to true or false. The test is actually identical to yours, so you could remove that line from the function and just use the built-in one.

(2) Initialize ie5Mac to false when you declare it. var ie5Mac = false;

(3) I have no experience with scripting specifically for Macs, so this is a shot in the dark, but I suppose it's possible that ie5Mac is not taking on an actual boolean for some reason. You could force a true or false like this (note that the following also uses the menu's built-in mac flag):

Code: Select all

if (mac) ie5Mac = (navigator.appVersion.indexOf("MSIE 5") != -1) ? true : false;
(4) It'd be worth it to insert something in kc_onFunc(), immediately after the assignment of ie5Mac, to see if the browser detection works, like:

Code: Select all

if (ie5Mac) alert("IE5 on the Mac is driving me nuts");
Then you could ask your designer to test it to see if the alert pops up in IE5 on the Mac (shouldn't in others, of course). If it doesn't, then there's a problem in the browser detection. If it does, then the problem is further downstream, in the code that's supposed to toggle the DIV on and off. At least that let's us know where we stand.

Let me know what happens...

Kevin
Terry
Advanced
Advanced
Posts: 13
Joined: Mon Feb 10, 2003 1:05 pm
Location: UK

Post by Terry »

Hi Kevin,
Thought over the whole thing and decided we need to know exactly what the Mac will and wont do so pointed the designer toward that macromedia page you mentioned in a previous post(http://www.macromedia.com/support/flash ... /wmode.htm) expecting him to say the example under 'Item 3/Example with Transparency' did not work on his machine but low and behold he did it to me again and said that it did!!

Given that, it must be something else I am doing wrong but not sure what. Re your items 1-4inc, all good stuff for the future but right now I will continue to try to get the menu and Flash to co-exist happily since it appears from the Macromedia page that they should. If you get any ideas on this please let me know.
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Hi Terry,

It might be worth having the "designer" look at the example again. I looked at that same example before, and it's misleading. The white background may indeed show through with wmode="transparent", but what about the red letters (the DHTML content): do they show above that crazy rotating blue thingy, or does the blue thing obscure the red letters as it goes by?

Kevin
Terry
Advanced
Advanced
Posts: 13
Joined: Mon Feb 10, 2003 1:05 pm
Location: UK

Post by Terry »

Leaving the designer to one side for a moment (or permanently if poss). Now I am not sure what I am doing (no change there then) as using my own machine, IE6 + SP1 on NT4, the red text is below the blue thingy, ie as you say its gets obscured as the 'legs' of the thingy go by.
On your config the text is above?

I am getting a horrible feeling that I just totally misunderstood you. :oops:
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Hi Terry,

Sorry for not replying fo so long. I've been out of touch for most of the last week. I'll be able to get back into it with you tonight or tomorrow.

Hope all is well,

Kevin
Terry
Advanced
Advanced
Posts: 13
Joined: Mon Feb 10, 2003 1:05 pm
Location: UK

Post by Terry »

Thought I would post one more time on this as I found out some more about Macs and Flash and the menu.

Basically I got so frustrated over the whole Mac thing that borrowed a Mac to see it for myself. The Mac is running OSX and IE 5.2 so its not the same as the designer's but its closer than my IE6 on NT4 machine!
Anyway, using the tranparency params for the Flash movies that Kevin lists above the menu's drop down in front of the movies without a problem, no bits missing or mispositioning was apparent. HOWEVER if the Flash movie has a sub-movie embedded in it the sub-movie will not obey the transparency params and sits on top of the menu's. Maybe its possible to stop this behaviour by setting the transparency param for the sub-movie in the main movie but so far have not found out how, (I am not big on Flash and less so now after all this fun & games).
Depending on the size and position of the sub-movie it can give the impression that bits of the menu are missing, especially when the user (the graphic designer in my case) does not know anything about Flash or submenu's so it appears to them that part of the menu has just disapeared.

I know the above is not a definitive end to the Mac/Flash/Menu problem but I thought I would post it as its another factor to be aware of when fixing problems of this sort.
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Hi Again Terry,

Once again I have to apologize for not keeping up the correspondence. My work sometimes takes me into places or situations where I don't have much contact with the "normal" world. That's been the case for the past few weeks. I'm just now able to get to my email (hundreds of spams... drat!).

Your insight into the Mac/Flash issue is interesting. I can't recall ever reading anywhere about the phenomenon involving sub-movies. Don't know of any workarounds, except to hide the whole thing when an overlapping menu opens. Have you had any success with that using your test Mac?

Have you considered the idea that came up earlier (I think involving the jaguar site) of replacing the flash with a static image when the flash is hidden? I played with that a while ago... not hard to do. Just put a a same-size capture of the flash in a div, and put the div in a layer directly behind the flash. You don't even have to turn that div on or off; just leave it visible and the flash will cover it when it is visible. The image would only be revealed when you hide the flash. The user would probably not even notice the change if the flash doesn't include any ongoing animation (which yours doesn't if memory serves). Your designer probably wouldn't even know the difference!

Anyway, let us know where you're headed... I think this is an issue that lots of people face.

Cheers,

Kevin
Post Reply