On this page, http://55-corinthian-drive.webflow.io/video-testing-button on selecting the play button a hidden div with a background video is revealed and plays. All good. On selecting the closing icon the video disappears, still good. But the video is still playing, I need it to stop and reset to the start, not pause, or keep playing.
I have tried the following script in the foot of the page concerned, ‘home-vid’ is the id of the background-video element. ‘.video-close’ is the class of the element being selected to hide the div containing the video.
var myVideo = document.getElementById(‘home-vid’);
$(function(){
$(‘.video-close’).click(function(){
myVideo.pause();
myVideo.load();
});
});
In case anybody asks, the designer doesn’t want to use the Lightbox approach, wants the video contained in the div.
Yes, thanks Siton, that’s what I’m asking. The following code is what I have tried so far but isn’t stopping the video. (I did have it in my question above but didn’t notice at the time that the Post editor didn’t allow it.)