Show / Hide DIV

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.
User avatar
yadin
Super Advanced
Super Advanced
Posts: 69
Joined: Sun May 19, 2002 8:23 pm
Location: State College, PA, USA
Contact:

Show / Hide DIV

Post by yadin »

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
Guest

Re: Show / Hide DIV

Post by Guest »

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
Guest

Re: Show / Hide DIV

Post by Guest »

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

Re: Show / Hide DIV

Post by Guest »

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...
Guest

Re: Show / Hide DIV

Post by Guest »

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.
Guest

Re: Show / Hide DIV

Post by Guest »

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

Thanks
Guest

Re: Show / Hide DIV

Post by Guest »

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.
Guest

Re: Show / Hide DIV

Post by Guest »

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?
Guest

Re: Show / Hide DIV

Post by Guest »

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.
Guest

Re: Show / Hide DIV

Post by Guest »

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! :)
Guest

Re: Show / Hide DIV

Post by Guest »

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)
Guest

Post by Guest »

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:
s0ccerdude

Re: Show / Hide DIV

Post by s0ccerdude »

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>
lefou
Beginner
Beginner
Posts: 2
Joined: Sun May 26, 2002 5:51 am

You may see this working DIV trick on our site

Post by lefou »

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
lefou
Beginner
Beginner
Posts: 2
Joined: Sun May 26, 2002 5:51 am

Update

Post by lefou »

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
User avatar
racine
Advanced
Advanced
Posts: 14
Joined: Fri Jun 21, 2002 8:22 pm
Location: Grass Valley, California
Contact:

Issues with Multiple ID definitions

Post by racine »

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?
SoTTo
Advanced
Advanced
Posts: 26
Joined: Thu May 30, 2002 6:59 pm
Contact:

Post by SoTTo »

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>
Mommy, Look! The cursor's winking at me!
br0ck
Beginner
Beginner
Posts: 2
Joined: Tue Jul 02, 2002 4:31 pm

Version 3.4.12 breaks the show/hide div

Post by br0ck »

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!
neilyneil
Beginner
Beginner
Posts: 1
Joined: Wed Jul 10, 2002 6:33 pm

Post by neilyneil »

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: Select all

<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>
Raedan
Beginner
Beginner
Posts: 1
Joined: Thu Jul 18, 2002 10:55 am

a lot of forms on your site?

Post by Raedan »

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: Select all

formz="form1;form2;form3"
reference the variable instead of the div id in the menu array

Code: Select all

[b]formz[/b],		
// ID of the div you want to hide on MouseOver (useful for hiding form elements)
and in the menu definition

Code: Select all

	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
	])
Post Reply