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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:53:44+00:00 2026-05-27T09:53:44+00:00

I have two buttons on a page that trigger two functions that make two

  • 0

I have two buttons on a page that trigger two functions that make two html5 video play, hide and show some elements (including themselves), and call another simple function on ended (that causes the video to go to the first frame and pause, for the effect to work properly).

$('#rotate').click(function rotate(){

$('#rotate').hide();
$('#front_view').css('z-index','2');
$('#back_view').css('z-index','3');

//this is the video:
    $('#body_animation').trigger("play").show().bind('ended', function () {
    $('#back_view').show();
    $('#front_view').fadeOut(500);
    $(this).hide();

    this.currentTime = 0;           
    this.pause();

    });

    $('#rotate_reverse').delay(2000).fadeIn(0);
});

This works fine in firefox and safari, but in chrome and IE something strange happens. The first time the page loads, the “ended” event doesn’t seem work. It works fine if you refresh the site (or if you run it offline), though.

You can check the code in here, I narrowed all the site to this problem, so you can see it better:

http://www.hidden-workshop.com/test/

The actual videos and images are different, but the problem is the same. I’m busting my head trying to solve this thing, but I can’t find the answer anywhere.

Thanks in advance!!

  • 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-27T09:53:45+00:00Added an answer on May 27, 2026 at 9:53 am

    Your test page isn’t live anymore, so I can’t check this, but I found that if looping is enabled for the tag (e.g., <video loop="loop">), the “ended” event wasn’t firing in Chrome or IE (I didn’t test in Firefox). Once I removed the loop attribute, the “ended” event fired in both browsers.

    HTML (with loop attribute, which will prevent the ‘ended’ event form firing):

    Remove the loop attribute if you want the ‘ended’ event to fire…

    <video id="video" loop="loop">
        <source src="whatever.mp4" width="320" height="240" type="video/mp4" />
        Your browser does not support this HTML5 video tag.
    </video>
    

    Javascript:

    //NOTE: This only fires if looping is disabled for the video!
    $("#video").bind("ended", function() {
        alert('Video ended!');
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two radio buttons on my MVC form that I use to hide
I have two form elements on my page that act as a smooth login
I have an .aspx page that contains two buttons one is btnCancel and another
I have a main page that contains two buttons. Each of the buttons should
I have an aspx page with two buttons, one of the buttons has an
I have two select lists that each display users and two buttons (add and
I have view for entering new entity. On that view I have two buttons:
i have two buttons on the page. One button is responsible for text fields
I have a page with two submit buttons at the bottom of the page.
I have one page in HTML , there are two buttons , save and

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.