Link to home
Start Free TrialLog in
Avatar of sanjshah12
sanjshah12Flag for United Kingdom of Great Britain and Northern Ireland

asked on

Fade In Image Fade Out another

Hi,

I am using the following function to fade out one image and fade in another (replacement), however currently this fades out so to white before another image fade in, is it possible to fade ontop gradually so it does not fade out completely?

               
if (dataId != $('img#largeImg').attr('src').replace(/\?(.*)/, '')) {
                    $('img#largeImg').stop().animate({
                        opacity: '0'
                    }, function () {
                        $(this).attr('src', dataId + '?' + Math.floor(Math.random() * (10 * 100)));
                    }).load(function () {
                        $(this).stop().animate({
                            opacity: '1'
                        });
                    });
                }

Open in new window


Any help is appreciated.
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sanjshah12

ASKER

many thanks Julian, I will test in my application and get back to you shortly.