0
Why are use the animate() method in web development?
Why are use the animate() method in web development?
Syntax
$(selector).animate({params});
$(selector).animate({params}, speed);
$(selector).animate({params}, speed, callback);
The param argument is necessary but speed and callback are optional value.
<!DOCTYPE html>
<html>
<head>
<script src='https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js'></script>
<script>
$(document).ready(function () {
$('button').click(function () {
$('div').animate({
left: '350px',
opacity: '0.7',
height: '250px',
width: '350px',
fontSize: '85px',
top:'150px'
},1500);
});
});
</script>
</head>
<body>
<button>Start Animation</button><br /><br />
<div style='background:#98bf21;height:100px;width:100px;
position:absolute; text-align:center;'>
Zooming
</div>
</body>
</html>
