如何使用经典的asp和javascript在鼠标上更改图像? [英] how to change image in mouse over event using classic asp and javascript?
本文介绍了如何使用经典的asp和javascript在鼠标上更改图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用经典的asp和javascript在鼠标上更改图像????
How to change image in mouse over event using classic asp and javascript????
推荐答案
http://www.w3schools.com/jsref/event_onmouseover.asp [ ^ ]
使用此事件并在此事件的函数内切换所需图像的图像标记的source属性。 br />
希望这会有所帮助。
谢谢:)
http://www.w3schools.com/jsref/event_onmouseover.asp[^]
Use this event and inside the function for this event toggle the source attribute of the image tagfor the image you want.
Hope this helps.
Thanks :)
如果这是一对固定的图像(它们应该更好),最好使用CSS来保存背景图像属性两个不同的类:一个用于鼠标,另一个用于鼠标。在jQuery中,使用函数.toggleClass
更改样式。您需要的鼠标事件最好使用.hover
来处理。
您在顶级脚本< body>
元素可能如下所示:
If this is a fixed couple of images (they better should be), it's the best to use CSS for holding background image property with for two different classes: one for mouse over, another one for mouse out. In jQuery, change the style using the function.toggleClass
. The mouse events you need is best to handle using.hover
.
Your top-level script in the<body>
element can look like this:
( document ).ready( function (){
myElement =
( document ).ready(function() { myElement =
这篇关于如何使用经典的asp和javascript在鼠标上更改图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文