dimanche 20 avril 2014

Javascript Calling a function on mouse over


Vote count:

0




I have a series of sliding pictures. The auto slide is activated by startSlider();

While hovering with the mouse on the div id="gallery" I want to pause the sliding but id doesn't work. I tried with just .hover with jquery but it didn't work. At the moment I'm not using jquery, only javascript.



function startSlider() {loop=setInterval ( moveRight, 1000 )}

startSlider();

function stopLoop(){
window.clearInterval(loop);
}

$("#gallery").onmouseover (
function(){
stopLoop()})
$("#gallery").onmouseout(
function(){
startSlider()}
)


asked 17 secs ago






Aucun commentaire:

Enregistrer un commentaire