Thứ Hai, 4 tháng 8, 2014

Jquery tab nhanh gọn lẹ

  <head>
       $(document).ready(function(){                
                $('#tab_preview a').click(function (e) {
                      e.preventDefault();
                      $(this).tab('show');
                  })
            });
</head>

 <div class="tabs-pad">
              <ul class="nav nav-tabs" id="tab_preview">
                <li class="active"><a href="#section_1">our mission</a></li>
                <li><a href="#section_2">Why Choose Us</a></li>
                <li><a href="#section_3">how-to</a></li>
              </ul>
    </div> 
            <div class="tab-content">
              <!--tab section_1-->
              <div class="tab-pane active" id="section_1">
                       ++ nội dung ++           
              </div>
        
              <!--tab section_2-->
              <div class="tab-pane" id="section_2">
                    ++ nội dung ++  
              </div>           
              <!--tab section_3-->
              <div class="tab-pane" id="section_3">
                   ++ nội dung ++  
              </div>

#-------------------------------------------------------#
$('#tab_preview a').click(function (e) {
            e.preventDefault();
            $(this).tab('show');
            $(".cccc >div>div.tab-pane").removeClass('active');
                $(".cccc >div.tab-pane").removeClass('active');
                $(".bbbb li.active").removeClass('active')
        });

########### css

.tintuc-title > a {
    font-size: 24px;
}

.tintuc-fieldtext:first-child{
    border-bottom: none;
}
.tintuc-title > a:hover{
    color:red;
}
.menu-tab {
    padding: 0 8px;
}
.menu-tab > ul > li {
    float: none;
}
.menu-tab ul > li > a {
    border: medium none !important;
}
.menu-tab ul > li > a:hover{
    background: none !important;
}
.aaaa {
    border-right: 1px solid #ccc;
    float: left;
    width: 200px;
}
.bbbb {
    padding-left: 10px;
    float: left;
    width: 230px;

}
.nav.nav-tabs {
    border-bottom: medium none;
}
.trogiup-title {
    font-size: 34px;
    font-weight: bold;
    margin-bottom: 26px;
}
.cccc {
    float: left;
    text-align: justify;
    width: 280px;
    border-left: 1px solid #ccc;
    padding-left: 20px;
}
.tab-content_2 > .active{
    display: block !important;
}
.tab-content_2 > .tab-pane{
    display: none;
}
#tab_preview_2 li {
    float: none;
}

Không có nhận xét nào:

Đăng nhận xét