mouseover 및 out 기능에 문제가 있습니다. 마우스가 이미지 위에있을 때 이미지가 멈추어야하지만 마우스가 없으면 같은 간격이 발생해야한다는 것을 의미합니다.javascript mouseover and out functions
귀하의 도움에 감사드립니다.
var myImage = document.getElementById("world");
var imageArray = ["imgs/worldGray.png","imgs/worldGreen.png","imgs/worldPink.png", "imgs/worldYellow.png", "imgs/world.png"];//html picture add here
var imageIndex=0;
function changeImage(){
myImage.setAttribute("src",imageArray[imageIndex]);
imageIndex++;
if(imageIndex >=imageArray.length){
imageIndex =0;
}
}
var intervalHandle=setInterval(changeImage,5000);
// the problem is in the below fucntions
myImage.onmouseover = function(){
clearInterval(intervalHandle);
}
myImage.onmouseout = function(){
setInterval(intervalHandle);
}
흠 나는 그것이 실제 문제가 무엇인지 말하는 코딩 문제라고 생각합니다. 우리가 당신을 더 잘 도와 줄 것입니다. – Rhumborl