Hey guys, Im trying to add a fadein effect while changing my background image using .css in Jquery I dont really know much about java, hoping someone can help me out here!
The code for changing css background image is pretty simple here:
$(document).ready(function(){
$("#button01").click(function () {
$("#content_wrapper").css({backgroundImage : 'url(image/staff/shinji.jpg)' } );
});
});
It's like a image gallery, Im just showing it in css background image everything works fine, but I was wondering if it's possible to add the fadeIn or fade-to effect.
You can't fade one image to another, only properties such as solid background colours.
What you can do is fade the opacity of an element containing an image.
Using this method, what you will have to do in order to achieve the effect you want is to have 2 images one on top of the other.
Then you can fade out one while fading in the other.
So something like:
Probably not a beautiful way of going about it, but I think it should work.