Hi there,
I’d like to pause a background video with a button. Is that possible?
Can someone post a code to do that?
Thanks
Hi there,
I’d like to pause a background video with a button. Is that possible?
Can someone post a code to do that?
Thanks
Give your button an ID (not class!) of pause-videos
.
Add this in your Site Dashboard > Custom Code > Footer Code
<script>
var Webflow = Webflow || [];
Webflow.push(function() {
$('#pause-videos').click(function() {
$('video').get(0).pause();
return false;
});
});
</script>
Save and publish (cannot view in designer)
Also, feel free to contact me for further code help and/or customization of third-party plugins