문서의 이전 판입니다!
http://wldyd83.adminschool.net/jquery/hideshow.html
<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">
.whenAHover
{
color:Red;
background-color:Orange;
}
</style>
<script type="text/ecmascript" src=jquery-1.6.2.min.js></script>
<script type="text/ecmascript">
var isShow = true;
$(document).ready(function(){
$("a").hover(aHoverIn, aHoverOut);
$("h1").click(h1Click);
});
function h1Click(){
if(isShow == true){
$("ul").hide("slow");
isShow = false;
}else{
$("ul").show("slow");
isShow = true;
}
}
function aHoverIn(){
$(this).removeClass("whenAHover");
}
function aHoverOut(){
$(this).removeClass("whenAHover");
}
</script>
</head>
<body>
<h1><a href="#">Click It!</a></h1>
<ul>
<li><a href="#">MENU1</a></li>
<li><a href="#">MENU2</a></li>
<li><a href="#">MENU3</a></li>
<li><a href="#">MENU4</a></li>
</ul>
</body>
</html>