File manager - Edit - /home/custbahd/fitbora.net/js/video-on-scroll.js
Back
//Play Video On Scroll window.addEventListener('load', videoScroll); window.addEventListener('scroll', videoScroll); function videoScroll() { if ( document.querySelectorAll('video[autoplay]').length > 0) { var windowHeight = window.innerHeight, videoEl = document.querySelectorAll('video[autoplay]'); for (var i = 0; i < videoEl.length; i++) { var thisVideoEl = videoEl[i], videoHeight = thisVideoEl.clientHeight, videoClientRect = thisVideoEl.getBoundingClientRect().top; if ( videoClientRect <= ( (windowHeight) - (videoHeight*.5) ) && videoClientRect >= ( 0 - ( videoHeight*.5 ) ) ) { thisVideoEl.play(); } else { thisVideoEl.pause(); } } } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Generation time: 2.6 |
proxy
|
phpinfo
|
Settings