• jquery学习菜单


    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="menu.aspx.cs" Inherits="jquerydemo.menu" %>

    <!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 runat="server">
        <title></title>
        <script src="jquery-1.4.2.js" type="text/javascript"></script>
        <style type="text/css">
            #menu
            {
                100px;
            }
            .has_children
            {
                background: #555;
                color: #fff;
                cursor:pointer;
            }
            .highlight
            {
                color: #fff;
                background: green;
            }
            div
            {
                padding:0px;
                margin:10px 0px;
            }
            div a
            {
                display: none;
                background: #888;
                float:left;
                100px;
            }
        </style>
    </head>
    <body>
        <form id="form1" runat="server">
        <div id="menu">
            <div class="has_children">
                <span>企业</span> <a href="www.baidu.com">0</a> <a>9</a> <a>8</a>
            </div>
            <div class="has_children">
                <span>产品</span> <a>1</a> <a>2</a> <a>3</a>
            </div>
            <div class="has_children">
                <span>公司</span> <a>4</a> <a>5</a> <a>6</a>
            </div>
        </div>
        <script type="text/javascript">
            $(".has_children").click(function () {
                $(this).addClass("highlight").children("a").show().end().siblings().removeClass("highlight").children("a").hide();
            });
        </script>
        </form>
    </body>
    </html>

    效果:

  • 相关阅读:
    CLRS2e读书笔记—Chapter10
    CLRS2e读书笔记—Chapter6
    CLRS2e读书笔记—Chapter34 & Appendix A,B
    CLRS2e读书笔记—Chapter8
    CLRS2e读书笔记—Chapter5 & Appendix C
    CLRS2e读书笔记—Chapter7
    Haskell学习笔记<三>
    屏幕一直亮的问题
    对CCLabelTTF进行自动换行,显示打字效果
    XCODE 4.2打包发布
  • 原文地址:https://www.cnblogs.com/zhanjun/p/2792352.html
Copyright © 2020-2023  润新知