这是我编写的JavaScript代码:$('.service_img').mouseover(function(){ $(this).addClass('animated jello');})">
下面的HTML有一个带有类service_img
的简单图像标记。
<img class="service_img" src="img/other/wedding.png" alt="wedding" />
这是我编写的JavaScript代码:
$('.service_img').mouseover(function(){
$(this).addClass('animated jello');
})
如何将jQuery mouseover事件添加到img
发布于 2015-12-17 02:01:01
// Runs when the mouse enters the element
$("img.service_img").on('mouseover',function(){
$(this).addClass('animated jello');
});
// Runs when the mouse leaves the element
$("img.service_img").on('mouseout',function(){
$(this).removeClass('animated jello');
});
https://stackoverflow.com/questions/34331217
复制相似问题