Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用以下行:
<a <img src="images/m1.png" onmouseover="this.src='images/m0.png'" onmouseout="this.src='images/m1.png'"/></a>
所以,我只是在悬停时将一张图像更改为另一张图像。问题是悬停后需要一秒钟才能加载第二张图像。它看起来又慢又丑……
我的问题是:是否可以让浏览器在用户实际与第一张图片交互之前加载第二张图片?
感谢您的时间!
只需使用 Javascript 在标题中的某处定义您的图像
img[i] = new Image(); img[i].src = <URL>;