jQuery – Easy image rollover

[javascript]
$(".hover").hover( function() {
var currentImage = $(this).attr("src");
$(this).attr("src", $(this).attr("hover"));
$(this).attr("hover", currentImage);
//css("background-position", "-50px 0");
}, function() {
var currentImage = $(this).attr("src");
$(this).attr("src", $(this).attr("hover"));
$(this).attr("hover", currentImage);
});
[/javascript]

Leave a Reply