Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 545215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:44:16+00:00 2026-05-13T10:44:16+00:00

I am using jQuery to have a promotional window opening up -say- 5 seconds

  • 0

I am using jQuery to have a promotional window opening up -say- 5 seconds after a page is loaded. But the effect is lost for people who open the page in a new window or a new tab. When they get to my tab the window will already be open.

Is there a way to get this to fire when people actually start viewing my site?

I was thinking about catching a scroll or something, but people don’t get started scrolling immediately and most won’t scroll at all. Other than that I am out of ideas.

I am not sure if jQuery offers a solution here… javascript?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T10:44:16+00:00Added an answer on May 13, 2026 at 10:44 am

    the following should do the trick .. (jQuery)

    <script type="text/javascript">
    function initiatePopup(){
        $(window).unbind('blur');
        $(window).unbind('focus');
        // do the popup
    };
    
    $(document).ready(
                 function(){
                            $(window).focus( initiatePopup ).blur( initiatePopup );
                            // your other functions should go from here on
    
                           }
                     );
    </script>
    

    [EDIT] on OP request..

    code edited to make the example all inclusive

    [EDIT 2]

    The code above has been edited again because we need to handle the blur event as well.. so we take the code for the popup somewhere else in order to not duplicate it inside both events..

    [EDIT 3]

    if you want to pass parameters to the popup if they are created later on, then change the event binding line to

    $(window).focus( function() { initiatePopup(params); } ).blur( function() { initiatePopup(params); );
    

    and of course change the initiatePopup to accept parameters ..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some tabs using jQuery UI which work just fine, but I want
Using jquery I have a clicking tab mechanism that are nothing but anchor tags
I have been using jquery ui with no problem but just recently the jquery
I'm using jquery and have an entire html page stored in var page var
I am working on Project where I have JQuery 1-Page Horizontal scrolling website using
I have a simple page with two lists. Using jQuery I have set the
Using jQuery validation plugin but it has no CSV validation. I have made an
Hi I am using jquery to have the sliding effect, kwicks effect, slideup and
Hey right now I'm using jQuery and I have some global variables to hold
using jquery v1.3.2 and jQuery UI 1.7.1 I have 1 tab control with 3

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.