I have a javascript that I found online that is set to scroll text automatically, but I'd like to it begin scrolling when an element is hovered, and stop when its not hovered on. Right now I've sort of got it - it will scroll and stop when the element is hovered, but it starts anyways as soon as the page is loaded. I dont want it to start at all until the element is hovered.
http://codepen.io/anon/pen/QpgBWJ
code
Thanks a lot
In the JS, bottom, there are this block who will run function initializemarquee
. So, all you have to do is to attach it with hover event.
if (window.addEventListener)
window.addEventListener("load", initializemarquee, false)
else if (window.attachEvent)
window.attachEvent("onload", initializemarquee)
else if (document.getElementById)
window.onload=initializemarquee