JQuery/JQuery 기본
[JQuery] Window size 줄이면 메세지 띄우기
연찌현찌
2018. 8. 7. 11:00
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
</head>
<body>
<div id="q1">
<img alt="" src="photo4.jpg">
</div>
<script type="text/javascript">
$(function () {
$(window).resize(function () {
alert("window resize"); // window size 줄일떄 메세지 알려줌
$("#q1 img").css({
"width":"640",
"height":"480"
});
});
});
</script>
</body>
</html>