Problems to open pages in a certain frame

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
Doc-Holiday
Advanced
Advanced
Posts: 16
Joined: Wed Mar 02, 2005 1:25 pm

Problems to open pages in a certain frame

Post by Doc-Holiday »

Hi there,
I played around with the menue and managed to set it up the way I wanted but I have problems to make the pages open in the main frame window. Please have a look at http://www.treblebooster.net/test/index.html
There you can see the menue in the head frame. I want to open all the pages from there in the main frame (called "Haupt") but I can´t make it work. I played around with the "target" attribute but all it is doing is open the pages in a new window or as shown in the example, "overwriting" the head frame. The menue syntax can be seen at http://www.treblebooster.net/test/data.txt

Any ideas to make it work right ?

Thanks in advance and greetings from Germany

Doc
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi Doc,

Took me a bit to figure this out. You're actually using an iframe in the 'kopf' frame of the frameset. I see you have the iframe function on the page, but to open pages in an iframe you need to code for that, not a target= code. So, this aI string

Code: Select all

aI("text=RM Treble-Booster;url=rm.html;target=Haupt;");

should be coded like this

Code: Select all

aI("text=RM Treble-Booster;url=javascript:openIFrame('tempiframe','rm.html';");

Hope that helps.

Ruth
Doc-Holiday
Advanced
Advanced
Posts: 16
Joined: Wed Mar 02, 2005 1:25 pm

Post by Doc-Holiday »

Hi Ruth,

good to see that you are still out here. Thanks for your suggestion, I inserted your code but now the menue opens nothing, maybe there is a typo inside the code ? I uploaded the new code, please click on "Medium Gain Booster" and try to open the "RM Treble Booster" page.

Hope to hear you soon and thanks in advance

Doc

Ruth wrote:Hi Doc,

Took me a bit to figure this out. You're actually using an iframe in the 'kopf' frame of the frameset. I see you have the iframe function on the page, but to open pages in an iframe you need to code for that, not a target= code. So, this aI string

Code: Select all

aI("text=RM Treble-Booster;url=rm.html;target=Haupt;");

should be coded like this

Code: Select all

aI("text=RM Treble-Booster;url=javascript:openIFrame('tempiframe','rm.html';");

Hope that helps.

Ruth
Doc-Holiday
Advanced
Advanced
Posts: 16
Joined: Wed Mar 02, 2005 1:25 pm

Post by Doc-Holiday »

Hi Ruth,

I figured it out myself and it works:

I added a "name=xxx" attribute to the IFRAME tag and then you can use that name to target it from the menues "target" parameter, eg:

aI("text=RM Treble-Booster;url=rm.html;target=Haupt;");

Anyway, thanks for your suggestion and take care !
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi Doc,

I just tried your page and I cannot get any page to load in IE or Firefox.

You're code for the iframe call in the menu_data.js file is incorrect. You're missing a closing bracket for the iframe part of the call.

Code: Select all

aI("text=RM Treble-Booster;url=javascript:openIFrame('tempiframe','fass.html';");
You need a ) after the fass.html' and before the ; so the code should be

Code: Select all

aI("text=RM Treble-Booster;url=javascript:openIFrame('tempiframe','fass.html');");
And, on your main kofp.html page you should add a name to the iframe. Can't remember what browser that's for, maybe IE, and it may have been for something else that you needed both id= and name= but it doesn't hurt anything.

Code: Select all

<IFRAME id=tempiframe name=tempiframe marginWidth=0 
marginHeight=10 src="home.html" width="100%" 
height="100%"></IFRAME>
The page then loads fine in the iframe in IE, Firefox and Netscape.

Ruth
Doc-Holiday
Advanced
Advanced
Posts: 16
Joined: Wed Mar 02, 2005 1:25 pm

Post by Doc-Holiday »

Hi Ruth,

I thought it was a typo or so .... it´s not easy to manage all those little ) , ; etc. :D

But as mentioned in my previous message, I choose a much simpler solution by adding a "name=xxx" attribute to the IFRAME tag and call it with the "target" parameter inside both menues. I have uploaded all things now so that you can see what I mean.

Have a nice weekend

Doc
Post Reply