버튼을 한 번 클릭 한 다음 두 번째 시간을 닫으면 열리는 간단한 메뉴를 만들려고합니다. 이전에이 작업을 수행했지만 지금은 수행 방법을 기억할 수 없습니다. , JQuery와 올바른 열기 및 닫기 메뉴 jQuery
var main = function(){
\t $('#menuopen').click(function(){
\t \t $('.leftbox').show();
\t \t $('.leftbox').animate({left: "0"});
\t \t $('.topbox').animate({left: "15%", width: "85%"});
\t },
\t function(){
\t \t $('.leftbox').animate({left: "-15%"});
\t \t $('.leftbox').hide();
\t \t $('.topbox').animate({left: "0", width: "100%"});
\t }
\t);
}
$(document).ready(main);
body {
\t background-color: #CCCCCC;
}
h2{
\t text-align: center;
\t font-family: 'Lato', sans-serif;
}
.topbox{
\t position: absolute;
\t top: 0%;
\t left: 0%;
\t width: 100%;
\t height: 10%;
\t background-color: #006699;
}
.leftbox{
\t display: none;
\t position: absolute;
\t background-color: #FFFFFF;
\t top: 0px;
\t left: -15%;
\t width: 15%;
\t height: 100%;
\t box-shadow: 10px 67px 5px #888888;
}
#commentbox{
\t position: absolute;
\t top: 87%;
\t left: 30%;
\t width: 50%;
\t resize: none;
\t border-radius: 5px;
\t outline: none;
\t box-shadow: 10px 10px 10px #888888;
}
#submitbox{
\t position: absolute;
\t background-color: #006699;
\t left: 82%;
\t top: 87%;
\t height: 66px;
\t width: 132px;
\t border-radius: 5px;
\t border: 0px;
\t outline: none;
\t box-shadow: 10px 10px 10px #888888;
\t font-family: 'Lato', sans-serif;
\t font-weight:;
}
#menuopen{
\t position: absolute;
\t top: 25%;
\t left: 15px;
\t height: 32px;
\t width: 32px;
}
<!DOCTYPE html>
<html>
<head>
<link href='http://fonts.googleapis.com/css?family=Lato' rel='stylesheet' type='text/css'>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script type="text/javascript" src="script.js"></script>
<link rel="stylesheet" href="style.css"> \t
\t </head>
<body>
\t <div class="topbox">
\t \t <h2> Name's Lobby </h2>
\t \t <img id="menuopen" src="menu_icon.png"/>
\t </div>
\t <div class="leftbox">
\t </div>
\t <div class="inputbox">
\t \t <textarea placeholder="Enter your comment!" id="commentbox" rows="4" cols="50"></textarea>
\t \t <input id="submitbox" type="submit" value="Submit">
\t </div>
\t </body>
</html>
이 코드로 잘못 여기에 무엇되지 않은 : 여기에이 코드인가? : O
http://stackoverflow.com/questions/17618910/ 전환-AN-애니메이션 -에 - JQuery와 –