wadep
03-01-2007, 01:18 AM
Hey guys...Newbie question here.
I can't figure this one out. Could you give a quick pointer on javascript?
I've coded in several links on the same page that will open a remote window. The problem is, if you don't close the previous pop-up window, the next clicked-on link will load in the same remote window. The image inside usually isn't the same size, so it doesn't look right.
For an example see: http://www.highvalleyranchutah.com/alamar2.html
First click on a home illustration at the top, then without closing that pop-up, click on a floor plan below. The floor plan outline drawing will load in the previous window instead of a new one. The floor plan is vertical and the home rendering is horizontal. They can't both load in the same window. If clicked independently, they work fine.
I know it's something simple regarding the naming of the window opener or something. I just don't know what to do. Please help?
Below is the Javascript code used for the popup:
function makeRemote(url,winx,winy){
remote = window.open("","remotewin","SCROLLBARS=0,WIDTH="+winx+",HEIGHT="+winy+",RESIZABLE=0");
remote.location.href=url;
if(remote.opener==null) remote.opener = window;
remote.opener.name="opener";
}
Below is an example of how it's called for in the html:
<div style="padding: 0px; float: left; clear: left; text-align:center;white-space:nowrap;margin-right:20px;">
<a href="javascript:makeRemote('alamar2_front.html',800,475);">
<img src="images/alamar2_fnt_sm.jpg" width="255px" height="155"><br><i>Front Elevation.</i></a>
</div>
How can I tweak this so it opens a NEW window every time a makeRemote function is called for?
Thanks for helping this JavaScript newbie.
I can't figure this one out. Could you give a quick pointer on javascript?
I've coded in several links on the same page that will open a remote window. The problem is, if you don't close the previous pop-up window, the next clicked-on link will load in the same remote window. The image inside usually isn't the same size, so it doesn't look right.
For an example see: http://www.highvalleyranchutah.com/alamar2.html
First click on a home illustration at the top, then without closing that pop-up, click on a floor plan below. The floor plan outline drawing will load in the previous window instead of a new one. The floor plan is vertical and the home rendering is horizontal. They can't both load in the same window. If clicked independently, they work fine.
I know it's something simple regarding the naming of the window opener or something. I just don't know what to do. Please help?
Below is the Javascript code used for the popup:
function makeRemote(url,winx,winy){
remote = window.open("","remotewin","SCROLLBARS=0,WIDTH="+winx+",HEIGHT="+winy+",RESIZABLE=0");
remote.location.href=url;
if(remote.opener==null) remote.opener = window;
remote.opener.name="opener";
}
Below is an example of how it's called for in the html:
<div style="padding: 0px; float: left; clear: left; text-align:center;white-space:nowrap;margin-right:20px;">
<a href="javascript:makeRemote('alamar2_front.html',800,475);">
<img src="images/alamar2_fnt_sm.jpg" width="255px" height="155"><br><i>Front Elevation.</i></a>
</div>
How can I tweak this so it opens a NEW window every time a makeRemote function is called for?
Thanks for helping this JavaScript newbie.