Any idea how to make it slide down ? i tried to pass second argument with a time but it swings it left. Should i use another method ?
$(document).on('click', '#bar', function () {
$("#baz").addClass("foo");
});
body{
height:200px;
position:relative;
}
.foo{
position:absolute;
bottom:0;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
</head>
<body>
<button id="bar">PUSH IT DOWN</button>
<div id="baz">TEST</div>
</body>
</html>