View Full Version : Serious Help With Popups Needed!


yugiohw
04-01-2003, 03:21 PM
Ok, I want a popup to pop up on window load... the dimensions i want should be 100 by 100px i dont want any tool bar on there just the title bar with the exit thing and _ and maximize thing...
And i dont know any Javascript...
Ive tried everything...
Can anyone Help Me?

Stormx
04-02-2003, 05:07 PM
First you want to creat your popup as an HTML document, remembering it will be viewed in 100 x 100. Then, you get the page you want the popup to spring from, and add this code into the <head> section:

var windowW=100 // wide
var windowH=100 // high
var windowX = 260 // from left
var windowY = 100 // from top
var urlPop = "yourpopuppage.html"
var title = "This Is A Frameless Popup Window"
// set this to true if the popup should close
// upon leaving the launching page; else, false
var autoclose = true
// do not edit below this line
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=auto>"+
"<frame name='bottom' src='about:blank' 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();}
}
}
// End -->
</script>





Now, insert this into the <body> tag

onLoad="openFrameless() "

eg:

<body onLoad="top.window.focus()">