zoukankan      html  css  js  c++  java
  • jquery的几个小例子

    <%@ page language="java" contentType="text/html; charset=utf-8"
        pageEncoding="utf-8"%>
    <html>
    <head>
    <script type="text/javascript" src="jQuery.js"></script>
    </head>
    <title>
    </title>
        <style type="text/css">
            #menu {width:300px;}
            .hasChildren {background:#555;color:#fff;sursor:pointer;}
            .hightLight  {color: #fff; background:green;}
            div{padding:0;margin:10px 0;}
            div a{background:#888;display:none;float:left;width:300px;}
        </style>
    <body>
        <script type="text/javascript">
        $(document).ready(
           function(){
            $(".hasChildren").click(
                function()
                {
                    $(this).addClass("hightLight");
                    $(this).children("a").show();
                    $(this).siblings().removeClass("hightLight");
                    $(this).siblings().children("a").hide();
                }
             );  
        });
        </script>
        <div id="menu">
            <div class="hasChildren">
                <span>第一章</span>
                <a>---第一节</a>
                <a>---第二节</a>
            </div>
            <div class="hasChildren">
                <span>第二章</span>
                <a>---第一节</a>
                <a>---第二节</a>
            </div>
        </div>
    </body>
    </html>
  • 相关阅读:
    rzc generate exited with code -2147450730.
    c#WebService动态调用
    c#BarTender打印,打印微调
    记一次ios下h5页面图片显示问题
    FID
    RSA密钥对生成,并解析公钥指数和模数
    angularjs-6
    angularjs-5
    angularjs-4
    angularjs-4
  • 原文地址:https://www.cnblogs.com/unixshell/p/3303189.html
Copyright © 2011-2022 走看看