Welcome to %s forums

<No. 1 Community for developers, by developers/>

Login Register

How to change any image with fade effect by overlapping the image?

Get support on JavaScript,jQuery, AJAX and other related technology.
Post Reply
admin
Site Admin
Posts: 45

How to change any image with fade effect by overlapping the image?

Post by admin » Thu Aug 22, 2019 2:51 pm

HTML:

Code: Select all

<div id="example" style="background-image: url(abc.jpg);">
  <img src="/images/pqr.jpg" alt="pqr" />
</div>
jQuery:

Code: Select all

$("#example").hover(function(){

    $(this).find("img").fadeOut();

}, function() {

    $(this).find("img").fadeIn();

});

Post Reply