Javascript Popup window Code



Click here to see a demo popup window with sample content inside.

<html>
<head>
<title>Javascript Popup</title>
<SCRIPT TYPE='text/javascript'>
<!--
function popup(width,height){
	if(window.innerWidth){
	LeftPosition =(window.innerWidth-width)/2;
	TopPosition =((window.innerHeight-height)/4)-50;
			}
	else{
	LeftPosition =(parseInt(window.screen.width)-	width)/2;
	TopPosition=((parseInt(window.screen.height)-height)/2)-50;
			}
	attr = 'resizable=no,scrollbars=yes,width=' + width + ',height=' +
	height + ',screenX=300,screenY=200,left=' + LeftPosition + ',top=' +
	TopPosition + '';
	popWin=open('', 'new_window', attr);
	popWin.document.write('<head><title>Test Popup</title></head>');
	popWin.document.write('<body><div align=center>');
	popWin.document.write('<b>This is a test popup window</b><br><br>');
  	popWin.document.write('Content goes here<br>');
	popWin.document.write('Content goes here<br>');
	popWin.document.write('Content goes here<br>');
  	popWin.document.write('</div></body></html>');
	}
//-->
</SCRIPT>
</head>
<body>
<a href="javascript:popup(400,200);">Generate popup</a>
</body>
</html>
Window prompt window for input data

Window Object Bookmark a page Redirect Page
Subscribe to our YouTube Channel here


Subscribe

* indicates required
Subscribe to plus2net

    plus2net.com







    varatharajan

    27-01-2014

    hi,
    i want to popup menu without minimize,maximum button....
    only its will be have close option...pls reply soon...I'm waiting for your reply.....
    smo

    28-01-2014

    You can display layers with one option to close window. Read this hide layer

    Post your comments , suggestion , error , requirements etc here




    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer