K
K
Kirilllog2016-10-12 14:17:25
JavaScript
Kirilllog, 2016-10-12 14:17:25

Why does the script work in Chrome but not in safari and firefox at all?

}

var video = document.querySelectorAll("video");

for(var i=0; i<video.length; i++) {
    video[i].onmousemove = function () {
        this.play();
    };
    video[i].onmouseout = function () {
        this.pause();
        this.currentTime = 0;
    };
}

Why does it work in chrome but not in firefox and safari? I understand the script in firefox works, but incorrectly.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton fon Faust, 2016-10-19
@bubandos

replace onmousemove with onmouseover and it will not try to play a file that is already playing.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question