LESM
Posts: 1
Nickname: lesm
Registered: Jun, 2002
popup inconsistency
Posted: Jun 10, 2002 6:22 AM
Advertisement
I'm not expert, just a learning by doing novice. I use this script to popup an image. It works as expected except that every now and then, the picture fails to show up showing a big blank window. I see no pattern as to why and when this script fails and also I see no other way to do the job. The idea is to popup perfectly framed images using several links. Any help will be appreciated. <script type="text/javascript" language=javascript> var win=null; function showimage(url_image,picname){ var img = new Image(); var scrwidth = screen.availWidth; var scrheight = screen.availHeight; img.src = url_image; win=window.open('','','width='+img.width+',height='+img.height+',scrollbars=no, dependent=yes,resizable=1,left=' + ((scrwidth) * .55) + ',top=' + ((scrheight) * .15) + ',toolbar=0'); win.document.write ('<html>\n'); win.document.write (' <head>\n'); win.document.write (' <title>'+picname+'</title>\n'); win.document.write (' </head>\n'); win.document.write (' <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">\n'); win.document.write (' <img src="' + url_image + '" height='+img.height+' width='+img.width+'>\n'); win.document.write (' </body>\n'); win.document.write ('</html>\n'); } </script> <a href="javascript:showimage('http://myanothersite.com/images/picture.jpg','pass' );"><img src="/graphics/pic.gif" alt="Show image" width="21" height="21" border="0"></a>