Animate an element, by changing its height and width using jquery
- جي كويري
- 2021-09-22
- mhanasmh00489829403
الأجوبة
HTML Code :
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<meta charset="utf-8">
<title>Animate an element, by changing its height and width</title>
</head>
<body>
<button id="btn1">Animate height & width</button>
<button id="btn2">Reset</button>
<div id="box" style="background:#B45F04;height:100px;width:100px;margin:6px;"></div>
</body>
</html>
JavaScript Code :
$( "#btn1" ).click(function() {
$( "#box" ).animate({
width: "300px",
height: "300px",
}, 1500 );
});
$( "#btn2" ).click(function() {
$( "#box" ).animate({
width: "100px",
height: "100px",
}, 1500 );
});
القوائم الدراسية التي ينتمي لها السؤال
معلومات ذات صلة