发布于 2014-03-20 08:37:56
使用jQuery:
$("#my-image").on("mouseover", function () {
setTimeout(function () {
$("#my-image").src = "/path/to/image-two.png";
}, 1000); // 1000 is your one second
});发布于 2014-03-20 08:36:48
您可以使用像setTimeOut()这样的js函数,或者如果想使用setInterval()
显示定时文本:
var x = document.getElementById("txt");
setTimeout(function(){x.value="2 seconds"},2000);
setTimeout(function(){x.value="4 seconds"},4000);
setTimeout(function(){x.value="6 seconds"},6000);就你而言:
onmouseover = "seTimeOut(call Function(), 1000);"在函数{阻止旧图像旧文本,并显示新图像和新文本,例如css属性显示,内联或块显示,没有不显示。
document.getElementById("text").style.display = 'none';
document.getElementById("new-text").style.display = 'inline' or 'block';}
希望能帮上忙。
发布于 2014-03-20 08:39:49
在鼠标悬停时,您可以使用css更改图像。
<div class="imgclass"></div>
.imgclass{
background-image: url('img.jpg');
height: 70px;
width: 120px;
}
.imgclass:hover {
background-image: url('hoverimg.jpg');
}https://stackoverflow.com/questions/22527393
复制相似问题