试图在鼠标悬停事件上显示不同的图像。使用以下 JavaScript:
$('div.row-fluid').hover(function() {
$(this).find('img').attr('src','http://leandrovieira.com/projects/jquery/lightbox/photos/image1.jpg');
}, function() {
$(this).find('img').attr('src','http://leandrovieira.com/projects/jquery/lightbox/photos/image2.jpg');
});
以及以下 HTML:
<div class="span27 offset1" style="margin-top: -3.2em">
<div class="searchbutton"><img src='http://leandrovieira.com/projects/jquery/lightbox/photos/image2.jpg''></div>
</div>
但没有运气。有什么问题?小提琴:http: //jsfiddle.net/mpmqm/2/