<!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>无标题文档</title>
<script src="../jquery-1.8.3.js"></script>
<script>
$(function(){
$("div").hover(
function(){$(this).addClass("over");},
function(){$(this).removeClass("over")}
);
$("div>p").toggle(
function(){
$(this).next().toggle(function(){alert("a");},function(){alert("b");});
},
function(){
$(this).next().toggle(function(){alert("c");},function(){alert("d");});
}
);
});
</script>
<style>
div p{
color:green;
}
.over{
background-color:#C9F;
}
img{
width:10px;
height:10px;
}
div.h{
display:none;
}
div.h1{
display:block;
}
</style>
</head>
<body>
<div><p><img src="1.jpg"/>1</p><div class="h">AAAAAA</div></div>
<div><p><img src="1.jpg"/>2</p><div class="h">BBBBBB</div></div>
<div><p><img src="1.jpg"/>3</p><div class="h">CCCCCC</div></div>
<div><input type="button" onclick="show()"/></div>
</body>
</html>
为什么我点击标签的时候没有弹出a,b,c,d