I use a little script for showing images as backgrounds inside divs. The problem is that I need some animation for this but nothing I have tried works, my actual script is this:
var valimg="image_1.jpg";
jQuery("#sw_pic").css("background-image",""+valimg);
jQuery("#sw_pic").fadeIn(2000);
The problem, for example, is when I run this, it doesn't generate the fade effect, also I tried jQuery's animate()
but with the same result. Only opacity seems to work, but no other.
How I can use this or write code that works finally and get some effect when loading images as background?
Regards and thankĀ“s for the help