I'm working on a site for a friend. I've found some image popup code
that does what I want (borderless, close on exit) but for some reason
I occasionally get the "popup blocked" information bar in IE6.
Any suggestions?
Here is an example page, js code below:
http://www.aquariusyachting.co.uk/exterior.htm
var popwin='';
function viewPic(img)
{
picfile = new Image();
picfile.src =(img);
fileCheck(img);
}
function fileCheck(img)
{
if( (picfile.width! =0) && (picfile.height !=0) )
{
checkExisting(i mg);
}
else
{
funzione="fileC heck('"+img+"') ";
intervallo=setT imeout(funzione ,50);
}
}
function checkExisting(i mg)
{
if (popwin.locatio n && !popwin.closed)
{
popwin.close();
makeWindow(img)
//popwin.location .href = img; needs a tidy here, but it works NM
// popwin.focus();
}
else {makeWindow(img )}
}
function makeWindow(img)
{
ht = picfile.height;
wd = picfile.width;
var args= "height=" + ht + ",innerHeig ht=" + ht;
args += ",width=" + wd + ",innerWidt h=" + wd;
popwin=window.o pen("","_blank" ,args)
popwin.document .open()
popwin.document .write('<html>< head><title>'+i mg+'</title></head><body
bgcolor=white scroll=no topmargin=0 leftmargin=0 rightmargin=0
bottomargin=0 marginheight=0 marginwidth=0> <div style="position :
absolute; top:0px;left:0p x"><a href="javascrip t:window.close( )"> <img
src="'+img+'" width="'+wd+'" height="'+ht+'"
border="0"></a></div></body></html>')
popwin.document .close()
}
function tidy() {
if (popwin.locatio n && !popwin.closed) {
popwin.close(); }
}
// Based on JavaScript provided by Peter Curtis at www.pcurtis.com &
// http://www.therotunda.net/code/autos...up-window.html -->
--
Nigel M