Blogger Information
Blog 43
fans 0
comment 0
visits 27002
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
下拉菜单+2018年9月27日
Lee的博客
Original
649 people have browsed it

编写一个标准的下拉菜单,要求对data-属性有较深的理解

实例

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="../../lib/bootstrap.css">
    <script src="../../lib/jquery.js"></script>
    <script src="../../lib/bootstrap.js"></script>
    <title>标准的下拉菜单</title>
</head>
<body>
<div class="container">
    <div class="row">
        <div class="col-md-8 col-md-offset-3">
            <div class="dropdown">
                <button type="button" class="btn btn-info" data-toggle="dropdown">
                    <span class="glyphicon glyphicon-menu-down" aria-hidden="true"></span>
                </button>
                <ul class="dropdown-menu">
                    <li><a href="">全部</a></li>
                    <li><a href="">未读</a></li>
                    <li><a href="">已读</a></li>
                    <li class="divider"></li>
                    <li><a href="">已回复</a></li>
                    <li><a href="">已转发</a></li>
                    <li><a href="">已星标</a></li>
                </ul>>
            </div>
        </div>
    </div>
</div>


</body>
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例


QQ截图20180927151401.png

使用按钮组编写一个分裂式下拉菜单,了解这类常用控件编写的基本思路

实例

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="../../lib/bootstrap.css">
    <script src="../../lib/jquery.js"></script>
    <script src="../../lib/bootstrap.js"></script>
    <title>分裂式下拉菜单</title>
</head>
<body>
<div class="container">
    <div class="row">
        <div class="col-md-8 col-md-offset-3">
            <div class="btn-group">
                <button class="btn btn-info">
                    <span class="glyphicon glyphicon-menu-down"></span>
                </button>
                <button class="btn btn-info dropdown-toggle" data-toggle="dropdown">
                    <span class="caret"></span>
                </button>
                <ul class="dropdown-menu">
                    <li><a href="">全部</a></li>
                    <li><a href="">未读</a></li>
                    <li><a href="">已读</a></li>
                    <li class="divider"></li>
                    <li><a href="">已回复</a></li>
                    <li><a href="">已转发</a></li>
                    <li><a href="">已星标</a></li>
                </ul>
            </div>
        </div>
    </div>
</div>

</body>
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例


QQ截图20180927151349.png


总结,按钮不困难

Correction status:Uncorrected

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post