bootstrap导航栏下拉菜单

时间:2015-07-18 05:42:00

标签: twitter-bootstrap navigation

我正在为我的网站制作一个导航栏,但它似乎不起作用。 当我点击我制作了一个下拉菜单的产品标签时,它就像一个死链接,并将我带到index.php#。请帮忙。我正在附加标记:

imageView.animationDuration = 2 // Seconds
imageView.startAnimating()

4 个答案:

答案 0 :(得分:0)

你是否包含了bootstrap的链接

and add jquery and script at bottom wid jquery above javascript
<!-- Latest compiled and minified CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">

    <!-- Optional theme -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">




<!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    <script src="../../dist/js/bootstrap.min.js"></script>
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>

    <!-- Latest compiled and minified JavaScript -->
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>

答案 1 :(得分:0)

我打破了我的网站的temlate,所以我将无法显示整个网站的HTML代码,但这里是模板。

<!DOCTYPE html>
<html lang="en">
<?php include'includes/head.php'; ?>
<body>
<div id="wrapper" class="container-fluid">
<a style="float:right;margin-right:30px;margin-top:50px;font-size:20px;" href="cart.php?view">View Cart</a>
<div class="logo">
    <p><a class="logo" href="index.php">PURPLE CANDY</a></p>
</div>

<?php include 'includes/menu.php'; ?>

答案 2 :(得分:0)

<!DOCTYPE html>
<html>
<head>
    <title></title>
</head>
<body>
<meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- Latest compiled and minified CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">

    <!-- Optional theme -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">


<nav class="navbar navbar-default" >
        <div class="container-fluid">
           <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> 
            <ul class="nav navbar-nav">
                <li class="active"><a href="index.php" >HOME</a></li>
                <li><a href="#">CONTACT US</a></li>


                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">PRODUCTS <span class="caret"></span></a>

                    <ul class="dropdown-menu">
                            <li><a href="boys.php">BOYS</a></li>
                            <li><a href="girls.php">GIRLS</a></li>
                    </ul>

                </li>
            </ul>
            </div>
        </div>    
    </nav>



<!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    <script src="../../dist/js/bootstrap.min.js"></script>
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>

    <!-- Latest compiled and minified JavaScript -->
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</body>
</html>

enter image description here

答案 3 :(得分:0)

LOL!

当我单独运行它时,它也适用于我,但它不能在我的网站上运行。

它只是表现为死链接。enter image description here