클릭하면 div fadeIn을 만들려고합니다.이 div 내에 중첩 된 div가 클릭되면 초기 div fadesOut가 클릭됩니다. 그것은 jQuery의 fadeOut 부분에 올 때까지 잘 작동합니다. 처음에는 사라졌지만 반환됩니다.jQuery fadeOut 애니메이트 후 돌아 가기
을 heres HTML
<html>
<head>
<title>Kapow!</title>
<link rel='stylesheet' type='text/css' href='stylesheet.css'/>
<script type='text/javascript' src='script.js'></script>
</head>
<body>
<div class = "box">
<div class = "boxinfo">
<div class = "exit"></div>
</div>
</div>
</body>
</html>
CSS의 :
.box {
height: 100px;
width: 100px;
background: yellow;
margin: auto;
text-align: center;
}
.boxinfo {
height: 300px;
display: none;
width: 200px;
background: green;
margin: auto;
}
.exit {
height: 25px;
width: 25px;
background: red;
margin-top: 50px;
float: right;
}
그리고 jQuery를 : 중첩 된 요소의 데모
$(document).ready(function(){
$('.box').click(function(){
$('.boxinfo').fadeIn();
});
});
$(document).ready(function(){
$('.exit').click(function(){
$('.boxinfo').fadeOut('slow');
$('.exit').fadeOut('slow');
});
});
http://codepen.io/anon/pen/xujyb
codepen 코드에 js가 없습니다. –