Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting window properties in the opening window

Status
Not open for further replies.

neiljabba

IS-IT--Management
May 22, 2003
86
GB
Is it possible to set the opening/pop up window's properties in the window thats opening instead of setting as part of the a href that opens it?

I have the opening window reference as part of some hotspot coding and setting the properties in here doesnt seem to work.

<area shape="poly" coords="12,24,84,11,88,19,25,36,12,24" href="gym.htm" target="new" title="Gymnasium" alt="Gymnasium" onMouseOut="MM_swapImage('tourmain_r2_c2','','Thumbs/tourmain_r2_c2.jpg',1);" onMouseOver="MM_swapImage('tourmain_r2_c2','','Thumbs/tourmain_r2_c2_f3.jpg',1);" >

I tried setting them after the target option and even calling a java code that worked for a simple text link but not in this hotspot.



Many thanks in advance
 
What properties do you want to set - you can set location / size in the window, but not toolbars etc.
 
It's not possible to change all the window properties from within the page (or as you load the page). The best way is to set these things before loading the page. You mentioned you have tried this already... but here is how I'd approach it.

In your <area> locate href="gym.htm". This is the URL that will be visited when you click the area defined. Changing the href to this alone will do the trick:

Code:
href="javascript:myWinHandle=window.open('gym.htm','myNewWindow','width=400,height=300')"

Hope that helps,
Jeff
 
Thanks Jeff,

It does as you said but oddly leaves the window behind refreshed with [OBJECT] in the window.

It seems to have advanced the page onwards so using back returns me to the original page. Can I stop this from happening?

Cheers

Neil
 
OK... how about a suggested change to that href. Add the popup code to an onclick event on the href. First craft the href itself to not do anything:

Code:
href="javascript://;"

Then add in the onclick event:

Code:
onclick="myWinHandle=window.open('gym.htm','myNewWindow','width=400,height=300'); return false;"

The whole thing (drawing from your posted example) would look like this:

Code:
<area shape="poly" coords="12,24,84,11,88,19,25,36,12,24" href="javascript://;" onclick="myWinHandle=window.open('gym.htm','myNewWindow','width=400,height=300'); return false;" target="new" title="Gymnasium" alt="Gymnasium" onMouseOut="MM_swapImage('tourmain_r2_c2','','Thumbs/tourmain_r2_c2.jpg',1);"  onMouseOver="MM_swapImage('tourmain_r2_c2','','Thumbs/tourmain_r2_c2_f3.jpg',1);">

Let us know how you go...
Jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top