我試圖讓一個元素出現在客戶端的鼠標懸停在它上面,當它離開de對象但不起作用時它不起作用。這是非常簡單的代碼,我不明白爲什麼它不工作。下面是代碼:鼠標移動mouseout javascript不起作用
var earlyBirds = document.getElementById("earlyBirds");
var block = document.getElementById("block");
var appearenceEB = function(){
block.style.visibility = visible;
}
var dissappearenceEB = function(){
block.style.visibility = hidden;
}
earlyBirds.addEventListener("mouseover", appearenceEB);
earlyBirds.addEventListener("mouseout", dissappearenceEB);
請添加到您的html代碼。 – taxicala
它缺少引號,可見和隱藏連接爲一個字符串 – FelipeDurar