It is necessary to make a smooth change in the width of the block when you hover on it. When you hover the mouse on the block, it should increase to the desired size. If the mouse cursor is removed before the block is increased to the desired size, then the block should not stop, but should finish changing its size.
While the mouse cursor is over the block, the block should remain in a modified / enlarged state.
When the mouse cursor is removed from the block, the block should return to its original position, but not immediately, but with a delay of a couple of seconds. If during the reduction of the block, hover the mouse over the block, the block must first return to its original position, and then increase. This is the challenge. I beg you to help me.
<div class="div1">Block1</div> div { background-color:#ccc; width:200px; height:100px; border:2px solid #000; } $(document).ready(function(){ $(".div1").on({ mouseenter: function() { $(this).animate({ width: 500 }, {duration:300, queue: false} ) }, mouseleave: function() { $(this).animate({ width: "200px" }, {duration:300, queue: false} ) } }) });