Displaying subMenu OVER an IFrame

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
User avatar
msaunders
Beginner
Beginner
Posts: 4
Joined: Wed Jul 02, 2003 8:20 am

Displaying subMenu OVER an IFrame

Post by msaunders »

HI

I am using an IFRAME on my webpage. The Iframe is displaying data from another site. Problem is , my submenu appears 'behind' the iframe . I cant for the life of me get it to appear over the iframe. Is there a way to do this ? I have tried putting the Iframe in a layer , and give the layer a z-index of 18 , but it makes no diff. Am I right in saying that the menu is using z-index of 19 ? This 'BUG' seems to appear in IE5 , but its fine in IE5.5 Upwards.

Thanks
Martin
User avatar
jonathan
Advanced
Advanced
Posts: 26
Joined: Wed Jul 02, 2003 1:13 pm
Location: UK

Similar issue

Post by jonathan »

The menu over an IFRAME is also fine in IE6.

In a related issue however, I have experienced an identical problem with a FRAME rather than an IFRAME. Has anyone seen this and solved it?
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

IFRAME WORKAROUND

Post by Hergio »

If you go to http://milonic.com/v5_rc1/iframes.htm you will see an example of how to make menus appear on top of iframes. Pull up the source code of the page and you will see something added to each menu definition called hidediv. This allows you to tell each menu individually what iframes to appear in front of.
i.e.
hidediv="iframe1"
will make this menu appear in front of the iframe whose id is iframe1.

I have yet to try and see if this new version has the ability to jump across frames. Probably not without some clunky workaround. In the previous version of the menu, it could be done but both pages had to have copies of the menu_array file and the menu declarations had to reference the menus located in the other frames. You can probably see examples of this in his demos section of the menu website.

Good luck, hope this helps!
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
User avatar
msaunders
Beginner
Beginner
Posts: 4
Joined: Wed Jul 02, 2003 8:20 am

Post by msaunders »

Hi there

Thanks for that, it works , BUT, in IE5, it removes the Iframe when the submenu drops down , it reappears when the submenu closes. Looks a bit weird. Dunno is there is a fix for that . If you have access to IE5.0, give it a go.

Rgds
Martin
MKrumm
Beginner
Beginner
Posts: 7
Joined: Tue Jul 08, 2003 12:50 pm

Post by MKrumm »

I have the same problems using the menu over an iframe in IE5.
do i need a specific version of the milonic-menu?

i would be very happy, if someone would have a workaround for this!!

thank you very much!!
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

Try release candidate 2. I dont have IE 5 so I cant test it, but there is also a iframes example in the rc2 directory.

http://milonic.com/v5_rc2/menu.htm

The iframes page is
http://milonic.com/v5_rc2/iframes.htm

Andy, is this a known bug and fixable? In IE 6, the iframes and menu work perfectly as expected.
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
MKrumm
Beginner
Beginner
Posts: 7
Joined: Tue Jul 08, 2003 12:50 pm

Post by MKrumm »

can i include the -hidediv="iframe1"- in the milonic-menu version 3.5.12?!
if i can, where in the js-file i have to place it?! and is "iframe1" the id or the name (or whatever) of the iframe i use?!

thanks-a-lot!!
matthias
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

I am currently still running 3.5.10 on my site (until I upgrade to v5) and I have no problems going over iframes (even with alpha transparency) using IE 6.
As far as I can tell there is no flag to set in v3 that tells it to go over iframes. It should try and render itself on top of all iframes.
And iframe1 is the ID of the object. Usually in this type of environment in the document object model of a browser, you want to refer to the ID of the object, not the name. Name is used, for example, in forms. When you submit something, you can refer to something submitted by its name. The id is local to the current page and allows you to reference things in it by name, err id.
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
MKrumm
Beginner
Beginner
Posts: 7
Joined: Tue Jul 08, 2003 12:50 pm

Post by MKrumm »

but in IE5/v3 the submenu appears under the iframe!
so, the only solution is to upgrade to v5, where i can set the hidediv-flag?!
User avatar
msaunders
Beginner
Beginner
Posts: 4
Joined: Wed Jul 02, 2003 8:20 am

Post by msaunders »

Hergio wrote:I am currently still running 3.5.10 on my site (until I upgrade to v5) and I have no problems going over iframes (even with alpha transparency) using IE 6.
As far as I can tell there is no flag to set in v3 that tells it to go over iframes. It should try and render itself on top of all iframes.
And iframe1 is the ID of the object. Usually in this type of environment in the document object model of a browser, you want to refer to the ID of the object, not the name. Name is used, for example, in forms. When you submit something, you can refer to something submitted by its name. The id is local to the current page and allows you to reference things in it by name, err id.
Hergio, the issue is not with IE6, it is with IE5

martin
icebits
Beginner
Beginner
Posts: 1
Joined: Thu Sep 26, 2002 7:30 am

Post by icebits »

IFrame is threated as windows component in IE 5.0, so it doesn't affect by z-index. To make layer appear ontop IFrame, is to hide the IFrame. ** Only IE 5.5 & above can control by z-index to bring it behind or ontop the layer. Am i right? :D
User avatar
msaunders
Beginner
Beginner
Posts: 4
Joined: Wed Jul 02, 2003 8:20 am

Post by msaunders »

icebits wrote:IFrame is threated as windows component in IE 5.0, so it doesn't affect by z-index. To make layer appear ontop IFrame, is to hide the IFrame. ** Only IE 5.5 & above can control by z-index to bring it behind or ontop the layer. Am i right? :D
Well , to rephrase your sentence, it looks like only IE5.5+ can handle layers and IFrame combinations? Then yes, I think you are right . :(

Martin
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 All,

Just to add my two cents... In various older browsers (e.g. IE5), an iframe is not really an html element. I believe it is actually an embeded instance of the browser. As such, it will not respond to layering (z-index, etc). In this regard, there is no difference in how iframes interact with the Milonic menu, no matter which menu version you are using. In other words, it's a browser-related problem, not a menu-related problem... all dhtml elements are affected similarly by iframes, whether they are part of a menu or part of some other script or system (e.g., a text scroller). In version 3 of the menu system, people had to deal with iframe problems the same way as discussed in this thread; by placing the iframe in a div and hiding it when the overlapping menu opened. The main difference is that, with v3 of the menu, if the built-in div hiding function (originally meant for problematic form elements) didn't work, you had to provide your own code extensions to do the job. Version 5 seems to have more flexible facilities for this sort of thing.

One trick you might try to improve the aesthetics when hiding the iframe is to place an image -- perhaps a screen capture of the iframe's default content -- in a layer directly behind the iframe. The image should be the same size and in the same location as the iframe (ideally, it'll look like the iframe with some content displayed). This way, when you hide the iframe, you don't end up with a big "hole" in the middle of your page where the iframe's content used to be. And since the user is obviously opening menus at the time, his or her attention will be on the menu, so the change will be less noticable.

One other thing worth noting about iframes is that you should avoid them if you want your site visitors to be able to view your site with NS4 (some developers care, others don't), because if I recall correctly, NS4 does not support iframes.

It's also worth noting that there are various other "things" that do not respond well to layering and therefore do not play well with dhtml. These include some form elements (e.g. multi-line selects, radio buttons), java applets, and flash clips. Whether these things will pose a problem also depends on the browser and version in use, where older browsers are obviously worse.

Hope that helps,

Kevin
MKrumm
Beginner
Beginner
Posts: 7
Joined: Tue Jul 08, 2003 12:50 pm

Post by MKrumm »

ok, thank you very much! :)
TinoG
Beginner
Beginner
Posts: 5
Joined: Sun Aug 03, 2003 1:24 am

Post by TinoG »

hello,

the postet link http://milonic.com/v5_rc1/iframes.htm dosent work anymore. can anyone poste the part with the hidedev=iframe1. i dont know where it be placed.

thanks

tino
User avatar
fredlongworthhighschool
Mega Advanced
Mega Advanced
Posts: 362
Joined: Fri Jun 27, 2003 11:34 am
Location: Manchester, England.
Contact:

Post by fredlongworthhighschool »

This is from V4. The earliest V5 I have is RC2.

Code: Select all

with(milonic=new menuname("support menu")){_c=1
	borderwidth = 1;
	style = mainStyle;
	hidediv="iframe1"
	aI("text=Milonic Disussion Forum;url=http://milonic.com/menu/forum");
	aI("text=Menu Support Mailing List;url=/mailman/listinfo/menu-dev;target=_blank");
	aI("text=Paid Support Page;url=http://milonic.com/menu/reqhelp.php");
	aI("text=Frequently Asked Questions;url=http://milonic.com/menu/faq.php");
	aI("text=Version Information;url=http://milonic.com/menu/versioninfo.php");
	aI("text=Licensing;showmenu=licensing");
	}
Andy Davis
Web Designer & Smartboard Manager

Fred Longworth High School, Manchester, England.
Post Reply