javascript - html 中的 onmouser 图像

标签 javascript html image onmouseover

<img width="167" height="119" onmouseout="this.src='http://test.plexasys.com/vivid/wp/wp-content/files_mf/pixel36092.png'" 
 onmouseover="this.src='http://test.plexasys.com/vivid/wp/wp-content/files_mf/pixel360rollover53.png'" alt="baton" 
src="http://test.plexasys.com/vivid/wp/wp-content/files_mf/pixel36092.png">

我已经为另一个图像的鼠标悬停上的图像编写了这样的内容。它在我的本地系统中运行良好。但在服务器中,鼠标悬停图像第一次加载缓慢。第二次以后工作正常。

请找到链接http://2014.vividrgblighting.com/products/

最佳答案

悬停图像第一次加载缓慢,因为它们必须由浏览器加载。它们第二次运行得更快,因为浏览器已经缓存了它们。如果您希望自动加载所有图像,则需要使用 Javascript 预加载所有图像。

关于javascript - html 中的 onmouser 图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21397772/

相关文章:

javascript - 使用 Foundation for Apps, Controller 和 ng-repeat 出现问题

php - 如何正确更改和隐藏上传图片的目的地?

html - 图像有重叠边框,不确定我是否做对了

c++ - 尝试使用旋转矩阵,但失败了

javascript - ECMAScript6 AngularJS 过滤器

asp.net - 如何通过 JavaScript 访问位于用户控件中的 ASP 控件

javascript - 为什么我的代码执行的次数比预期的要多?

html:如何将行号添加到源代码块

配置文件框的 html 模板

C#:将多个图像保存到一个文件中