trbates
07-19-2003, 10:44 AM
I am trying to use a single popup window function for multiple images on a site I am working on. Currently, I am trying to pass a variable for both width and height when calling the function. The function is recieving the correct value, however when using the variable it does not work. My code is as follows...
***The Popup Window Function...
<script language="JavaScript">
<!-- Hide the script from old browsers --
function OpenPage(page,picwidth,picheight) {
var NewWindow=open('','popup','menubar=0,toolbar=0,location=0,directories=0,scrollbars=0,resizable=0,sta tus=0,width=picwidth,height=picheight, screenX=1, sreenY=1, top=1, left=1');
NewWindow.focus();
window.open(page,target="popup");
}
// -->
</SCRIPT>
***The method I am using to call the Function
<a href="javascript:OpenPage('/finishedtrucks/red1.html','500','323')"><img src="/images/red1s.jpg" border="1" height="120" width="200"></a>
The problem appears to be that the window.open does not "see" what picwidth/picheight are supposed to be ... even though they are correct in the function. (tested with a quick alert box and the number was correct)
Any help would be greatly appreciated :)
Thanks in Advance
Travis
***The Popup Window Function...
<script language="JavaScript">
<!-- Hide the script from old browsers --
function OpenPage(page,picwidth,picheight) {
var NewWindow=open('','popup','menubar=0,toolbar=0,location=0,directories=0,scrollbars=0,resizable=0,sta tus=0,width=picwidth,height=picheight, screenX=1, sreenY=1, top=1, left=1');
NewWindow.focus();
window.open(page,target="popup");
}
// -->
</SCRIPT>
***The method I am using to call the Function
<a href="javascript:OpenPage('/finishedtrucks/red1.html','500','323')"><img src="/images/red1s.jpg" border="1" height="120" width="200"></a>
The problem appears to be that the window.open does not "see" what picwidth/picheight are supposed to be ... even though they are correct in the function. (tested with a quick alert box and the number was correct)
Any help would be greatly appreciated :)
Thanks in Advance
Travis