<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("#flip").mouseover(function(){
$("#panel").slideDown("slow");
$("#panel2").slideUp("slow");
});
$("#flip2").mouseover(function(){
$("#panel2").slideDown("slow");
$("#panel").slideUp("slow");
});
});
</script>
<style>
#panel,#flip,#panel2,#flip2
{
padding:5px;
text-align:center;
background-color:#e5eecc;
border:solid 1px #c3c3c3;
width:200px;
}
#panel,#panel2
{
display:none;
width:200px;
}
</style>
</head>
<body>
<div id="flip">Click to slide down panel</div>
<div id="panel">Hello world!</div>
<div id="flip2">Click to slide down panel2</div>
<div id="panel2">Hello world!2</div>
</body>
</html>
http://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_slide_down
留言列表