Hi,

I have a hover effect whereby an image is being faded out and another is fading in. However, Is there a way for these actions to happen simultaneously? So as one is fading out the other fades in.

My code so far is:

$('.square').mouseenter(function () {
    $(this).attr('data-image', 'two');
    $(this).find('.one').fadeOut('medium');
    $(this).find('.two').fadeIn('medium');
});

Thanks,

Recommended Answers

All 2 Replies

fadeOut and fadeIn are asynchronous, so it should be nearly simultaneously.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.