Example - 1
<script type="text/javascript">
function open_chat_window()
{
testwindow = window.open("http://www.google.co.in", "Google popup Window", "menubar=1,resizable=1,width=682,height=570");
testwindow.moveTo(150, 150);
}
</script>
<body>
<a href="#" onclick="open_chat_window();">Open Google in popup</a>
</body>
Example - 2
<script type="text/javascript">
var width = 800;
var height = 600;
var left = parseInt((screen.availWidth / 2) - (width / 2));
var top = parseInt((screen.availHeight / 2) - (height / 2));
var windowFeatures = "width=" + width + ",height=" + height
+ ",menubar=yes,toolbar=yes,scrollbars=yes,resizable=yes,left="
+ left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
child1 = window.open("popup_window.php", "subWind", windowFeatures);
if (!child1) {
alert('You have a popup blocker enabled. Please allow popups for www.yourSite.com');
}
</script>
Comments
Post a Comment