I’m trying to swap two images with jQuery. Using the hover event I tried:
$("#wlt-DealView .buyButton_new").mouseover(function(e){
$('.buyButton_new').css('background-image','url(../images/compra_mouseOver.png)');
});
$("#wlt-DealView .buyButton_new").mouseout(function(e){
$('.buyButton_new').css('background-image','url(../images/compra_normal.png)');
});
But the image is not showing and after I get the mouse from it, it triggers the second event. It should update with the first image, but it doesn’t.
You can have a look here: http://107.20.186.103/deals/cuerpon.
Hover the BUY button.
If i try to enter the URL http://107.20.186.103/images/compra_mouseOver.png manually in my browser, i get a 404.
http://107.20.186.103/deals/images/compra_mouseOver.png gets a strange 500…
I think you should get your image files ready and it will work. You may also tweak your code by using the jQuery.hover function.