Hi All,
Is there a way to make a background video play just once? This doesn’t work for me:
Thanks.
Niall
Hi All,
Is there a way to make a background video play just once? This doesn’t work for me:
Thanks.
Niall
The code you need for this is as follows
<script type="text/javascript">
document.getElementById('Video').removeAttribute("data-loop");
</script>
Can you share your read only and webflow staging webflow domain please?
Here’s a new code:
<script>
Webflow.push(function() {
document.getElementById('video').querySelector('video').removeAttribute('loop');
});
</script>
Thanks a million. That worked
I’m glad I could help.
Hi, I’m having the same issue but for some reason the code doesn’t seem to work for me. Would it be possible to let me know where I’m going wrong https://preview.webflow.com/preview/marketingmatters2?utm_medium=preview_link&utm_source=dashboard&utm_content=marketingmatters2&preview=8e8a9cde734a09777a13aa19fd2aa73a&mode=preview
Thanks
Hello @aaronocampo I have followed your instructions in regard to the script and ID for video background but it is still looping, any thoughts? TY!!!
Love the code. Only issue is it works on element ID and the thing about taking element ID to trigger things is it only works on 1 thing, not more than 1 video.