Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Archived Topics for the old Version 3.0 JavaScript Menu
Forum Topic: Click to view post
Last Updated: Wednesday July 18 2012 - 06:07:46

Show / Hide DIV


Poster: yadin
Dated: Monday January 28 2002 - 17:56:05 GMT

Has anyone made use of the show / hide Div feature with a menu item mouseover that is willing to share how they did it with the Milonic menu?
Thanks,
Andre

Re: Show / Hide DIV


Poster: Anonymous
Dated: Sunday May 19 2002 - 19:50:42 BST

This is a new feature added to version 3.3

You need to create a div on your page that will contain the elements you want to disapear when you move the mouse over a menu item. You also need to give this div an id.

Then you enter the id of the div inside the menu array (item 18).

When you have done this and the menu is running. When the user opens that particular menu the specified div will disapear and then reapear when
the user moves off.

Hope it's not too complicated.

-- Andy

Re: Show / Hide DIV


Poster: Anonymous
Dated: Sunday May 19 2002 - 19:50:43 BST

I've been trying to get this feature to work all day... I'm probably just not doing something right. :)

Re: Show / Hide DIV


Poster: Anonymous
Dated: Sunday May 19 2002 - 19:50:44 BST

I've tried to add a simple layer with id "layer1", and then set the item 18 with value "layer1", but it doesn't work...

Re: Show / Hide DIV


Poster: Anonymous
Dated: Sunday May 19 2002 - 19:50:45 BST

Try argument 17 instead of 18. There should be 5 commas between "layer1" and the menu label. I had to add the ID to each top-level menu array that pops up since it doesn't seem to work for the initial menu.

Re: Show / Hide DIV


Poster: Anonymous
Dated: Sunday May 19 2002 - 19:50:46 BST

How to add ID to each top-level menu array? Can you please explain more?

Thanks

Re: Show / Hide DIV


Poster: Anonymous
Dated: Sunday May 19 2002 - 19:50:47 BST

Note where "layer1" is in the following. Do this for each menu that pops up.

addmenu(menu=["menu2"],
,,170,1,"",style2,,"left",effect,,,,,,,,"layer1",,,,
,"Menu Label","Menu URL","URL if this pops up a menu","status bar text",1
])

MY BUG: This only works in IE for me. For NS, I've tried a bare page with class="layer", but have had no luck. In fact, adding the layer argument makes all of the menus popup and never disappear for NS 4.75/NT 4.0.

Re: Show / Hide DIV


Poster: Anonymous
Dated: Sunday May 19 2002 - 19:50:48 BST

It isn't working for me, either. I tried adding my div id (layer1) to all of the menu headers, but nothing disappears, even in IE. I had hoped to hide forms that are under the menu in IE but above it in opera. Do I need more than <div id="layer1"> ...stuff to hide...</div> in the file?

Re: Show / Hide DIV


Poster: Anonymous
Dated: Sunday May 19 2002 - 19:50:50 BST

In addition to the Netscape problem, I've found a problem in IE 6 with multiple sequential popups. As you move your mouse down, the first menu pops up and the DIV disappears, but as you continue down the subsequent menus pop up and the DIV remains visible.

Re: Show / Hide DIV


Poster: Anonymous
Dated: Sunday May 19 2002 - 19:50:51 BST

PLEASE OH PLEASE OH PLEASE fix the problem where the first item doesn't hide the menu and I'll love you forever! EVERYTHING is perfect except for that! I BEG of you! :)

Re: Show / Hide DIV


Poster: Anonymous
Dated: Sunday May 19 2002 - 19:50:52 BST

Having problems with this too...

works on IE Mac/IE Win

Fails on NS Mac/NS Win

Would love to see a fix or workaround... (preferably allowing the layer of the menu to overlap the applet)


Poster: Anonymous
Dated: Friday May 24 2002 - 2:20:26 BST

I have the same problem here. I have tried everything this forum has said and it does not work. I got it to work on a flash movie but not on my dropdown form. I have tried everything but nooo..

I really hope that this can be fixed in the future....

:cry: :cry: :cry:

Re: Show / Hide DIV


Poster: Anonymous
Dated: Friday May 24 2002 - 21:54:30 BST

Use this for your <DIV> tag and hiding should work in NS.

<div id="layer1" name="layer1" class="layer" style="position:relative;">
Stuff to hide
</div>

You may see this working DIV trick on our site


Poster: lefou
Dated: Sunday May 26 2002 - 6:05:22 BST

Hello!

Somebody helped me set this up, but the fact is, it is working fine. You may see a live example on http://www.iwns.org (top left, there's a month poll, which will disappear when you open the DHTML scroll-following menu). The poll form is included within the <div> </div> tags. This works very good in Netscape 4.7x, IE 5.0, 5.5, 6.0; hadn't the possibility to try it on Mac or other browsers 8O

The problem before was that in Netscape there appeared like holes in the menu, when it opened over the elements of this poll form; now the form simply disappears, when the menu opens. I use still version 3.3.19, as I still had not the time (and maybe patience) to upgrade to 4.x :)

Cheers, Michel

PS I see here many posts from people who couldn't get this trick work. Well, one good idea is looking at the html source of our mainpage, where this is working, and to the menu file (you'll locate it easily by opening the source of the mainpage; then simply "copy/paste" the location into your webbrowser address bar, hit "Enter", and save it to disk; or, even easier, in IExplorer, select FILE->SAVE AS->[save as "Webpage complete, *.htm, *.html], and then in the folder with the saved files for the page find the .js menu file).
Hope this helps. :D

Update


Poster: lefou
Dated: Saturday June 15 2002 - 23:00:13 BST

PS When (sometimes) we don't have a month poll, there must still be a sign, like [no polls active] or smth. like that, inlcuded within the <div> tags, so this must disappear, too. Well, you can include WHAT YOU WANT in the DIV tags, a picture, text, anything; but as the problem is mainly with Netscape 4.x and forms, this is intended fot use especially for that. :P

Issues with Multiple ID definitions


Poster: racine
Dated: Friday June 21 2002 - 20:44:24 BST

I'm able to create a single ID definition to hide a single form element, no problems there. But as soon as I add a second ID ie:

"formstohide;formstohide2", // ID of the div you want to hide on MouseOver (useful for hiding form elements)

Then nothing works anymore (no form elements hide)

I'm placing seperate <DIV> tags around 2 different form elements. In some case in different forms, others in the same form.

Seems as soon as you add the second id name in the definitions, then it breaks.

Anyone done this? Or have any ideas?


Poster: SoTTo
Dated: Tuesday June 25 2002 - 9:17:19 BST

why not using 1 id?

this works...
<div id=hidethisone><form name=form1>blahblahblah</form></div>
<div id=hidethisone><form name=form2>blahblahblah</form></div>

Version 3.4.12 breaks the show/hide div


Poster: br0ck
Dated: Tuesday July 2 2002 - 16:42:48 BST

Andy,

I switched to the latest version -3.4.12- of mmenu.js and the show/hide div feature stopped hiding the specified div! I tried various things, but I think that this feature has disappeared.

Thanks!


Poster: neilyneil
Dated: Wednesday July 10 2002 - 18:52:09 BST

I'm testing out 3.4...so far I can only hide a select element in IE5.5 if the div id and the form name are the same. If div id="hideMe" and form name="hideMe", then it works. If div id="hideMe" and form name="form1", doesn't work. NS 6.2 hides the form no matter what...something about built-in form controls instead of OS.

Anyway, neither one wil hide a Flash object, div or no div. Any wisdom anyone can offer would be welcome.

I've used this script with other menus to hide named divs containing flash...doesn't always work with NS though. And you'd need to fire it from a mouseover, specifying the name of the div in the mouseover trigger.

Code:
<SCRIPT language="javascript">
function showDiv(divid) {
   if (document.layers) document.layers[divid].visibility="show";
   else document.getElementById(divid).style.visibility="visible";
}
function hideDiv(divid) {
   if (document.layers) document.layers[divid].visibility="hide";
   else document.getElementById(divid).style.visibility="hidden";
}
</script>

a lot of forms on your site?


Poster: Raedan
Dated: Thursday July 18 2002 - 11:13:53 BST

I have a lot of forms on my site. it is more of an application than a website.

One thing I did to make it easy to add them is create a new variable in the menu_array.js

Code:
formz="form1;form2;form3"


reference the variable instead of the div id in the menu array

Code:
[b]formz[/b],      
// ID of the div you want to hide on MouseOver (useful for hiding form elements)


and in the menu definition

Code:
   addmenu(menu=["statusboards",
   ,,120,1,"",style1,,"left",effect,,,,,,,,[b]formz[/b],,,,
   ,"All Open","statusboard.cfm",,"All Open Items",1
   ,"Projects","statusboard_proj.cfm",,"Projects",1
   ,"Workorders","statusboard_work.cfm",,"Work Orders",1
   ])

Only way?


Poster: sbueffel
Dated: Thursday July 18 2002 - 23:55:47 BST

Andy, as I noted on another post, this works naturally in IE 6 (maybe 5.5+). But if you add the hide div feature to make it work in NN\Opera, it actually makes it worse in IE by hiding what worked fine before. Is there a way (or going to be a way) to make the menu stay above a form\div without hiding the div, a la IE6? Thanks. Scott.

Re: Issues with Multiple ID definitions


Poster: dfroehli
Dated: Thursday July 25 2002 - 2:50:23 BST

I am having the same problem now...when I add the second form to the menu (i.e., "form1;form2") nothing is hidden.

It only seems to work with one form.



racine wrote:
I'm able to create a single ID definition to hide a single form element, no problems there. But as soon as I add a second ID ie:

"formstohide;formstohide2", // ID of the div you want to hide on MouseOver (useful for hiding form elements)

Then nothing works anymore (no form elements hide)

I'm placing seperate <DIV> tags around 2 different form elements. In some case in different forms, others in the same form.

Seems as soon as you add the second id name in the definitions, then it breaks.

Anyone done this? Or have any ideas?


Poster: maxxxp
Dated: Wednesday July 31 2002 - 10:35:31 BST

I switched to the latest version 3.5 and the show/hide div feature work very well on IE6 but the same doesn't work on IE5! It's a bug?