Reset a video on mouse out using HTML5 and Javascript - Stack Overflow

I am trying to get the video that appears after the hover to reset to the start once the mouse leaves,

I am trying to get the video that appears after the hover to reset to the start once the mouse leaves, here is the link to my test. I found this in my search for an answer But I can not figure it out how to make that work.

Here is where I got the code for the javascript: Link to code

Any help or advice would be great. Thank you! :)

I am trying to get the video that appears after the hover to reset to the start once the mouse leaves, here is the link to my test. I found this in my search for an answer But I can not figure it out how to make that work.

Here is where I got the code for the javascript: Link to code

Any help or advice would be great. Thank you! :)

Share Improve this question edited May 23, 2017 at 12:20 CommunityBot 11 silver badge asked May 5, 2012 at 0:30 DeysonDeyson 801 silver badge9 bronze badges 0
Add a ment  | 

1 Answer 1

Reset to default 6

Since your site uses jQuery:

$(".h5vt").mouseout(function() {
    $("video").get(0).currentTime = 0;
})

Just bind a mouseout event to the image that rewinds the video.

You should add an id attribute to video and access it with $("#myvideoid").get(0) or document.getElementById("myvideoid") instead of with $("video").get(0) as in my example. My selector code is just a workaround due to the fact that your video element lacks an id.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744790401a4593878.html

相关推荐

  • Reset a video on mouse out using HTML5 and Javascript - Stack Overflow

    I am trying to get the video that appears after the hover to reset to the start once the mouse leaves,

    9天前
    70

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信