jquery change background-image

前端 未结 6 648
夕颜
夕颜 2020-12-09 04:32

I\'m trying to swap two images with jQuery. Using the hover event I tried:

$(\"#wlt-DealView .buyButton_new\").mouseover(function(e){
    $(\'.buyButton_new\         


        
6条回答
  •  隐瞒了意图╮
    2020-12-09 05:17

    add the full image path and check

    $("#wlt-DealView .buyButton_new").hover(
        function()
        {
            $(this).css('background-image','url(http://107.20.186.103/themes/classic/images/compra_mouseOver.png)');
        },
        function()
        {
            $(this).css('background-image','url(http://107.20.186.103/themes/classic/images/compra_normal.png)');
        }
    );
    

提交回复
热议问题