PDA

View Full Version : Please help to modify this popup script.



Cheng
07-08-2006, 02:44 PM
Hi.

I found this script and it opens a popup without any borders.
If some could modify it so that it not opens in full window mode, I mean that the size of the popup window can be set and that it closes if clicked somewhere outside the popup automatically.
That would be great.
Hope someone of you guys has an idea how to do that.

Thank you.
Cheng


<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Open Flash Movie</title>
</head>
<SCRIPT LANGUAGE="JavaScript">





var windowW=650
var windowH=500
var windowX = 100
var windowY = 100
var urlPop = "http://www.google.com"
var title = "Frameless popup window"


var autoclose = true

s = "width="+windowW+",height="+windowH;
var beIE = document.all?true:false
function openFrameless() {
if (beIE) {
NFW = window.open("","popFrameless","fullscreen,"+s);
NFW.blur();
window.focus();
NFW.resizeTo(windowW,windowH);
NFW.moveTo(windowX,windowY);
var frameString=""+
"<html>"+
"<head>"+
"<title>"+title+"</title>"+
"</head>"+
"<frameset rows='*,0' framespacing=0 border=0 frameborder=0>"+
"<frame name='top' src='"+urlPop+"' scrolling=no>"+
"<frame name='bottom' src='http://www.google.com' scrolling='no'>"+
"</frameset>"+
"</html>";
NFW.document.open();
NFW.document.write(frameString);
NFW.document.close();
}
else {
NFW = window.open(urlPop,"popFrameless","scrollbars,"+s);
NFW.blur();
window.focus();
NFW.resizeTo(windowW,windowH);
NFW.moveTo(windowX,windowY);
}
NFW.focus();
if (autoclose) {
window.onunload = function(){NFW.close();}
}
}

</script>

</HEAD>

<BODY>
<center><a href="javascript:openFrameless()">Open Flash Movie.</a></center>
<body>

</body>

</html>