<div class="codetitle"> <span><a style="CURSOR: pointer" data="26069" class="copybut" id="copybut26069" onclick="doCopy('code26069')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code26069"> <br> <br> <br> <br><title>jQuery事件的连接</title> <br><style type="text/css"> <BR>.divFrame{ width:260px; border:1px solid #666; font-size:10px } <BR>.divTitle{ background-color:#eee; padding:5px} <BR>.divContent{ padding:5px; display:none} <BR>.divCurrColor{ background-color:Red} <BR></style> <br><script src="jquery-1.9.1.js" type="text/javascript"></script> <br><script type="text/javascript"> <BR>$(function(){ <BR>$('.divTitle').click(function () { <BR>$('.divTitle').addClass('divCurrColor') <BR>.next('.divContent').css('display','block') <BR>}) <BR>}) <BR></script> <br> <br> <br><div class="divFrame"> <br><div class="divTitle">主题</div> <br><div class="divContent"> <br><a href="%E5%9B%BE%E7%89%87%E8%AE%BE%E7%BD%AE.htm">图片设置</a><br> <br><a href="%E5%B1%95%E5%BC%80%E5%9B%BE%E7%89%87%E5%92%8C%E6%94%B6%E7%BC%A9%E5%9B%BE%E7%89%87.htm">展开图片和收缩图片</a><br> <br> </div> <br> </div> <br> <br> <br> </div> <br>实现以下效果 <br><img src="http://files.jb51.net/file_images/article/201306/201306181720332.gif?201351817211" alt="Jquery事件的连接使用示例_jquery" > <br>点击它,会显示如下效果 <br><img src="http://files.jb51.net/file_images/article/201306/201306181721193.gif?2013518172132" alt="Jquery事件的连接使用示例_jquery" >