html :
<p>hello</p><p style="display: none">hello again</p>
jquery :
$("p").toggle()
//$("p").show()
//$("p").hide()
:<p tyle="display: none">hello</p><p style="display: block">hello again</p>
<script language="网页特效">
$("a[title='nav']").click(function(){
for(i=0;i<$("a[title='nav']").size();i++)
{
if($(this).attr("id")!=$("a[title='nav']").eq(i).attr("id"))
$("a[title='nav']").eq(i).removeclass("hover");
else
$("a[title='nav']").eq(i).addclass("hover");
}
});
</script>
<a href="#" id="nav1" title="nav" class="hover" onfocus="this.blur();">nav1</a>
<a href="#" id="nav2" title="nav" onfocus="this.blur();">nav2</a>
<a href="#" id="nav3" title="nav" onfocus="this.blur();">nav3</a>
<a href="#" id="nav4" title="nav" onfocus="this.blur();">nav4</a><h2 class="thand"><span></span><a href="#">open</a></h2>
<div class="infobox">
<dl>
<dt><img src="../images/index_bg1.gif" name="logo" id="logo" width="300"/></dt>
<dd></dd>
</dl>
</div>
<script language="javascript">
$(".thand").click(function(){
$(this).next().css教程("display",$(this).next().css("display")=="block" ? "none":"block");
});
</script>
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.111cn.net/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title></title>
<script src="js/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
$(".adlink").hover(function(){
$(".my_link").click();
var div = $(".adlink").offset();
var mytop = div.top + $(".adlink").height()-2;
$(".my_link").css({top:mytop,left:div.left+5});
$(".my_link").fadein("slow");
},function(){});
$(".adlink").mouseo教程ut(function(){
if(document.activeelement==$(".my_link")) {
$(".my_link").css({display:"block"});
}else{
$(".my_link").css({display:"none"});
}
});
$(".my_link").hover(function(){
$(".my_link").css({display:"block"});
},function(){
$(".my_link").fadeout("slow");
});
});
</script>
</head>
<body>
<div class="adlink" id="adlink" style="background-color:#333333">1111111</div>
<div class="my_link" style="background-color:#999999; width:200px; position:absolute;">
<ul>
<li></li>
<li></li>
</ul>
</div>
</body>
</html>