I think this happend only to pictures I haven viewed before. One I veiw the image once the problem never happens again for that image.
Do I need to preload the image or somthing with javascript
Code: Select all
<?php
echo "<a href="javascript:showPic('$dir/$image[$j]', '$image[$j]');">\n
<img src='$dir/$image[$j]' border='0' width='$image_width[$j]' height='$image_height[$j]'></a>\n"
?>Code: Select all
var picWin = null;
function showPic(pic, title){
if (picWin && !picWin.closed) picWin.close();
pageDoc = '<html><head><title>'+title+'</title></head>';
pageDoc += '<body marginwidth="0" marginheight="0" leftmargin="0" topmargin="0">';
pageDoc += '<A href="javascript:window.close()"><img border=0 src="'+pic+'" alt="'+title+'"></a>';
pageDoc += '</body></html>';
thePic = new Image();
thePic.src = pic;
attr = 'width=' + thePic.width;
attr += ', height=' + thePic.height;
attr += ', left=' + (screen.availWidth/2 - thePic.width/2);
attr += ', top=' + (screen.availHeight/2 - thePic.height/2);
picWin = window.open('', 'picWin', attr);
picWin.document.write(pageDoc);
}