Limited Success with my pop up

N

News

I wrote a simple page with a table and imgaes in each cell of the table.
When an image is clicked the idea is to have a window pop up with a larger
view of the same image. It works great in Mozilla, I had to be a "do while
loop" in it to get it working in IE and NOTHING shows in Netscape or Opera.

Would someone please show me what I have done incorrectly?

here is the URL

http://www.wyght.com/warren/Warren/MySite/TamaraRing.html

code

function resizeImg(myNewImg,W,H)
{
while((myNewImg.width>W*.8)||(myNewImg.height>H*.8))
{//used to shrink size of image to be less then 80% of the window
myNewImg.width*=.9;
myNewImg.height*=.9;
}
}

function myImg(me)
{
var W;//image width
var H;//image height
do
{
var tY=(this.screen.width);//capture width and height
var tX=(this.screen.height);
var newImg=new Image;
newImg.src=me;//instanciate newImg
resizeImg(newImg,tY,tX);//call function to resize my new image
W=newImg.width;//instanciate vars
H=newImg.height;



window.sText="<HEAD><title>Tamara's Ring</title><BODY
bgcolor=\"#00CC66\">"
+"<H1 align=\"center\">Click Image to Close</H1>"
+"<script>function myClose(){this.close();}<\/script>"
+"<div align=\"center\"><img src="+me+"
width="+W+",height="+H+" onclick=myClose()></div></BODY></HEAD>";

window.open("javascript:eek:pener.sText","SecWin","width="+tY+",height="+tX).focus();
}while((W<1)||(H<1));
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,119
Latest member
IrmaNorcro
Top