nemex
12-12-2002, 03:34 AM
The script below displays a defined number of images (display picture function) and when clicked on, the full picture opens in a popup (view full picture function). My images are 1.jpg, 2.jpg, ... 4.jpg. Problem is that the full picture does not display in the popup. I think that the cause of this is because the value of "x" is not defined for the openNaked() function...??
Is there a way to fix this, perhaps by passing a value...?
Thanks!!
<script language="javascript">
//display picture function
var numofimages = 5
for (x=1; x<numofimages; x++){
document.write("<a href=# onclick=openNaked()><img src=images/"+x+".jpg height=100 width=50 border=0></a>")}
//view full picture function
var Naked=null
function openNaked() {
Naked=window.open("", "Naked", "fullscreen,scrollbars")
Naked.document.write("<html><head></head><body><img src=images/"+x+".jpg border=0></body></html>")
Naked.window.resizeTo(400,100)
}
</SCRIPT>
Is there a way to fix this, perhaps by passing a value...?
Thanks!!
<script language="javascript">
//display picture function
var numofimages = 5
for (x=1; x<numofimages; x++){
document.write("<a href=# onclick=openNaked()><img src=images/"+x+".jpg height=100 width=50 border=0></a>")}
//view full picture function
var Naked=null
function openNaked() {
Naked=window.open("", "Naked", "fullscreen,scrollbars")
Naked.document.write("<html><head></head><body><img src=images/"+x+".jpg border=0></body></html>")
Naked.window.resizeTo(400,100)
}
</SCRIPT>