Kevin's Hiding Flash Clip Function

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

Kevin's Hiding Flash Clip Function

Post by tepidarium »

Hi,

I have searched the forum and found Kevin's hide flash script function. I have applied the function to a test page. I cannot seem to make it work in the appropriate affected browsers (Netscape 4.x, Opera 5.x)

http://www.citytech.cuny.edu/mm-flash.html

Also, for what it's worth - a separate but related issue:

I cannot seem to make the "hidediv" parameter work when surrounding the flash object with a div tag and appropriate id and name parameters.

Besides defining Hidediv in the menu properties in menu_data.js, is there anything else that needs to be done?

Thanks for your time.
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
tepidarium
Mega User
Mega User
Posts: 169
Joined: Sun Oct 05, 2003 4:21 am

Post by tepidarium »

Hergio wrote:Try this

viewtopic.php?t=2193
Thanks for your reply. I neglected to mention that I had already tried the <param name="wmode" value="transparent">

It seems that this is not supported by netscape 4.x - the only browser (besides Opera) where this problem exists.

Has the hidediv function been depricated in Milonic Menu? Or, as is more likely the case, am I doing something wrong? :D

In the initial url I posted, I have only implemented kevin's fix, which (probably due to incorrect coding) does not work.
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Re: Kevin's Hiding Flash Clip Function

Post by kevin3442 »

tepidarium wrote:I have searched the forum and found Kevin's hide flash script function. I have applied the function to a test page. I cannot seem to make it work in the appropriate affected browsers
Hi,

I wrote that script about a year ago for version 3. The approach should still be valid, although the code might need a little tweaking to work with version 5. I'll have a look later today.

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 »

Hi Tep,

I did get a chance to have a look and made some necessary code adjustments. I have a feeling that, for some browsers at least, there might be some more tinkering to do... I just haven't had time to go through it as thoroughly as I'd like. I whipped up a couple of examples... flash, forms, java applet, and iframe; all embeded objects -- in some browsers -- that will layer over dhtml in various, mostly older, browsers. I just used the standard downloadable horizontal menu as a place to start (hope you don't mind Andy).

Normally, I'd add at least some basic documentation to it and test it better before uploading, but I haven't had as much time to do that the last couple of days. I'm leaving for vacation tomorrow (YAY! ... later today actually) and will be out of touch for a week and a half, so I thought I'd go ahead and upload this for you so you might at least try it out and see if the general approach will help. I'm sure I'll have time for improvements/fixes when I get back. In the meantime, feel free to give it a try. Download mm_hideDiv.zip, unzip it to a new folder, copy the latest menu scripte (milonic_src.js, mmenudom.js, mmenuns4.js) into the same folder, then open the index.htm file. The examples can be loaded from the "Hide Div Examples" menu.

As I said, there really isn't any documentation save for a few meager comments in mm_hideDiv.js. The approach is logically the same as the one I did for version 3:

(1) Wrap the offending embeded object (flash, form, java applet, iframe) in a <div> and give the div an ID.

(2) Use a menu item's onfunction property to call mm_hideDiv(divID, menuNames); it should be called from the menu item that opens a menu that will end up falling behind the offending embeded object (flash, form, whatever). The parameters you pass to the function are:

divID - a string containing the ID of the div you want to hide.

menuNames - a string containing a comma-separated list of the names of all menus that, when open, overlap the offending embeded object. The div should remain hidden as long as any one of those named menus is open, then reappear as soon as none of those named menus are open.

There are some user-adjustable parameters at the top of mm_hideDiv.js that may need to be tweaked, depending on individual implementations of the menu system. There's also a Browser Detection object called sniffBrowser() toward the top of mm_hideDiv.js that you can add more "bad" browsers to, as needs require, depending on your targeted platforms.

Open the included menu_data.js file and examone the Main Menu items to see how the mm_hideDiv() function is used in conjunction with each menu item's onfunction property. Note that this won't work with NS4 because, as far as I can tell, onfunction does not yet work with NS4. Maybe try in in IE4 or Opera6.

Sorry the instructions and examples aren't better; I'll hope to improve that upon my return. Hope you (and maybe a few others) find this useful.

Aloha!

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

Post by tepidarium »

Kevin - Thank you so much for taking the time to rework this. I am going to download it and try it out and will get back to you. I hope in the future Milonic might put back a general hidediv function for the menu.

Have agreat time on your vacation, and once again thanks for providing this code.
:D
Post Reply