javascript - 图像、文本和时间延迟

标签 javascript html css

我有image with text .

image

我想要以下过程:图像(不是图像 - 它将是纯色)和文本将在 1 秒内鼠标悬停时发生变化( check this )。

image

我该怎么做?

最佳答案

使用 jQuery:

$("#my-image").on("mouseover", function () {
  setTimeout(function () {
    $("#my-image").src = "/path/to/image-two.png";
  }, 1000); // 1000 is your one second
});

关于javascript - 图像、文本和时间延迟,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22527393/

相关文章:

iphone - 无法使用移动设备放大或缩小

html - 如何隐藏或删除特定的 td 边框

html - CSS3 :not() selector Issue with child elements

javascript - 有没有办法让 "onkeydown"返回速度变慢

javascript - 尝试加载大视频但收到 '503 Service Unavailable'

HTML 固定列宽在 MS Outlook 中无法正常工作

html - 如何避免嵌套位置 : absolute elements? 中的文本换行

javascript - 在删除表的一行之前显示确认框

javascript - 如何在 Javascript 中读取 JSON 文件并将其转换为对象

html - CSS 选择子菜单