HTML 5 Video OnEnded Event not Firing

后端 未结 2 1362
孤城傲影
孤城傲影 2020-12-06 08:00

I\'m trying to react to the HTML 5 onended event for the video tag without success. In the code snippet below I added the mouseleave event to be s

相关标签:
2条回答
  • 2020-12-06 08:08

    I was searching for the answer for this too. Here's what worked for me in for the jQuery mobile framework:

    $(document).ready(function(){
      $("#idname").bind('ended', function(){
      $.mobile.changePage($('#idofpageyouwantogoto'), 'fade');
      });
    });
    
    0 讨论(0)
  • 2020-12-06 08:24

    Make sure you're binding to the ended event instead of onended, always leave the on out when binding with jQuery, for example you couldn't do .on("onclick"), you'd do .on("click").

    If it helps, there's a full listing of available events for the <video> element here: http://www.w3.org/2010/05/video/mediaevents.html

    0 讨论(0)
提交回复
热议问题