jquery 12 이미지 위치와 크기를 변경
프론트엔드/Jquery2021. 3. 18. 00:25

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="jquery-3.6.0.min.js"></script>
<script>
$(document).ready(function(){
$("button.move").click(function(){
$("img").animate( {
left: '300px',
height: '300px',
width: '350px'
});
});
$("button.init").click(function(){
$("img").animate( {
left: '0px',
height: '100px',
width: '130px'
});
});
});
</script>
</head>
<body>
<button class="move">확대</button>
<button class="init">축소</button>
<p></p>
<img name="pic1" src="https://t1.daumcdn.net/friends/prod/editor/dc8b3d02-a15a-4afa-a88b-989cf2a50476.jpg" width="130" height="100" style="position:relative"/>
</body>
</html>
'프론트엔드 > Jquery' 카테고리의 다른 글
Jquery 14 제이쿼리 코드 구조와 이벤트 처리 (0) | 2021.04.11 |
---|---|
Jquery 13 제이쿼리란? (0) | 2021.04.11 |
jquery 11 이미지크기를 픽셀 종류별로 변경 (0) | 2021.03.18 |
jquery 10 박스를 클릭하면 박스 크기와 색상이 변경 (0) | 2021.03.18 |
jquery 09 css() 메소드 (0) | 2021.03.18 |
댓글()