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

Please help with iFrames


Poster: ldeeder
Dated: Saturday March 11 2006 - 6:16:42 GMT

I want to do exactly what was done on the example on this site:

http://www.milonic.com/menusample11.php

But my programing ability is limited. I have tried and tried to get this to work but have had no luck. Can someone tell me what code goes on what page, and where? My goal is to have a menu item with several sub menu items that when clicked on will display various web sites in the one iFrame. I hope I am clear enough.

TIA

Larry


Poster: Migru
Dated: Saturday March 11 2006 - 10:36:39 GMT

Hi

if understanding of html and jscript is really limited as you say, this page is really not the best sample to study how iframes work together with the menu. This is because of many additional features running on that page too not facilitating understanding for a beginner.

Those features are the bolt - on modules like contextmenu.js, keypress.js
tooltips.js,mmpagehighlighter.js, openmenusbyurl.js which are really not necessary to display how the menu works, e.g. with a window or an iframe.

However , certain understanding is required, so try first to understand how to set up an iframe, (html). The iframe (or window) should have an id and a name.

The tags <iframe>...................</iframe> contains this setup of an iframe. In addition, in this sample the iframe is placed in a <td> ...</td> cell of a table and is named tempiframe.

Adressing it then is easy, because within the menus aI("..."; ) ; string you have to specify a url=path/file.htm;target=tempiframe;

That is the essential part of this page.

However -
There is another method introduced to address an iframe, using something like
"....;url=javascript:openIFrame('tempiframe','http://www.google.com'; " ) ;
And this is used on this page !! But it requires the function "openIFrame".

The menu has a submenu called "Links".

The items in this submenu make use of this function openIFrame to address the url, placing the relevant targets into the iframe.

But
url=path/file.htm;target=tempiframe;
should do it as well.

See
http://www.milonic.com/forum/viewtopic.php?t=6971&highlight=iframes

http://www.milonic.com/forum/viewtopic.php?t=7106&highlight=iframes



Michael


Poster: Migru
Dated: Saturday March 11 2006 - 10:41:06 GMT

Hi


if you are a little more specific / precise with you question, I will assist.

Michael


Poster: ldeeder
Dated: Saturday March 11 2006 - 15:57:58 GMT

Thank you Migru,

What I want to do is exactly what they are doing with iFrames on the example site. When you click on a menu item, the iFrame is populated with the site.

Thanks


Poster: Migru
Dated: Saturday March 11 2006 - 18:05:03 GMT

Hi

ok, but there is the submenu no 4 only which has 4 items, targeting into the iframe.

As I explained, the iframe there is setup using:

Code:
<iframe width=100% height=200 id=tempiframe src=""></iframe>


in the <td> cell of the table.

In the submenu relevant urls are (here the first one:)

Code:
url=javascript:openIFrame('tempiframe','http://www.apache.org/');


For this the function openIFrame is necessary.


Suggestion:
If you are using instead of this for the iframe something like

Code:
<iframe src="startfile.htm" id="_frame1" name="_frame1" height="200" width="600" frameborder="0" scrolling="no"></iframe>


the iframe will start with your startfile.htm and you can target this iframe, using in the menu the item url set as follows (sample, part of aI-string)

Code:
url=http://www.apache.org/;target=_frame1;




Michael


Poster: ldeeder
Dated: Saturday March 11 2006 - 21:04:54 GMT

Ok, I think I am close. There is my site:

http://new.regionalitsolutions.com

If you click on Clients-Current Client List-Mutual Securities. This is the site that I am trying to populate in the iFrame.

Here is a list of the files and the cone within them:

[startfile.html]
<iframe src="startfile.html" id="_frame1" name="_frame1" height="200" width="700" frameborder="1" scrolling="yes"></iframe>

[menu_data.js]
aI("text=Mutual Securities;url=javascript:openIFrame('_frame1','http://www.mutualsecurities.com/');status=Mutual Securities;");

I must be missing something or putting something in the wrong place. Thank you VERY much for your continued help.

Larry


Poster: ldeeder
Dated: Saturday March 11 2006 - 21:30:38 GMT

YEAH, I GOT IT. There is only on problem. First check this out to make sure I got it right:

http://new.regionalitsolutions.com/clie ... Sites.html

It works great if you start on that page. The problem now is that if you are on another page in the site, then go to click on Mutual Securities under the Current Clients link, the browser opens a new window instead of targeting the iFrame in the Cilents_Web_Sites.html.

TIA

Larry


Poster: Migru
Dated: Saturday March 11 2006 - 23:03:43 GMT

Hi

had a look to your menu_data and the "client_web_Sites.html".

When you start another page with the same menu, then of course, that page needs to have the same iframe with the same name or - if there is not such an iframe, the menu should be a different one, not enabling the output into an iframe. It will not target into another (previous) page, but into the iframe of the actual page only. And if there is no such iframe, it is opening a new one. Its not a problem of the code, its a problem of your design. How can you expect to target into an iframe of a page which is not the actual page? If you set up the iframe in a page and call another page with the same menu, there is no variable or memory containing the information, that the iframe was in one of the previous pages. The menu is looking for the iframe in the actual page only.

Michael


Poster: Migru
Dated: Saturday March 11 2006 - 23:11:50 GMT

Hi

there is just one minor issue, why do you have the scripts on top of the file and not there where Milonic recommends to have them, just after the <body> tag ?

Michael


Poster: ldeeder
Dated: Saturday March 11 2006 - 23:42:57 GMT

Fixed. But that didn't fix the issue.


Poster: ldeeder
Dated: Saturday March 11 2006 - 23:50:31 GMT

Is there a way to call the iFrame page at the same time you click on the link in the menu?


Poster: ldeeder
Dated: Saturday March 11 2006 - 23:56:16 GMT

Is there a way to keep a submenu hidden until you click on the parent. If so, I coukd set a link on the parent menu item that launches the iFrame page and opens the submenu, at which time the client list appears.


Poster: Migru
Dated: Sunday March 12 2006 - 0:27:37 GMT

Hi

at the moment, and at this point, I don´t have the right idea how to get this solved.
There is website on "iframes", you could have a look at it, may be you get an inspiration
http://www.huntingground.freeserve.co.uk/webplus/iframes/iframe_main.htm
There is something called "hidden iframe". So it could be hidden, unless the menu item is selected. Don´t know at the moment how to continue with this....

For your information too, there is another site on iframes here
http://www.javascripttoolbox.com/lib/dragiframe/

As these sites are not competitors to Milonic hope its not a problem, when I´m publishing these urls here.

Michael


Poster: Migru
Dated: Sunday March 12 2006 - 0:35:45 GMT

Hi

there is a way to dynamically edit the menu. I haven´t used this so far.
So the idea is, that on loading the page, the menu is modified "hiding " or removing items which target the iframe.

My question at this point is, why don´t you have your design / layout displaying any content in the iframe?

Michael


Poster: ldeeder
Dated: Sunday March 12 2006 - 1:00:50 GMT

I figured out a better way (I think). I just create one default.html with an iFrame. Then I control all the content through the .js. So far this is working great. And I don't have to use Dreamweaver Templates (they were giving me a headache). I can not thank you enough for helping me to get this to work properly.

HAve a good weekend.

Larry


Poster: Migru
Dated: Sunday March 12 2006 - 8:12:47 GMT

Hi

good idea, go on.

Quote:
Is there a way to call the iFrame page


This could be done by a function onclick event.

Michael


Poster: ldeeder
Dated: Sunday March 12 2006 - 15:11:14 GMT

Please tell me how to to the onclick function.


Poster: Migru
Dated: Sunday March 12 2006 - 16:03:57 GMT

Hi

on principle it works as follows.

Please see

http://www.huntingground.freeserve.co.uk/webplus/iframes/iframe_autoload.htm

There click "View Example".

This has to be integrated into the menu using onClick, see
http://www.milonic.com/menusample15.php

Michael