【问题标题】:send html5 video back to start on mouse leave将 html5 视频发送回鼠标离开时开始
【发布时间】:2016-05-30 09:24:09
【问题描述】:

我想在鼠标离开时将视频发送回起点,不知道该怎么做,我的代码如下,可以正常播放和暂停,但不会将视频发送回起点离开的时候。

JQuery

 $(document).on("mouseenter", ".mammo-video", function(e){
      $(this).get(0).play();
 });


 $(document).on("mouseleave", ".mammo-video", function(e){
     $(this).get(0).pause();
 });

谢谢!

【问题讨论】:

    标签: jquery html5-video


    【解决方案1】:

    mouseleave中使用这个:

    $(this).get(0).currentTime=0;
    //$(this).get(0).play(); //if you want it to play
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-12-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多