Get out of frames

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
Hans1bad
Beginner
Beginner
Posts: 3
Joined: Wed Sep 06, 2006 3:44 pm

Get out of frames

Post by Hans1bad »

I have one "page" with frames on the web site.
I have the frame based menu semi working, however, each link opens in the body of the frame, thus the web site becomes nested.

I have two questions:
1. How do I prevent above.
2. If I click on a sub menu link, I want to completely leave the frame based page and go to the selected link.

Thanks
hans
Go that way fast.
If something gets in your way...
turn.
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Have you looked at this info?
John
Hans1bad
Beginner
Beginner
Posts: 3
Joined: Wed Sep 06, 2006 3:44 pm

Working, sorta

Post by Hans1bad »

Thanks, the link helped me along 80% of the way. 8)
The part I was missing was to add:
target=_new; to the menu line. This opens up a new browser.
Is there a way to close the browser that launched the new instance of the browser?
Go that way fast.
If something gets in your way...
turn.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

I believe you'll need some kind of function for that. I don't do functions, but as an example, if you put this at the top of your menu_data.js file just above the style

Code: Select all

var newwindow; 
function poptastic(url) 
{ 
   newwindow=window.open(url,'name','height=500,width=400,left=100, 
  top=100,resizable=yes,scrollbars=yes,toolbar=yes,status=yes'); 
  newwindow.focus(); 
} 
Then in any aI string url where you called that function, the page would open in a new window with the specified attributes and, the second part of the function is the newwindow.focus so that window would have focus. Of course you dont' really need the attributes unless you want to specify the size and such. I think if you remove all that you just get a regular window.

You'd call it in the aI string in the following manner, note that you no longer have target since you're using a js function to open the new window.

Code: Select all

aI("text=item;url=javascript:poptastic('http://whatever.html/');");
Now, I don't do functions, but I know there is one for closing the window in which you have done the click, self.close, so I wonder if you put that into the function if it would close the window. I don't know how to add functions to a function, so I can only suggest you try substituting self.close for the newwindow.focus and see if that works.

Sorry, I don't know more, that's all I can think to try unless you can find someone who knows how to write the function you need.

Ruth
Post Reply