Pop-up Script To Open A Window When Your Page Loads.
Place the following script between the <HEAD> and </HEAD> tags:
<script language="javascript">
<!-- begin
function popup(Site)
{
window.open(Site,'PopupName','toolbar=no,statusbar=no,
location=no,scrollbars=yes,resizable=yes,width=275,height=200')
}
// end -->
</script>
And add the following code into your <BODY> tag:
onLoad="popup('URL/to/popup.html')"
Your <BODY> tag should then look something like this:
<BODY bgcolor="#ffffff" text="#000000"
onLoad="popup('http://NowSell.com/popup.html')">
Note: In this and all script examples that follow, change the attributes "toolbar", "statusbar", etc., to on (1) or off (0) as you prefer (or omit them), and set the width and height to the size you require.
Second On Entry Pop-up Script Example
Place the following script between the <HEAD> and </HEAD> tags:
<script language="javascript">
<!-- begin
function popup(){
window.open('URL/to/popup.html','PopupName','toolbar=0,location=0,
status=0,menubar=0,scrollbars=0,resizable=0,width=345,height=400');
}
// end -->
</script>
Add the following code into your <BODY> tag:
onLoad="popup()"
Your <BODY> tag should then look something like this:
<BODY onload="popup()" bgcolor="#ffffff" text"#000000">
Third On Entry Pop-up Script Example
Place the following script between the <HEAD> and </HEAD> tags:
<script language="javascript">
<!-- begin
function popup() {
var page = "URL/to/popup.html";
var windowprops = "width=380,height=500,location=no,menubar=no,
toolbar=no,scrollbars=no,resizable=no";
newWindow = window.open(page,'PopupName',windowprops);
}
// end -->
</script>
Add the following code into your <BODY> tag:
onLoad="popup()"
Your <BODY> tag should then look something like this:
<BODY onload="popup()" bgcolor="#ffffff" text"#000000">
Delayed On Entry Pop-up Script Example
Place the following script between the <HEAD> and </HEAD> tags:
<script language="javascript">
<!-- begin
function TimedPop() {
url = "URL/to/popup.html";
width = 320; // width of window in pixels
height = 390; // height of window in pixels
delay = 30; // time in seconds before popup opens
timer = setTimeout("popup(url, width, height)", delay*1000);
}
// end -->
</script>
Add the following code into your <BODY> tag:
onLoad="TimedPop()"
Your <BODY> tag should then look something like this:
<BODY onload="TimedPop()" bgcolor="#ffffff" text"#000000">
Code to Close Pop-up After A Certain Time.
Add the following code to your pop-up script, and adjust the time (in seconds) to your requirements:
setTimeout ('self.close' ()', 1200);
Code to Open Your Pop-up With A Link.
Place the following code where you want the link to appear:
<a href="javascript:popup()">Click here for pop-up</a>
Code to Open Your Pop-up With A Button.
Place the following code where you want the button to appear:
<FORM>
<input type="button" value="Click Me" onclick="javascript:popup()">
</FORM>
Code to Create A "Close Window" Button.
Place the following code where you want the buton to appear:
<FORM>
<input type="button" value="Close Window" onclick="window.close();">
</FORM>
_________________
قولوا: لا إله إلا الله محمد رسول الله
اللهم صل على سيدنا محمد وعلى آل سيدنا محمد