最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

jQuery實(shí)現(xiàn)常見的隱藏與展示列表效果示例

 更新時(shí)間:2018年06月04日 14:24:47   作者:前端愛我  
這篇文章主要介紹了jQuery實(shí)現(xiàn)常見的隱藏與展示列表效果,結(jié)合完整實(shí)例形式分析了jQuery事件響應(yīng)及針對(duì)頁面元素屬性動(dòng)態(tài)操作相關(guān)實(shí)現(xiàn)技巧,需要的朋友可以參考下

本文實(shí)例講述了jQuery實(shí)現(xiàn)常見的隱藏與展示列表效果。分享給大家供大家參考,具體如下:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>m.fzitv.net jquery品牌列表效果</title>
<meta name="description" content="">
<meta name="keywords" content="">
<link href="" rel=" rel="external nofollow" stylesheet">
<style>
  *{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -moz-box-sizing: border-box;
  }
  body {
    font: 16px/20px "Microsoft yahei,'微軟雅黑'"
    color: #fff;
  }
  ul {
    list-style-type:none;
  }
  a {
    text-decoration: none;
    color: #000;
  }
  ul li {
    float: left;
    text-align: right;
  }
  .clear:before,.clear:after {
    content: "";
    clear: both;
    display: table;
    height: 0;
    overflow: hidden;
    zoom: 1;
  }
  .SubCategoryBox {
    width: 473px;
    margin: 0 auto;
    border: 1px solid;
  }
  .SubCategoryBox ul{
    padding: 5px 10px;
  }
  .SubCategoryBox ul li {
    padding: 5px;
  }
  .SubCategoryBox ul li:nth-child(3n-2) {
    width: 130px;
  }
  .SubCategoryBox ul li:nth-child(3n-1) {
    width: 161px;
    margin-right: 30px;
  }
  .SubCategoryBox ul li:nth-child(3n) {
    width: 130px;
  }
  .showmore {
    text-align: center;
  }
  .showmore a {
    background: #eef;
    color: #CFCFE0;
  }
  .hightlight a,.hightlight i {
    color: red;
    /* font-weight: bold; */
  }
</style>
</head>
<body>
    <div class="SubCategoryBox">
      <ul class="clear" id="bancon">
        <li><a href="javascript:" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >佳能</a><i>(30441)</i></li>
        <li><a href="javascript:" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >索尼</a><i>(30442)</i></li>
        <li><a href="javascript:" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >三星</a><i>(30443)</i></li>
        <li><a href="javascript:" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >尼康</a><i>(30444)</i></li>
        <li><a href="javascript:" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >松下</a><i>(30445)</i></li>
        <li><a href="javascript:" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >卡西歐</a><i>(30446)</i></li>
        <li><a href="javascript:" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >富士</a><i>(30447)</i></li>
        <li><a href="javascript:" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >柯達(dá)</a><i>(30448)</i></li>
        <li><a href="javascript:" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >賓得</a><i>(30449)</i></li>
        <li><a href="javascript:" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >理光</a><i>(30450)</i></li>
        <li><a href="javascript:" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >奧斯巴林</a><i>(30451)</i></li>
        <li><a href="javascript:" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >明基</a><i>(30452)</i></li>
        <li><a href="javascript:" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >愛國者</a><i>(30453)</i></li>
        <li><a href="javascript:" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >其他品牌相機(jī)</a><i>(30454)</i></li>
      </ul>
      <div class="showmore" id="showpp">
      <a href=""><span>顯示全部品牌</span></a>
      </div>
    </div>
   <script src="http://cdn.bootcss.com/jquery/2.1.0/jquery.js"></script>
   <script>
   $(function(){
    var $target=$("#bancon li:gt(5):not(:last)");
    $target.hide();
    var $toggleBtn=$("#showpp a");
    $toggleBtn.click(function(){
      if($target.is(":visible")){
      $target.hide();
      $(this).find("span").text("顯示所有品牌");
      $("ul li").removeClass('hightlight')
      }
      else {
        $target.show();
        $(this).find('span').text("精簡顯示品牌");
        $("ul li").filter(":contains('佳能'),:contains('尼康'),:contains('奧斯巴林')").addClass('hightlight')
      }
      return false;  /*阻止a標(biāo)簽的跳轉(zhuǎn)*/
    });
   });
   </script>
</body>
</html>

使用在線HTML/CSS/JavaScript代碼運(yùn)行工具 http://tools.jb51.net/code/HtmlJsRun測(cè)試效果如下:

更多關(guān)于jQuery相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《jQuery擴(kuò)展技巧總結(jié)》、《jQuery常用插件及用法總結(jié)》、《jQuery拖拽特效與技巧總結(jié)》、《jQuery表格(table)操作技巧匯總》、《jquery中Ajax用法總結(jié)》、《jQuery常見經(jīng)典特效匯總》、《jQuery動(dòng)畫與特效用法總結(jié)》及《jquery選擇器用法總結(jié)

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

相關(guān)文章

  • jQuery插件jquery-barcode實(shí)現(xiàn)條碼打印的方法

    jQuery插件jquery-barcode實(shí)現(xiàn)條碼打印的方法

    這篇文章主要介紹了jQuery插件jquery-barcode實(shí)現(xiàn)條碼打印的方法,結(jié)合實(shí)例形式較為詳細(xì)的分析了jQuery插件jquery-barcode的功能及打印條碼的實(shí)現(xiàn)技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下
    2015-11-11
  • 小巧強(qiáng)大的jquery layer彈窗彈層插件

    小巧強(qiáng)大的jquery layer彈窗彈層插件

    這篇文章主要介紹了小巧強(qiáng)大的jquery layer彈窗彈層插件的使用方法以及使用范圍,非常詳細(xì),有需要的小伙伴可以參考下。
    2015-12-12
  • jquery中l(wèi)oad方法的用法及注意事項(xiàng)說明

    jquery中l(wèi)oad方法的用法及注意事項(xiàng)說明

    本篇文章主要是對(duì)jquery中l(wèi)oad方法的用法及注意事項(xiàng)進(jìn)行了詳細(xì)介紹,需要的朋友可以過來參考下,希望對(duì)大家有所幫助
    2014-02-02
  • uploadify多文件上傳參數(shù)設(shè)置技巧

    uploadify多文件上傳參數(shù)設(shè)置技巧

    uploadify插件配置實(shí)用比較簡單,很多開發(fā)者都喜歡使用。但是它有個(gè)缺點(diǎn)就是剛加載的時(shí)候稍微慢了一秒左右,本文通過一段代碼實(shí)例給大家介紹uploadify多文件上傳參數(shù)設(shè)置技巧,朋友們一起學(xué)習(xí)吧
    2015-11-11
  • jQuery遍歷Table應(yīng)用示例

    jQuery遍歷Table應(yīng)用示例

    這篇文章主要介紹了jQuery遍歷Table的具體實(shí)現(xiàn),需要的朋友可以參考下
    2014-04-04
  • 使用Jquery操作Cookies

    使用Jquery操作Cookies

    這篇文章介紹了使用Jquery操作Cookies的方法,文中通過示例代碼介紹的非常詳細(xì)。對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2022-05-05
  • jQuery on方法傳遞參數(shù)示例

    jQuery on方法傳遞參數(shù)示例

    這篇文章主要介紹了jQuery on方法傳遞參數(shù)示例,本文給出了一個(gè)傳遞3個(gè)參數(shù)的例子,需要的朋友可以參考下
    2014-12-12
  • jQuery qrcode生成二維碼的方法

    jQuery qrcode生成二維碼的方法

    現(xiàn)在二維碼越來越流行,很多網(wǎng)頁都會(huì)有個(gè)二維碼,掃描后可通過手機(jī)瀏覽。jquery-qrcode是一個(gè)能夠在瀏覽器端生成二維碼的jquery插件,下面通過本文給大家介紹jQuery qrcode生成二維碼的方法,需要的朋友參考下
    2016-04-04
  • Jquery+ajax+JAVA(servlet)實(shí)現(xiàn)下拉菜單異步取值

    Jquery+ajax+JAVA(servlet)實(shí)現(xiàn)下拉菜單異步取值

    這篇文章主要介紹了Jquery+ajax+JAVA(servlet)實(shí)現(xiàn)下拉菜單異步取值的相關(guān)資料,需要的朋友可以參考下
    2016-03-03
  • jquery簡單瀑布流實(shí)現(xiàn)原理及ie8下測(cè)試代碼

    jquery簡單瀑布流實(shí)現(xiàn)原理及ie8下測(cè)試代碼

    可以將分頁獲取的內(nèi)容依次填入四個(gè)div中,瀑布流的分頁可以以多頁(比如5頁)為單位二次分頁,這樣可以減少后臺(tái)算法的復(fù)雜度;測(cè)試環(huán)境:ie8 ff13.0.1 chrome22有興趣的朋友可以了解下
    2013-01-01

最新評(píng)論

博客| 泉州市| 会东县| 朝阳市| 宕昌县| 始兴县| 靖州| 永丰县| 汽车| 白朗县| 阳原县| 延吉市| 塔城市| 吉木萨尔县| 二手房| 台中市| 千阳县| 南雄市| 罗江县| 广元市| 永州市| 大厂| 永登县| 呼伦贝尔市| 拜泉县| 寿阳县| 四川省| 辽中县| 正安县| 抚远县| 修水县| 上思县| 什邡市| 麦盖提县| 黄陵县| 依安县| 嘉兴市| 新乡市| 富锦市| 红河县| 靖江市|