I want to make this as mobile javascript, i run this code but in macbook safari laptop view it's running also
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ) {
function scrollFinished() {
vid = document.getElementsByClassName('my-video-scroll')
//play video
if (runningVideo < vid.length && runningVideo >= 0) {
vidTop = vid[runningVideo].offsetTop
window.scrollTo(0, vidTop - 0 - scrHeight * 0);
vid[runningVideo].currentTime = 0;
vid[runningVideo].play()
}
//show the currently playing video and the total video to the console
console.clear()
console.log('running: ' + (runningVideo + 1))
console.log('total: ' + vid.length)
setTimeout(function () {
scrooling = false
}, 500)
}
}
I tried deleting the webOS/iphone/ipad/ipod its running as well