日期:2014-05-16 浏览次数:20316 次
<!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> <style> dl{ width:200px; cursor:pointer; background:#f00} ul{ display:none; background:#fff} </style> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> </head> <body> <div id="menu"> <dl> <dt><s class="jia"></s><span><a href="#">AAAAA</a></span></span></dt> <ul style="display:block"> <li><a href="#">2222</a></li> <li><a href="#">3333</a></li> <li><a href="#">4444</a></li> </ul> </dl> <dl> <dt><s class="jia"></s><span><span><a href="#">BBBBB</a></span></span></dt> <ul> <li><a href="#">22222</a></li> <li><a href="#">33333</a></li> </ul> </dl> <dl> <dt><s class="jia"></s><span><span><a href="#">CCCCC</a></span></span></dt> <ul> <li><a href="#">22222</a></li> <li><a href="#">33333</a></li> </ul> </dl> </div> <script type="text/javascript"> $("#menu dl").click(function () { $(this).siblings().find("ul").slideUp(300); var text = $(this).children("ul"); if (text.is(':hidden')) { text.slideDown(300); } else { text.slideUp(300); } }); </script> </body> </html>