PDA

View Full Version : Popups work fine in FF, fullscreen in IE



niemie
Jun 15th, 2006, 07:42 PM
I know one person the popup worked for on IE fine, the rest (including me) get a full screen window. I searched around Microsoft's Knowledge Base and the only thing I found was to hold down the ctrl key when you click, which works. But that's stupid - is there any way to get this to open as a popup vs full screen in IE?

The page is:

Click on one of the photos and they popup.

Here is the JS being called:


function init(url,wid,hgt)
{
var sw = (screen.width - wid) / 2;
var sh = (screen.height - hgt) / 2;
var imgwin = open(url,'theimg','width='+wid+',height='+hgt+',left='+sw+',top='+sh+',menubar=0,toolbars=0,scrollba rs=0,status=0');
if(imgwin)
{
imgwin.close();
imgwin = open(url,'theimg','width='+wid+',height='+hgt+',left='+sw+',top='+sh+',menubar=0,toolbars=0,scrollba rs=0,status=0');
}
imgwin.focus();
imgwin.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'
+'\n<html xmlns="http://www.w3.org/1999/xhtml">'
+'\n<head>'
+'\n<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />'
+'\n<title>Photo Display</title>'
+'\n<style type="text/css">'
+'body { margin:0;padding:0;}'
+'div { text-align:center; }'
+'</style>'
+'\n</head>'
+'<body>'
+'<div><img src="'+url+'" alt=""></div>'
+'</body>'
+'</html>');
imgwin.document.close();
}

niemie
Jun 15th, 2006, 08:48 PM
Fixed it by using a different script (below) for anyone that encounters the same issue:



var imgwin;
var sw = (screen.width - 500) / 2;
var sh = (screen.height - 300) / 2;
function init(url)
{
imgwin = open(url,'theimg','width=500,height=300,left='+sw+',top='+sh+'');
imgwin.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'
+'\n<html xmlns="http://www.w3.org/1999/xhtml">'
+'\n<head>'
+'\n<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />'
+'\n<title>Text</title>'
+'\n<style type="text/css">'
+'body { margin:0;padding:0;}'
+'div { text-align:center; }'
+'</style>'
+'\n</head>'
+'<body>'
+'<div><img src="'+url+'" width="500" height="300" alt=""></div>'
+'</body>'
+'</html>');
imgwin.document.close();
if(imgwin)
{
//imgwin.close();
//imgwin = open(url,'theimg','width='+wid+',height='+hgt+',left='+sw+',top='+sh+',menubar=0,toolbars=0,scrollba rs=0,status=0');
imgwin.focus();
}
}