<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd“>
<html xmlns=”http://www.w3.org/1999/xhtml“>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<title>jquery的合成事件toggle</title>
</head>
<body>
<script type=”text/javascript” src=”jquery-1.8.0.js”></script>
<script type=”text/javascript”>
$(function(){
$(“#panel h5.head”).toggle(function(){
$(this).next(“div.content”).show();
},function(){
$(this).next(“div.content”).hide();
})
})
</script>
<div id=”panel”>
<h5 style=”cursor:hand;”>什么是jQuery?</h5>
<div style=”display:none;”>jQuery是继Prototype之后又一个优秀的JavaScript库!</div>
</div>
</body>
</html>