• jquery tab 选项卡 狼


    jquery选项卡,带css样式的。支持ajax更新内容、页面同时出现多个tab选项卡而不影响其他选项卡内容。  
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 
    <html> 
      <head> 
        <title>jquery tab 选项卡</title> 
          
        <meta http-equiv="author" content="hoojo"> 
        <meta http-equiv="description" content="this is my page"> 
        <meta http-equiv="content-type" content="text/html; charset=UTF-8"> 
        <script type="text/javascript" src="jquery.js"></script> 
        <style type="text/css"> 
            .tab {  
                background-color: mintcream;  
                200px;  
                - 205px;  
                height: 200px;  
                margin-left: 200px;   
            }  
              
            .header {  
                height: 20px;  
                100%;  
            }  
              
            .content {  
                border: 1px solid #CCCCFF;  
                border-top: none;  
                height: 180px;  
            }  
              
            .liStyle {  
                cursor: pointer;  
                height: 20px;  
                66px;  
                - 61px;  
                float: left;              
                background-color: white;  
            }  
              
            .show {  
                background-color: mintcream;  
                border: 1px solid #CCCCFF;  
                border-bottom: none;  
            }  
              
            .hide {  
                background-color: white;  
                border-bottom: 1px solid #CCCCFF;  
            }  
              
            .ulHide {  
                display: none;  
            }  
              
            .ulShow {  
                display: block;  
            }  
              
            ul {  
                list-style: none outside none;  
            }  
              
            * {  
                margin: 0;  
                padding: 0;  
            }  
        </style> 
          
        <script type="text/javascript"> 
            $(function () {           
                $(".tab > ul.header > li").click(function () {  
                    $(this).parent().find("li.show").addClass("hide").removeClass("show");  
                    $(this).addClass("show").removeClass("hide");  
                    var parentsEl = $(this).parents(".tab");  
                    parentsEl.find("div > ul.ulShow").addClass("ulHide").removeClass("ulShow");  
                    /*页面静态内容*/  
                    var ary = parentsEl.find("ul.header > li");  
                    parentsEl.find("div > ul:eq(" + $.inArray(this, ary) + ")").addClass("ulShow").removeClass("ulHide");      
                    /*用ajax动态加载内容  
                    parentsEl.find("div > ul:eq(" + $.inArray(this, ary) + ")").addClass(function () {  
                        var el = this;  
                        $.post("TreeDataServlet", {param: "params"}, function (data) {  
                            $(el).html(data);  
                        });  
                        return "ulShow";  
                    }).removeClass("ulHide");*/       
                })  
            });  
        </script> 
      </head> 
        
      <body bgcolor="white"> 
       <div class="tab"> 
            <ul class="header"> 
                <li class="liStyle show">Java</li> 
                <li class="liStyle hide">Spring</li> 
                <li class="liStyle hide">Hibernate</li> 
            </ul> 
            <div class="content"> 
                <ul class="ulShow"> 
                    Java  
                    <li>java javaSE</li> 
                    <li>java javaME</li> 
                    <li>java javaEE</li> 
                </ul> 
                <ul class="ulHide"> 
                    Spring  
                    <li>java springMVC</li> 
                    <li>java spring aop</li> 
                    <li>java spring Ioc DI</li> 
                </ul> 
                <ul class="ulHide"> 
                    Hibernate  
                    <li>java Hibernate Configuration Transaction</li> 
                    <li>java Hibernate Query Criteria</li> 
                    <li>java Hibernate Session SessionFactory</li> 
                </ul> 
            </div> 
        </div> 
        <hr/> 
        <div class="tab"> 
            <ul class="header"> 
                <li class="liStyle show">Java</li> 
                <li class="liStyle hide">Spring</li> 
                <li class="liStyle hide">Hibernate</li> 
            </ul> 
            <div class="content"> 
                <ul class="ulShow"> 
                    Java....  
                    <li>java javaSE</li> 
                    <li>java javaME</li> 
                    <li>java javaEE</li> 
                </ul> 
                <ul class="ulHide"> 
                    Spring....  
                    <li>java springMVC</li> 
                    <li>java spring aop</li> 
                    <li>java spring Ioc DI</li> 
                </ul> 
                <ul class="ulHide"> 
                    Hibernate....  
                    <li>java Hibernate Configuration Transaction</li> 
                    <li>java Hibernate Query Criteria</li> 
                    <li>java Hibernate Session SessionFactory</li> 
                </ul> 
            </div> 
        </div> 
      </body> 
    </html>
  • 相关阅读:
    Clojure实现的简单短网址服务(Compojure、Ring、Korma库演示样例)
    android4.4系统解决“ERRORcouldn&#39;t find native method”方法
    JS window.open()属性
    网页视频播放器代码大全 + 21个为您的站点和博客提供的免费视频播放器
    理解Java的GC日志
    图像识别技术
    堆排序原理及算法实现(最大堆)
    什么是依赖注入
    Cocos2d-x3.1下实现相似iOS页面滑动指示圆点
    [Bootstrap] 6. Navigation
  • 原文地址:https://www.cnblogs.com/gowhy/p/2077787.html
Copyright © 2020-2023  润新知