Answer the question
In order to leave comments, you need to log in
How to hide a video after it ends?
By clicking on the button, a video appears and plays. And when I'm done, I want to hide it. With js and jq at odds, but with the Internet I built this:
$('.video-button').click(function() {
this.style.display = 'none';
$('.video').css('display', 'block');
$('.video').prop('src', '/img/video.mp4');
$('.video').on('ended',function(){
$('.video').css('display', 'none');
});
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question