I want to smoothly transition a div with a background-image to another within the same container, all while maintaining fixed dimensions.
Using FadeIn and Out seems like the perfect solution for this task. I need the ability to click on each visible image, which isn't possible when simply adjusting opacity. However, I still desire that nice crossfading effect between the images.
HTML
<div class="image_container">
<div id="image1"></div>
<div id="image2" style="display:none"></div>
</div>
Here's a simplified version of my JavaScript code:
$( this ).click(function() {
$( "#image1" ).fadeOut();
$( "#image2" ).fadeIn();
}