I\'m creating a video gallery consisting of thumbnails that play a short video on hover. I\'ve been able to get them to play while hovering over the video itself, but I nee
play is not a jQuery function but a function of the DOM element. You therefore need to call it upon the DOM element.
$(document).ready(function(){
$(".thumbnail").hover(
function() {
$(this).children("video").get(0).play();
}, function() {
$(this).children("video").get(0).pause();
$(this).children("video").get(0).currentTime = 0;
});
});
Note: get use for getting the native DOM element from the jQuery selection.