Tengo el siguiente código JS e intento acceder a las funciones start()
y stop()
desde un div
con los eventos onmouseover=""
y onmouseout=""
:
NewsScroller = function(id, speed) {
this.start = function() {
_timer = window.setInterval(self.doScroll, this.scrollSpeed);
};
this.stop = function() {
if (_timer) window.clearInterval(_timer);
};
};
var scroll = new NewsScroller('marquesina', 10);
<div id="marquesina" onmouseover="scroll.stop();" onmouseout="scroll.start();">
Soy una Marquesina
</div>
Pero al ejecutar me dice que start
y stop
no son funciones.
¿De qué otra manera puedo mandar llamar las funciones anidadas para que funcione?