欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

jquery實(shí)現(xiàn)點(diǎn)擊展開(kāi)列表同時(shí)隱藏其他列表

 更新時(shí)間:2015年08月10日 16:47:20   作者:企鵝  
這篇文章主要介紹了jquery實(shí)現(xiàn)點(diǎn)擊展開(kāi)列表同時(shí)隱藏其他列表的方法,涉及jquery鼠標(biāo)事件及節(jié)點(diǎn)的遍歷與屬性操作技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下

本文實(shí)例講述了jquery實(shí)現(xiàn)點(diǎn)擊展開(kāi)列表同時(shí)隱藏其他列表。分享給大家供大家參考。具體如下:

這里使用jquery實(shí)現(xiàn)展開(kāi)、隱藏特效,點(diǎn)擊列表標(biāo)題后該項(xiàng)內(nèi)容展開(kāi),其它項(xiàng)收縮起來(lái),也就是不顯示了。個(gè)人喜好了,有的喜歡在默認(rèn)狀態(tài)下不顯示其它選項(xiàng)的內(nèi)容,這個(gè)就是這種情況,僅供參考吧。

運(yùn)行效果截圖如下:

具體代碼如下:

<!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>js點(diǎn)擊展開(kāi)列表</title>
<script type="text/javascript" src="jquery-1.6.2.min.js"></script>
</head>
<script type="text/javascript">
// 收縮展開(kāi)效果
$(document).ready(function(){
$('.box').click(function(){
$(this).children('.text').slideToggle().parents('.box').siblings('.box').children('.text').hide();
})  
});
</script>
<style type="text/css">
.box{width:200px; margin:0 auto; background:#CCC;}
.text{display:none;}
</style>
<body>
<div class="box">
  <h2>對(duì)ASP擅長(zhǎng)的程序</h2>
  <div class="text">論壇類和文章類</div>
  </div>
</div>
<div class="box">
  <h2>對(duì)PHP擅長(zhǎng)的程序</h2>
  <div class="text">博客類和新聞?lì)?lt;/div>
  </div>
</div>
<div class="box">
  <h2>對(duì)前端擅長(zhǎng)的插件</h2>
  <div class="text">jquery</div>
  </div>
</div>
</body>
</html>

希望本文所述對(duì)大家的jquery程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論