<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>jQuery Smooth Hover Effect</title> <style> .box{ width: 237px; height: 175px; border: 11px solid Purple; } </style> <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script> <script> $(document).ready(function(){ $(".box").hover(function(){ $(this).find("img").stop(true, true).fadeOut(); }, function(){ $(this).find("img").stop(true, true).fadeIn(); }); }); </script> </head> <body> <div class="box"> <img src="examples/resources/dog.jpg" alt="dog"> </div> <p><strong>Note:</strong> Hover the mouse cursor over the image to observe the effect, and then remove it to witness the change.</p> </body> </html>