Results 1 to 3 of 3

Thread: How to Delay a Pop Up By a few Seconds

  1. #1
    Join Date
    Mar 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How to Delay a Pop Up By a few Seconds

    Hey People,

    How do I delay the drop of a pop up, say by 10 seconds? And this pop up code is gotten from this link: http://www.dynamicdrive.com/dynamici.../dropinbox.htm

    Thanks all.

  2. #2
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    I'm assuming that you can change this:

    Code:
    window.onload=initbox
    to this:
    Code:
    var box_sec = 10 //Seconds before appearing
    setTimeout(function(){initbox()},box_sec*1000)
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Not a good idea, though, because the page might not have loaded yet. Try:
    Code:
    window.onload = function() {
      setTimeout(initbox, 10 * 1000);
    };
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

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
  •