const videos = document.querySelectorAll(" .hover_video_wrapper .video");
//Loop over videos to add eventListeners
for (const video of videos) {
//Play on Mouseover
video.addEventListener('mouseover', function() {
video.play();
// Feel free to add functionalty here
}, false);
//Play on Mouseout
video.addEventListener('mouseout', function() {
// Feel free to add functionalty here
video.pause();
}, false);
}
This is a java script wich plays a video on hover and pauses on hover out can someone modify it so it resets on hover out?
New contributor
Vincent Eutin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.