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: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:15

Targeting into Iframe


Poster: Robert
Dated: Monday February 6 2006 - 14:25:26 GMT

Well, I've searched everything I could find on your site about Iframes. The menu works fine, untill I try to set it up to target a page into an iframe, which doesn't work at all. At this point I've looked until my eyes are crossing, so I was hoping one of you folks could see what I'm missing.

Here is what I've used....

Just before body tag:
Code:
</script></head>
<script>function openIFrame(mainframe, URL){
ifId=gmobj(mainframe)
ifId.location.href=URL // Opera Bug Fix. ifId.src=URL
} </script>


Placed in the page:
Code:
<iframe id="mainframe" src="home.html" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:visible; width:580px; display:none"></iframe
>


Link in js file:
Code:
aI("text= About This Ministry;url=javascript:openIFrame('mainframe','aboutministry.html');");


Without the openiframe part of the link it works fine, but with it you get "error on page" down in the status bar and nothing happens.
If anyone has any ideas I would really appreciate it. Idon't have these pages uploaded yet, but if you need to see the whole thing in action I can upload the main and one of the linked pages.


Poster: Migru
Dated: Monday February 6 2006 - 14:52:14 GMT

Hi

try as follows:

Code:
<iframe src="home.html" id="_main" name="_main" height="400" width="580" frameborder="0" scrolling="auto"></iframe>


and in your js file

Code:
aI("text= About This Ministry;url=aboutministry.html;target=_main;");


Quote:
but if you need to see the whole thing in action I can upload the main and one of the linked pages.


This of course is always better (having a url)

Michael


Poster: Ruth
Dated: Monday February 6 2006 - 19:55:04 GMT

Hi,

I've also noted that on the Opening Windows and Frames samples, the code for opening the iframe is after the body tag, and is as follows:

Code:
<script>
function openIFrame(iFrameId,winURL)
{
   ifId=gmobj(iFrameId)
   ifId.src=winURL
}
</script>


And, you do need to have both an id= and name= as Michael noted, some browsers need id, others need name= . I'm not sure which is which.

Ruth

IFRAMES


Poster: Migru
Dated: Monday February 6 2006 - 20:20:48 GMT

Some links on this subject

a) page with adressing of iframes

http://www.milonic.com/forum/viewtopic.php?p=34525&highlight=#34525

b) Adressing iframes
reply by kevin on similar question ("id" and/or "name")
[url]
http://www.milonic.com/forum/viewtopic. ... ght=#34126[/url] or
http://www.milonic.com/forum/viewtopic.php?p=34057&highlight=#34057

HTML standard is to use both "id" and "name".

Michael


Poster: Robert
Dated: Tuesday February 7 2006 - 1:55:17 GMT

Ok, thanks for the info. I'll go tinker on it some more.