Spectacular Free Slide Show MP3 Sound Streamer Email Link Encoder Stream Website Audio Cool Free Text Scroller

CodeLifter.com
Software & Scripts by CodeBrain.com
Home

JavaScripts
PopUp Maker
-
popup windows

CodeLifter 5
-
source viewer

ScrollBar Styler
-
color scrollbars

Flash Fixer
-
remove alerts

Roll-Over Maker
-
image roll-overs

Link Cloaker 5
-
encrypt links

Site Capture 3
-
hidden frames

CHMOD 2 Utility
-
chmod utility

BlackBird 3.0
-
browser shell

Zoom 1.0
-
magnifier
MicroTicker.com
-
text scroller

CodeBrain.com
-
java applets

D3Q.com
-
xp icon control

BrainCode.com
-
java applets

MailToProtector
-
protect email
Java Applets
Perl Scripts
Affiliate Program
Index JavaScript
Tip
Index
How do I do automatic timed popups with
PopUp Maker?

.
Step One:

Make up your popup code per usual with PopUp Maker. 

Important: Remember to use a different Function Name and PopUp Name for each one if you are using more than one popup in a given page.

Insert the script(s) in the head of the page, just as you usually do.

We'll show an outline of how this all goes together at the end -- it's fairly easy to do.

Step Two:

For each popup -- after the popup scripts you inserted in Step One -- then you will insert a call for a timer, like this:

<script>
setTimeout("
doPopUp1()", 15000);
</script>

Call the popup function as shown in red.  The 15000 shown in this sample is how long to wait before launching the popup.  The figure is in milliseconds (1000 =  1 second), so, for example, the sample above is set to wait 15 seconds before launching the popup.

General Outline:

This shows how it will all go together in the <head> section of your page.  Here, we show how to do two such poppers with different start times.

<head>

<script>

// PopUp Maker 5.0 by CodeBrain.com
// PopUp Window Script
// Place this script in the <head> of your page.

function
doPopUp1(){
doPopUp1Window = window.open(... etc. ...);
}

</script>

<script>

// PopUp Maker 5.0 by CodeBrain.com
// PopUp Window Script
// Place this script in the <head> of your page.

function
doPopUp2(){
doPopUp2Window = window.open(... etc. ...);
}

</script>


<script>
setTimeout("
doPopUp1()", 15000);
</script>


<script>
setTimeout("
doPopUp2()", 30000);
</script>

</head>

Thus, we have two different popups -- doPopUp1( ) and doPopUp2( ) -- which will fire respectively at 15000 milliseconds (15 seconds) and 30000 milliseconds (30 seconds).

To do more than two -- just follow the overall pattern.

I've written this to try to make it as clear as possible to newcomers to the art.  More experienced coders can clean up the code by removing the // comment lines and all but the very first <script> and very last </script> tags around the code, as they're redundant.

This is a handly technique for a variety of uses, so do bookmark this page.

Best regards,

etLux
Chief Programmer
CodeLifter.com

 

[ Question courtesy of Phil Hammond ]

Get The Code! CodeLifter is a CodeBrain.com Sister Site
© 1995-2008 OEC Corp & CodeLifter.com
CodeLifter™ & CodeBrain™
Legal Notices


CodeBrain InterNET Group
BrainCode.com CodeFoot.com CodeBelly.com
D3Q.com etLux.com FFFast.com
IEFix.com PopUpWorks.com MicroTicker.com
DavidSosnowski.com OECCorp.com MailToProtector.com
CodeBrain.com



Free MP3
Downloads


Contemporary classical music, completely free.

.