I created a website with a captivating full-page background image (img/bg_start.jpg):
If you hover your mouse over the central animal on the page, the current image (img/bg_start.jpg) will fade out and be replaced with another picture (img/bg_start2.jpg) fading in.
The process involves:
- Tracking onMouseOver and -Out Event
- Executing the following code when onMouseOver occurs:
$('#mask2').css({height: $(window).height(),width: $(window).width()}).fadeIn(800, function(){
$('#mask1').fadeOut(800);
});
For onMouseOut, a similar process is followed in reverse order (mask2/mask1)
The properties of mask1 and mask2 are defined as follows:
<div id="mask1" style="position: absolute; top: 0; left: 0; z-index:-1000; opacity: 1.0;">
<div id="mask2" style="position: absolute; top: 0; left: 0; z-index:-1000; opacity: 1.0; display:none">
However, the transition is not as smooth as desired and instead flickers. Can anyone provide assistance, please?!