Click to See Complete Forum and Search --> : Open link in new window help


boroarke
05-15-2003, 05:34 PM
I need some help with opening a link in an already open window. Here is what I have so far. On my main page (index.htm), I have a link and when you click on the link a new smaller window pops up on top of my main page (index.htm). The new window has further options the user can click on. The html I used to open this little window is as follows:

<a href="D:\doityourself\kits.htm/" onclick="window.open (this.href, 'child', 'height=500,width=495'); return false""style="color:#223767; font-weight:700">
Do-It-Yourself Kits</a>

When the user clicks on a link from the popup window, I would like that link to open up in the same window my main page (index.htm) was in. I don't want the link to open a new window, It needs to open in the already opened window index.htm was in. No matter what I do, I can not get the link to open up in this window. It either opens up in its own window or opens up in the small popup window. I do not want this to happen because I want the popup window to stay on the screen. Does that make sense? Can anyone tell me what I am doing wrong or what html or script I need to enter for the link to make it open up in the window that is already open on the screen? Sorry if this is long winded.
Thanks in advance for all help.
Bryan

boroarke
05-15-2003, 05:59 PM
I actually figured out what I needed to do on my own. But now I just thought of something else I would like happen. When the user clicks on a link in the popup window, I dont want to popup window to close, I would like the pop up window to minimize down into the taskbar so It will not be blocking the main window and the user can just click on it in the taskbar to maximize it when they need to view it again. How can I make this possible? Thanks!!

Jona
05-15-2003, 06:09 PM
You wouldn't minimize it (although you could), you would use self.blur(); to make it go behind the main window.

boroarke
05-15-2003, 06:11 PM
how would I do that? I am pretty new at JS but I am trying to learn fast.
Thanks!

Jona
05-15-2003, 06:12 PM
<a href="somewhere.html" onClick="self.blur();">Text</a>

boroarke
05-15-2003, 06:30 PM
Thanks for your help Jona. Would there be a way that I can just have a hyperlink on my popup window that just says minimize and when they click on it, it will minimize it to the taskbar? I think this would be the best way to go for this situation.

Thanks!

Jona
05-15-2003, 07:13 PM
Well.... Yes, you can do it... But it will not work if the person has 2 screens...

<a href="javascript:minimize();">Minimize</a>

The script:

function minimize(){
window.moveTo(screen.width*10, screen.height*10);
}

window.onfocus=window.moveTo(0, 0);