带有下拉菜单的Bootstrap移动菜单不起作用

时间:2015-04-18 05:45:23

标签: javascript jquery html css twitter-bootstrap

当我访问该网站的移动版本时,"系统"下拉菜单在进入systems.html之前闪烁。我希望用户在点击"系统"时可以看到下拉菜单。链接和访问systems.html页面的另一种方式。

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="description" content="">
<meta name="author" content="">

<title>Health Water Systems - Premium Hydration For Your Health</title>

<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">

<!-- Navigation -->
<nav class="navbar navbar-custom navbar-fixed-top" role="navigation">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-main-collapse">
                <i class="fa fa-bars"></i>
            </button>
            <a class="navbar-brand page-scroll" href="index.html">
               <img src="img/logo.jpg" width="150">
            </a>
        </div>
        <div class="collapse navbar-collapse navbar-right navbar-main-collapse">
            <ul class="nav navbar-nav">
                    <a href="index.html"></a>
                <li class="hidden">
                </li>
                <li>
                    <a href="systems.html">Systems</a>
                        <ul class="sub-menu">
                            <li><a href="brochures/ION-100.pdf" target="_blank">Ion-100</a></li>
                            <li><a href="brochures/ION-400-dual.pdf" target="_blank">Ion-400</a></li>
                            <li><a href="brochures/M600-BVA-dual.pdf" target="_blank">M600-BVA</a></li>                                
                        </ul>
                </li>
                <li>
                    <a href="whyalkalineh2o.html">Why Alkaline H20</a>
                </li>
                <li>
                    <a href="enhancedhydration.html">Enhanced Hydration</a>
                </li>
                <li>
                    <a href="environmental.html">Environmental</a>
                </li>
                <li>
                    <a href="contact.html">Contact</a>
                </li>
            </ul>
        </div>
    </div>
</nav>

<!-- Home -->
<header class="intro">
    <div class="intro-body">
        <div class="container">
            <div class="row">
                <div class="col-md-12 col-md-offset-0 homelogo">
                    <p align="left"><img src="img/logo.jpg" class="img-responsive" width="600"></p>
                    <p align="text-center" style="color:black;"><i>ALKALINE WATER AT YOUR FINGERTIPS &reg;</i></p>
                </div>
                <div class="col-md-12 col-md-offset-0 homewater">
                    <img src="img/watersplash.jpg" class="img-responsive" width="450">
                </div>
                <div class="col-md-12 col-md-offset-0">
                    <ul class="photo-button">
                        <li>
                            <a href="systems.html">
                                <figure>
                                    <img src="img/purifiedalkalinewater.jpg" class="img-responive">
                                        <figcaption><p>Purified Alkaline Water</p></figcaption>
                                </figure>
                            </a>
                        </li>
                        <li>
                            <a href="environmental.html">
                                <figure>
                                    <img src="img/environmentalfriendly.jpg">
                                    <figcaption><p>Environmental Friendly</p></figcaption>
                                </figure>                                    
                            </a>
                        </li>
                        <li>
                            <a href="enhancedhydration.html">
                                <figure>
                                    <img src="img/superiorhydration.jpg">
                                    <figcaption><p>Superior Hydration</p></figcaption>
                                </figure>                                    
                            </a>
                        </li>
                        <li>
                            <a href="whyalkalineh2o.html">
                                <figure>
                                    <img src="img/alkalinewaterbenefits.jpg" class="img-responive">
                                    <figcaption><p>Alkaline Water Benefits</p></figcaption>
                                </figure>
                            </a>
                        </li>
                    </ul>
                    <ul class="mphoto-button" style="padding-top:20px;">
                        <li>
                            <a href="systems.html">
                                <figure>
                                    <img src="img/purifiedalkalinewater.jpg" class="img-responive">
                                        <figcaption><p>Purified Alkaline Water</p></figcaption>
                                </figure>
                            </a>
                        </li>
                        <li>
                            <a href="environmental.html">
                                <figure>
                                    <img src="img/environmentalfriendly.jpg">
                                    <figcaption><p>Environmental Friendly</p></figcaption>
                                </figure>                                    
                            </a>
                        </li>
                        <li>
                            <a href="enhancedhydration.html">
                                <figure>
                                    <img src="img/superiorhydration.jpg">
                                    <figcaption><p>Superior Hydration</p></figcaption>
                                </figure>                                    
                            </a>
                        </li>
                        <li>
                            <a href="whyalkalineh2o.html">
                                <figure>
                                    <img src="img/alkalinewaterbenefits.jpg" class="img-responive">
                                    <figcaption><p>Alkaline Water Benefits</p></figcaption>
                                </figure>
                            </a>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</header>
<!-- Footer -->
<footer>
    <div class="container text-center">
        <p>Copyright &copy; 2015 Health Water Systems LLC.</p>
    </div>
</footer>


<script src="js/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.easing.min.js"></script>
<script src="js/style.js"></script>
<script src="js/jqBootstrapValidation.js"></script>
<script src="js/contact_me.js"></script>

1 个答案:

答案 0 :(得分:0)

要创建下拉菜单,您必须将班级dropdown添加到sub-menu

的父li

这是一个示例代码

<li class="dropdown">
    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Systems<span class="caret"></span></a>
    <ul class="dropdown-menu">
        <li><a href="brochures/ION-100.pdf" target="_blank">Ion-100</a></li>
        <li><a href="brochures/ION-400-dual.pdf" target="_blank">Ion-400</a></li>
        <li><a href="brochures/M600-BVA-dual.pdf" target="_blank">M600-BVA</a></li>                                
   </ul>
</li>

以下是BS文档的链接 [link 1link 2]