Javascript popup window

This Tutorial Has Been Viewed 2,440 Times.

Hello this is a simple tutorial which shows how to add a popup window using javascript Add the below javascript code on your webpage.

<script language="javascript" type="text/javascript">
var win= null;
function OpenNewWindow(mypage,w,h,myname){
var winl = (screen.width-w)/2;
var wint = (screen.height-h)/2;
settings='height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no,toolbar=no'
win=window.open(mypage,myname,settings)
if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}
// end script here -->


Now use this code to call the javascript function

<a href="#" onclick="OpenNewWindow('http://mistonline.in/','710','548','Loading');" > Popup Magic </a>

Here we are passing 2 arguments one is width which is 710 and height 548. You can customize those accordingly.

VN:F [1.9.13_1145]
Rating: 6.0/10 (1 vote cast)
VN:F [1.9.13_1145]
Rating: 0 (from 0 votes)

Javascript popup window, 6.0 out of 10 based on 1 rating

Incoming search terms:





You will also be interested in ,

Leave a Reply

Spam protection by WP Captcha-Free

Proudly designed by Mistonline.in.
Affordable Seo PackagesSeo BlogEdu Backlinks
More in JavaScripts, scripts (86 of 143 articles)