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

  • Home
  • SEARCH
  • 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 8838511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:00:56+00:00 2026-06-14T10:00:56+00:00

I need tu run javascript (Stop JWPlayer) when DIV shows up. It shows approx.

  • 0

I need tu run javascript (Stop JWPlayer) when DIV shows up. It shows approx. 15 sec after page is fully loaded.

The code I have so far

if (document.getElementById("overlay_div")) { jwplayer().stop(); }

i guess my code looks for overlay_div at the time of page load, and not after some time (15 sec in this case)

Edit: it turns out that DIV is actually there all the time but it switches from display: none to display:block after this time interval. Is there any way to run script whan div turns to display: block

Edit2: I managed to solve this on my own with the help of @elbunuelo
Here is the code in case anyone needs it:

var interval = setInterval(function(){
 if (document.getElementById("overlay_main_div").style.display=="block"){ 
      jwplayer().stop(); 
      clearInterval(interval);
 } }, 1000);
  • 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-06-14T10:00:58+00:00Added an answer on June 14, 2026 at 10:00 am

    Have you tried using an interval? i.e. Checking every 1000 ms or so if the div is present and then stopping the player?

    var interval = setInterval(function(){
         if (document.getElementById("overlay_div")) { 
              jwplayer().stop(); 
              clearInterval(interval);
         }
    }, 1000);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to run my JavaScript Code on Page Start. <body onload=document.getElementById('Label1').style.display = 'none';document.getElementById('Textbox1').style.display
I need to Run javascript in adress bar.where the js code is contained in
I have working in asp.net web application. Here I need to run JavaScript before
I need to run some Javascript code to reload the calendar when the user
I have some HTML inputs and I need to run some javascript when the
I have a form and I need to run some javascript to parse the
I have a page that need to toggle the visibility of a div at
I have a JavaScript method that I need to run on one of my
I have a javascript function, which I need to run serverside using Coldfusion8. The
i need run code that will create a database and populate tables. i am

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.