버튼을 클릭하면 background-color
및 크기가 변경되는 CSS 전환을 시작하려고합니다. 그러나 코드에서 실수가 :JS를 통한 CSS 전환 시작 작동하지 않습니다.
jQuery를이
$(function() {
$('#change').click(function() {
$('#box').addClass('change');
});
});
HTML
<div id="box" class="start"></div>
<div id="button">click</div>
CSS
.start{
height:100px;
width:100px;
background: black;
transition: all 2.0s linear;
-webkit-transition: all 0.8s linear;
-moz-transition: all 0.8s linear;
-ms-transition: all 0.8s linear;
-o-transition: all 0.8s linear;
}
.change{
width: 200px;
height: 200px;
background:yellow;
}
#button{
width: 80px;
height: 20px;
padding: 4px;
margin: 5px;
border:solid 1px black;
background: grey;
cursor: pointer;
color: white;
}
당신이 아이디 # 발생에 요소가없는)) –