jQuery change div background-image with fadeIn/Out

前端 未结 6 863
挽巷
挽巷 2020-12-19 01:02

I\'m trying to create a fadeIn/Out effect on a site I created (edit: site url deleted)

Everything works great except when you click on one of the colors in the color

6条回答
  •  忘掉有多难
    2020-12-19 01:25

    The solution that worked for me:

    var image = $('#image-holder');
        image.fadeOut(1000, function () {
            image.css("background", "url('images/design-" + newColor + ".jpg')");
            image.fadeIn(1000);
        });
    

提交回复
热议问题