我的产出如下。
<ul id= centrelist >
<li class="centreicon"><a href="admin/manage_mycentre/22"><img width= 70 height= 70 class= centreimg src="http://localhost/aktivfitness_new/assets/images/centre/centre1.jpg" /></a><div class="buttons"><a href="admin/manage_mycentre/22">Aktiv trening Arendal</a></div></a></li>
<li class="centreicon"><a href="admin/manage_mycentre/16"><img width= 70 height= 70 class= centreimg src="http://localhost/aktivfitness_new/assets/images/centre/centre2.jpg" /></a><div class="buttons"><a href="admin/manage_mycentre/16">Aktiv trening Blindheim</a></div></a></li>
<li class="centreicon"><a href="admin/manage_mycentre/17"><img width= 70 height= 70 class= centreimg src="http://localhost/aktivfitness_new/assets/images/centre/centre3.jpg" /></a><div class="buttons"><a href="admin/manage_mycentre/17">Aktiv trening Eid</a></div></a></li>
...
现在,当我放弃任何形象时,我想改变这种形象。 jpg with jquery.
我有以下几个方面,但我没有工作。
$(function() {
$(".centreimg")
var orgimg = $(this).attr("src");
.mouseover(function() {
var hoverimg = $(this).attr("src").match(/[^.]+/) + "hover.jpg";
$(this).attr("src", hoverimg);
})
.mouseout(function() {
$(this).attr("src", orgimg);
});
});