Hello Guys Today i will tell you through this tutorial how you can hover through mouse in jquery with the help of element or div. you are explained through the code below.
Keywords :- jQuery animate function tutorial, Change div height & width on hover with animation using jquery, Animate an element, by changing its height and width.
amimated.html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Animate Div Height and Width on Hover Using jQuery</title> <style type="text/css"> .box{ width: 200px; height: 150px; background: #f0e68c; border: 1px solid #a29415; } </style> <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ var boxWidth = $(".box").width(); var boxheight = $(".box").height(); $(".box").mouseenter(function(){ $(this).animate({ width: "400", height: "800" }); }).mouseleave(function(){ $(this).animate({ width: boxWidth, height: boxheight, }); }); }); </script> </head> <body> <p><strong>Note:</strong> Place mouse pointer over the box to play the animation.</p> <div class="box"></div> </body> </html>