Please help with iFrames

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
ldeeder
Super Advanced
Super Advanced
Posts: 30
Joined: Fri Mar 10, 2006 2:06 am

Please help with iFrames

Post by ldeeder »

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

http://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
Migru
Milonic Guru
Milonic Guru
Posts: 669
Joined: Tue Nov 01, 2005 8:22 pm
Location: Hamburg - Germany
Contact:

Post by Migru »

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://milonic.com/forum/viewtopic. ... ht=iframes

http://milonic.com/forum/viewtopic. ... ht=iframes



Michael
Migru
Milonic Guru
Milonic Guru
Posts: 669
Joined: Tue Nov 01, 2005 8:22 pm
Location: Hamburg - Germany
Contact:

Post by Migru »

Hi


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

Michael
ldeeder
Super Advanced
Super Advanced
Posts: 30
Joined: Fri Mar 10, 2006 2:06 am

Post by ldeeder »

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
Migru
Milonic Guru
Milonic Guru
Posts: 669
Joined: Tue Nov 01, 2005 8:22 pm
Location: Hamburg - Germany
Contact:

Post by Migru »

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

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

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

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

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


Michael
ldeeder
Super Advanced
Super Advanced
Posts: 30
Joined: Fri Mar 10, 2006 2:06 am

Post by ldeeder »

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
ldeeder
Super Advanced
Super Advanced
Posts: 30
Joined: Fri Mar 10, 2006 2:06 am

Post by ldeeder »

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
Migru
Milonic Guru
Milonic Guru
Posts: 669
Joined: Tue Nov 01, 2005 8:22 pm
Location: Hamburg - Germany
Contact:

Post by Migru »

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
Migru
Milonic Guru
Milonic Guru
Posts: 669
Joined: Tue Nov 01, 2005 8:22 pm
Location: Hamburg - Germany
Contact:

Post by Migru »

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
ldeeder
Super Advanced
Super Advanced
Posts: 30
Joined: Fri Mar 10, 2006 2:06 am

Post by ldeeder »

Fixed. But that didn't fix the issue.
ldeeder
Super Advanced
Super Advanced
Posts: 30
Joined: Fri Mar 10, 2006 2:06 am

Post by ldeeder »

Is there a way to call the iFrame page at the same time you click on the link in the menu?
ldeeder
Super Advanced
Super Advanced
Posts: 30
Joined: Fri Mar 10, 2006 2:06 am

Post by ldeeder »

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.
Migru
Milonic Guru
Milonic Guru
Posts: 669
Joined: Tue Nov 01, 2005 8:22 pm
Location: Hamburg - Germany
Contact:

Post by Migru »

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.u ... e_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
Migru
Milonic Guru
Milonic Guru
Posts: 669
Joined: Tue Nov 01, 2005 8:22 pm
Location: Hamburg - Germany
Contact:

Post by Migru »

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
ldeeder
Super Advanced
Super Advanced
Posts: 30
Joined: Fri Mar 10, 2006 2:06 am

Post by ldeeder »

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
Migru
Milonic Guru
Milonic Guru
Posts: 669
Joined: Tue Nov 01, 2005 8:22 pm
Location: Hamburg - Germany
Contact:

Post by Migru »

Hi

good idea, go on.
Is there a way to call the iFrame page
This could be done by a function onclick event.

Michael
ldeeder
Super Advanced
Super Advanced
Posts: 30
Joined: Fri Mar 10, 2006 2:06 am

Post by ldeeder »

Please tell me how to to the onclick function.
Migru
Milonic Guru
Milonic Guru
Posts: 669
Joined: Tue Nov 01, 2005 8:22 pm
Location: Hamburg - Germany
Contact:

Post by Migru »

Hi

on principle it works as follows.

Please see

http://www.huntingground.freeserve.co.u ... toload.htm

There click "View Example".

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

Michael
Post Reply