Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jun 2012
    Location
    South Carolina
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Triggering a pop up after a certain length of time

    Hi all,

    I'd like to create a pop-up window triggered after a user has been on a page for a certain length of time. Is JavaScript the way to do this? I'm well-versed in HTML and CSS and have a very limited understanding of JavaScript. Excited to learn

    Any tips or suggestions on how to make this happen would be appreciated. Thanks in advance!

  • #2
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    Code:
    function openNew(){
    window.open('file.html','window_name');
    }
    <body onload="setTimeout('openNew()',x);">
    x = number of milliseconds to open new window
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

  • #3
    New Coder
    Join Date
    Jun 2012
    Location
    South Carolina
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks WolfShade! That's looks pretty straightforward.

    If I code it so the popup is a div instead of another html page, would i just put the div name where you currently have file.html?

    (I'm not at a point yet where I can try this on the site; the answer may easily reveal myself once I plug it in)

  • #4
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    A popup has to be another document or file (htm/html/asp/ppt/doc/etc.)

    What you are asking sounds more like a modal window, or at the least a hidden div that becomes visible. Slightly different beast.
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".


  •  

    Posting Permissions

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