how to generate popup window

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
mehran
Forum Newbie
Posts: 17
Joined: Fri Jan 21, 2011 1:31 am

how to generate popup window

Post by mehran »

hi
i have passed two days but get nothing plz help me,
i want to generate a pop window which appear on video for specific time,
the popup appears time come from database and end time also come from the database,
tnx in advance,i need it urgently plz help
danwguy
Forum Contributor
Posts: 256
Joined: Wed Nov 17, 2010 1:09 pm
Location: San Diego, CA

Re: how to generate popup window

Post by danwguy »

Not usre I understand what you mean completely, the description made no sense. But if you want a popup just use the alert() command and fill in the parenthases with whatever you want to be in the popup.
gracelyn
Forum Newbie
Posts: 1
Joined: Thu Feb 10, 2011 5:27 am

Re: how to generate popup window

Post by gracelyn »

Hi,

Here is the source code for the Pop-up window

<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>
:drunk:

webdevelopment services
Post Reply