clownkevin
Technical User
I wonder if anyone can help?
I am trying to open a popup window and pass an image to it dynamically, setting it as the background to the page (to avoid the border)
I need to reuse the window for each subsequent picture, and pass the focus back to the popup so it will be visible when a new image is selected.
This is my code so far...
In the <head> section...
<SCRIPT LANGUAGE="Javascript">
<!--Hide
browserName=navigator.appName;
browserVer=parseInt(navigator.appVersion);
ns3up=(browserName=="Netscape"&&browserVer >=3);
ie4up=(browserName.indexOf("Microsoft"
>=0&&browserVer>=4);
var imgOn
function doPic(imgName){if (ns3up||ie4up){imgOn=(""+imgName);
myWindow=window.open("large.htm?imgOn", "myWindow", "width=640,height=480,status=no,scrollbars=no,resizable=no,toolbar=no,menubar=no,left=0,top=0"
;
myWindow.focus();
}}
//-->
</script>
In the body...
<td><a href="javascript:doPic('images/slideshow/pic1a.jpg');"><img src="images/slideshow/p1a.jpg" border=0 alt="Approaching the Arch"></a></td>
<td><a href="javascript:doPic('images/slideshow/pic1.jpg');"><img src="images/slideshow/p1.jpg" border=0 alt="Nearer the Arch"></a></td>
etc.
code for the pop up window...
<HTML>
<HEAD>
<TITLE> </TITLE>
</HEAD>
<SCRIPT>
var backg = document.location.search;
backg = backg.substring(1, backg.length);
document.write("<BODY BACKGROUND=" + backg + ">"
;
</SCRIPT>
</BODY>
</HTML>
Where am I going wrong??? The window pops up but no image, help me please, head bursting...
Clown Kevin
I am trying to open a popup window and pass an image to it dynamically, setting it as the background to the page (to avoid the border)
I need to reuse the window for each subsequent picture, and pass the focus back to the popup so it will be visible when a new image is selected.
This is my code so far...
In the <head> section...
<SCRIPT LANGUAGE="Javascript">
<!--Hide
browserName=navigator.appName;
browserVer=parseInt(navigator.appVersion);
ns3up=(browserName=="Netscape"&&browserVer >=3);
ie4up=(browserName.indexOf("Microsoft"
var imgOn
function doPic(imgName){if (ns3up||ie4up){imgOn=(""+imgName);
myWindow=window.open("large.htm?imgOn", "myWindow", "width=640,height=480,status=no,scrollbars=no,resizable=no,toolbar=no,menubar=no,left=0,top=0"
myWindow.focus();
}}
//-->
</script>
In the body...
<td><a href="javascript:doPic('images/slideshow/pic1a.jpg');"><img src="images/slideshow/p1a.jpg" border=0 alt="Approaching the Arch"></a></td>
<td><a href="javascript:doPic('images/slideshow/pic1.jpg');"><img src="images/slideshow/p1.jpg" border=0 alt="Nearer the Arch"></a></td>
etc.
code for the pop up window...
<HTML>
<HEAD>
<TITLE> </TITLE>
</HEAD>
<SCRIPT>
var backg = document.location.search;
backg = backg.substring(1, backg.length);
document.write("<BODY BACKGROUND=" + backg + ">"
</SCRIPT>
</BODY>
</HTML>
Where am I going wrong??? The window pops up but no image, help me please, head bursting...
Clown Kevin