position="relative" and iFrame problem

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
Swetsenegger
Super Advanced
Super Advanced
Posts: 32
Joined: Sun Jun 13, 2004 11:05 pm
Location: Rotterdam, The Netherlands
Contact:

position="relative" and iFrame problem

Post by Swetsenegger »

I've got a small issue with the DHTML menu and relative positioning.

I've read http://www.milonic.co.uk/menusample9.php and done everything accoordingly. And it's working, however the first url in the mainmenu is not working correctly:

<TD colspan="2" rowspan="2" width="125" height="534">


<script language="Javascript" type="text/javascript">
with(milonic=new menuname("Main Menu")){
style=menuStyle;
alwaysvisible=1;
orientation="vertical";
position="relative";
aI("text=Introductie;url=introductie.htm;target=iframe;status=Welcome;");

aI("text=IJsland;showmenu=ijsland;;status=Verslag van de rondreis op IJsland;");
aI("text=Persoonlijk;showmenu=Persoonlijk;;status=Over huwelijken en kinderen;");
aI("text=Links;showmenu=URL;;status=Andere must see sites;");
aI("text=Contact;showmenu=contact;;status=Mail of ICQ ons;");

}
drawMenus();
</script>
</TD>


In the statusbar I don't see 'Welcome' as defined in the status, and when clicking the 'introduction' url it does not open in the iframe, but just in the complete window.
It's only this URL in the main menu. All url's in the submenu's DO open fine in the target iframe.

Any idea's?

-edit- ow, closeonclick is also not working :?:
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Could you post a url for the page so we can check it out?

Ruth
Swetsenegger
Super Advanced
Super Advanced
Posts: 32
Joined: Sun Jun 13, 2004 11:05 pm
Location: Rotterdam, The Netherlands
Contact:

Post by Swetsenegger »

Ruth wrote:Could you post a url for the page so we can check it out?

Ruth
I would, but currently it's not online. The current website is running version 3.

I could upload this one, but frankly is all information in the first post. When I remove postion="relative", then ofcourse the menu is not correctly positioned but the first url is doing what it should.
Swetsenegger
Super Advanced
Super Advanced
Posts: 32
Joined: Sun Jun 13, 2004 11:05 pm
Location: Rotterdam, The Netherlands
Contact:

Post by Swetsenegger »

I uploaded the new page:

http://www.123swets.com
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Thanks. I'm sure someone will be able to help you. This is not something I do, I've never done anything with iFrames. But, one thing, did you read up on iframes? I know there's some kind of code that needs to be in the page for the menu to work with them, some function. Here's a link to the SAMPLE#11 which has the information, down about the middle of the page I think.

Ruth
Swetsenegger
Super Advanced
Super Advanced
Posts: 32
Joined: Sun Jun 13, 2004 11:05 pm
Location: Rotterdam, The Netherlands
Contact:

Post by Swetsenegger »

Ruth wrote:Thanks. I'm sure someone will be able to help you. This is not something I do, I've never done anything with iFrames. But, one thing, did you read up on iframes? I know there's some kind of code that needs to be in the page for the menu to work with them, some function. Here's a link to the SAMPLE#11 which has the information, down about the middle of the page I think.

Ruth
Thanks, added the function. However in menusample11 you'll see the status text in the status bar.
When I add it in the same way, I see 'Javascript:OpenIframe('

It seems the 'position is relative' is messing up the mainmenu function.

As a workaround I now made the url in the mainmenu also a 'showmenu' and in the showmenu I put the actual URL to the iframe.
But this is not very clean, so if anybody has a sollution
Swetsenegger
Super Advanced
Super Advanced
Posts: 32
Joined: Sun Jun 13, 2004 11:05 pm
Location: Rotterdam, The Netherlands
Contact:

Post by Swetsenegger »

Did I find a real bug?

:)
mfurf
Super Advanced
Super Advanced
Posts: 74
Joined: Tue Sep 23, 2003 12:30 am
Location: Purling NY
Contact:

Post by mfurf »

Swet:
Try posting your iframe code here. For example

Code: Select all

target=iframe
won't work unless you have

Code: Select all

 name="iframe"
in your iframe specs.

Methinks it's unusual to name an iframe by its own handle "iframe" but it should work. If it's your main iframe try name="main" or some such and reword your target statement accordingly.

Not sure about the status problem.
Oh Saratoga!
Swetsenegger
Super Advanced
Super Advanced
Posts: 32
Joined: Sun Jun 13, 2004 11:05 pm
Location: Rotterdam, The Netherlands
Contact:

Post by Swetsenegger »

mfurf wrote:Swet:
Try posting your iframe code here. For example

Code: Select all

target=iframe
won't work unless you have

Code: Select all

 name="iframe"
in your iframe specs.

Methinks it's unusual to name an iframe by its own handle "iframe" but it should work. If it's your main iframe try name="main" or some such and reword your target statement accordingly.

Not sure about the status problem.
Of course my iframe is ok. All other urls are working fine. It's ONLY when using a direct url in the main menu. If I first link to a submenu everything is fine. If I remove 'position= relative' it's ALSO working fine (besides the position of the menu :) )

Just look at http://www.123swets.com and view the source of the index.
Swetsenegger
Super Advanced
Super Advanced
Posts: 32
Joined: Sun Jun 13, 2004 11:05 pm
Location: Rotterdam, The Netherlands
Contact:

Post by Swetsenegger »

The problem is (almost) solved. I redesigned the site to an overflow div instead of an iframe.

This because of XHTML1.1 compatibility
Swetsenegger
Super Advanced
Super Advanced
Posts: 32
Joined: Sun Jun 13, 2004 11:05 pm
Location: Rotterdam, The Netherlands
Contact:

Post by Swetsenegger »

Unfortunately this bug still exists.

When doing a relative positioning, placing the data of the main menu inside the HTML it's not possible to put a direct URL in the main menu.
More precise, it will open in a new window (and not in a target when using frames) en the status text does not show.
The sollution is obvious, do not place any direct links in the main menu, but always direct to a submenu. Put the direct link in the submenu.

This workaround leaves one small bug. The status texts of the mainmenu are still not shown in the statusbar of IE (did not test any other browser)
Post Reply