Utilizing this jQuery script to navigate back and forth in a video as the cursor moves along the x-axis.
var mouseX;
$(document).mousemove( function moveFunc(e) {
mouseX = e.clientX;
var timV = $("#deko_vid").get(0).duration;
var valV = (timV*mouseX/$(document).width());
$("#deko_vid").get(0).currentTime = valV;
});
Encountering some challenges:
-Works well on Safari but experiences lag in Chrome (yet to test IE/Edge). Research led me to this post, but unsure about best way forward. Should I create a covering div for the document and bind .mousemove() to it? Seek an alternative solution? Implement a tween using greensock?
Open to advice, new ideas, and constructive feedback on how to progress!