Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Pop Up Script!

  1. #1
    Join Date
    May 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Pop Up Script!

    Hi there!

    Im looking for an pop up script that can handle several pop
    ups on the same site. Can anyone post the codes here or
    point me to an site with all necesarry info?

    Thanks in advance

    //MrLeone

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    What kind of pop-ups? For pop-up windows this Dynamic Drive script is excellent:

    http://www.dynamicdrive.com/dynamicindex8/popwin.htm
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    May 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks man!

    Can this popup tool handle several popup windows on the same side?

    Like I have 5 different pics on the same side and I want each and one of them to popup when I click on each link.

    Most popup script only handle one popup on the same side.

    Thanks in advance!

    //MrLeone

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    On the same side of what? I've used this script to create pop-up windows for enlarged versions of several pictures on a single page. All I had to decide was if I wanted each pop-up unique or not. Since my enlarged photos were all of differing dimensions and I wanted each pop-up to conform to those dimensions, I went with unique ones. That meant using a different name for each one. Using it this way is not precisely covered in the documentation though. However, where it says:

    Quote Originally Posted by DD documentation:
    Step 2: Insert the following code into your html document where you want the link. You can insert multiple copies of the below, depending on how many popup links you want:
    You can do that and change the dimensions and names for each copy to get unique windows.
    Last edited by jscheuer1; 05-19-2005 at 04:35 PM. Reason: spelling
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    May 2005
    Posts
    141
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    if you want the pop ups to be alert boxes then this works for many in a row



    <SCRIPT language="JavaScript">
    alert("message");
    alert("message");
    alert("message");
    alert("message");
    </SCRIPT>

  6. #6
    Join Date
    Aug 2004
    Location
    Brighton
    Posts
    1,563
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ah, we're confusing different types of "pop ups".

    The alert script produces text boxes, whereas the others produce new windows with websites in them.

    cr3ative
    A retired member, drop me a line through my site if you'd like to find me!
    cr3ative media | read the stickies

  7. #7
    Join Date
    Oct 2004
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Popup Script on a Specific Date and time

    Is there a script that can popup a new window once (cookie enabled) and have it pop up on a specific date and time?

    Thank you.

  8. #8
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Here is a script that does two out of three:

    http://javascript.internet.com/cooki...opup-once.html

    Testing for the current date and time is a fairly simple matter but, if you limit your pop-up to just one time on one date at one hour, the chances of it occurring are slim to none. Even less so if you further restrict it to the minute, let alone second of your choosing.

    Anyways, here we go. For time to have any real meaning on the web it needs to be expressed in Universal Time so that it will be accurate (assuming the user's clock is set correctly, which is a big assumption) in all locations, this is the only tricky part. You can get date hour minute like so (seconds would be too restrictive and I recommend leaving out the minutes, as well):
    Code:
    var myDate=new Date();
    var testDate=myDate.getUTCDate()+' '+myDate.getUTCMonth()+' '+myDate.getUTCHours()+' '+myDate.getUTCMinutes()+' '+myDate.getUTCFullYear()
    As I write this, this gives a string like so:

    25 5 5 10 2005

    Meaning the 25th day of Month #5, 5 hours and 10 minutes, 2005. Months are numbered starting at 0 for January. Universal Time (a 24 hour clock time) is the same difference from wherever you are that Greenwich Time is except that it never uses daylight savings time. So if usually you are 5 hours behind Greenwich, during daylight time you will only be 4 hours behind UT. Now that we have this UT string in the variable testDate all we need to do is calculate our desired date/time to UT in the same format and compare it to testDate, as test to see if the pop-up should happen. Let's say the date you want to use is May 27th 2006, 3:02pm EDT (Eastern Daylight Time). 27 will be the first number (the date), 4 will be second (the month), 11 will be the next (hours: 3+12=15(convert to 24hr notation)-4=11 convert to UT), 2 will be next (the minutes) and 2006 last (the year) giving this string to compare:

    27 4 11 2 2006

    So now we can use:
    Code:
    if(testDate=='27 4 11 2 2006')
    as a test to see if the pop-up should happen. Putting it all together using the above script's code for executing the pop-up which is:
    Code:
    function checkCount() {
    var count = GetCookie('count');
    if (count == null) {
    count=1;
    SetCookie('count', count, exp);
    window.open(page, "", windowprops);
    
    }
    else {
    count++;
    SetCookie('count', count, exp);
       }
    }
    will give us this:
    Code:
    function checkCount() {
    var count = GetCookie('count');
    var myDate=new Date();
    var testDate=myDate.getUTCDate()+' '+myDate.getUTCMonth()+' '+myDate.getUTCHours()+' '+myDate.getUTCMinutes()+' '+myDate.getUTCFullYear()
    
    if ((count == null||testDate=='27 4 11 2 2006')&&count<20000) {
    if(testDate=='27 4 11 2 2006')
    window.open(page, "", windowprops);
    if(testDate=='27 4 11 2 2006')
    count=20000;
    else
    count=1;
    SetCookie('count', count, exp);
    }
    else {
    count++;
    SetCookie('count', count, exp);
       }
    }
    Here's a link to a demo:

    http://home.comcast.net/~jscheuer1/s...okiepop_up.htm
    Last edited by jscheuer1; 06-25-2005 at 06:16 PM. Reason: add link
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  9. #9
    Join Date
    Oct 2004
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you for helping me out with this Popup Code.

    I am trying to test it out but having problem with my PST conversions to UT hours as you have placed it within the code.


    If i want to test it for today's date, and see if it pops up at 9:15 a.m. pacific standard time and 12:15 p.m. EST...how do i write the code in the Time section?

    Say, i set it to 9:15a.m. my time..it will still popup after that if the users open their browsers after the time is set, correct?

    Thanks for your help once again.

  10. #10
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Ah, a left coaster. Right now aren't you on PDT? If so, you are 7 hrs behind UT. If you are truly on PST, you are 8 hrs behind UT. In each case add the number of hours you are behind UT to your time to come up with its UT equivalent. Using today's date as I type, PST and 9:15 am gives us 17:15 UT or:

    27 5 17 15 2005

    for the code. In my live demo, I dropped the minutes (as per my suggestion) and made the target date/time a configurable variable at the top of the script. To get that code, right click my demo page and choose 'view source'. In that case you would use:

    27 5 17 2005

    In both cases the pop-up will only display at the specific date/time and only once. If you want it to be all day but just one time per user, once the specific time is reached, that will require different code. I will get back to you on those modifications. That is not what I understood your original request to be.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •