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 6661457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:16:55+00:00 2026-05-26T02:16:55+00:00

I have webpage with a video element nested in a div class=video-container along with

  • 0

I have webpage with a video element nested in a div class=”video-container” along with a div class=”video-control-bar” which I am using JQuery to animate. I am also using setInterval to query the currentTime of the video element and reflect that in the progress bar contained in the video-control-bar.

JavaScript:

$(function(){
  $(".video-container").each(function(){
    player_init($(this))
  })
})

function player_init(self)
{
  setInterval(function(){
    var video = self.find("video")[0]
    self.find(".video-control-bar").find(".video-position").find("input").val(video.currentTime / video.duration)
    self.find(".video-control-bar").find(".video-position").find("progress").val(video.currentTime / video.duration)
  }, 500)
  self.hover(function(){
    self.find(".video-control-bar").stop().animate({bottom: "0px"}, 25)
  }, function(){
    self.find(".video-control-bar").stop().animate({bottom: "-39px"}, 350)
  })
}

Problem? Well, in Chrome, if I load the page, my setInterval function gets called every 500ms like expected, until I mouse over the player, causing the control-bar animation. After that no further calls are made to my setInterval function.

HOWEVER if I hit refresh, the page reloads and I can mouse over it all I want and everything continues working correctly. But only if I load the page via a refresh.

This doesn’t happen in Firefox. I suspect it may be a bug in Chrome, as it is similar to a problem I submitted here.

I really have no idea if it’s a problem with the way I’m doing things, an issue with JQuery or a bug in Chrome. I really don’t care who’s bug it is, I just want things to work.

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-26T02:16:56+00:00Added an answer on May 26, 2026 at 2:16 am

    self.hover() might be returning when finished thus ending the player_init()

    Try something that separates the timeout function from the hover function, like this:

    $(function(){
        $(".video-container").each(function(){
            $this = $(this);  //small optimization
            hover_init($this);
            player_init($this);
    
            });
    });
    function player_init(self){
      var a = self.find(".video-control-bar .video-position");
      var video = self.find("video")[0]
      setInterval(function(){
        a.find("input").val(video.currentTime / video.duration)
        a.find("progress").val(video.currentTime / video.duration)
      }, 500)
    }
    function hover_init(self){
        selfhover(
                function(){
                    self.find(".video-control-bar").stop().animate({bottom: "0px"}, 25)
                }, function(){
                    self.find(".video-control-bar").stop().animate({bottom: "-39px"}, 350)
                });
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In the center of my webpage I have a div with id center-container which
I have a flash video player in a div inside a webpage, I'm trying
While scrolling my web page a DIV which have a video is not going
I have an app that is displaying a webpage using a WebView control. I
hi i have a webpage which allows users to enter the youtube video and
I have a SWF Video player on my webpage. I want to draw a
I have a YouTube's player in the webpage. I need to change the video
Frankly speaking. I'm looking for a specific video course webpage which I visited few
I am using the following code to play a video inside my webpage. The
I have a webpage which contains the followsing code snippet containg links to videos:

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.