问题HTML scrollspy不显示

时间:2018-06-25 07:57:56

标签: html twitter-bootstrap scrollspy

我正在根据创建在线CV进行Bootstrap项目,但遇到<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <html> <head> </head> <body> <ul> <li>General<span class="submenu"></span></li> <li>Extra<span class="submenu"></span></li> <li>Sport<span class="submenu"></span> <ul> <li> Volleyball </li> <li> Football </li> </ul> </li> </ul> </body> </html>问题。它不会显示scrollspy,但一切似乎都很好。

如您在我的HTML代码中所见:

scrollspy

我有不同的部分:

<!DOCTYPE html>
<html lang="fr">
<head>
    <title>CV </title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta charset="utf-8">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
    <link rel="stylesheet" type="text/css" href="css/navbar.css">
    <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Lato">
    <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Oswald" />
</head>

<body data-spy="scroll" data-target=".navbar" data-offset="100">

    <nav class="navbar navbar-inverse navbar-fixed-top">
        <div class="container">

            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>                        
                </button>
            </div>

            <div id="maNavbar" class="collapse navbar-collapse">
                <ul class="nav navbar-nav">
                    <li> <a href="#profil"> PROFIL </a></li>
                    <li> <a href="#competences"> COMPÉTENCES </a></li>
                    <li> <a href="#"> FORMATIONS </a></li>
                    <li> <a href="#"> EXPÉRIENCES PROFESSIONNELLES </a></li>
                    <li> <a href="#"> CONTACT </a></li>
                </ul>
            </div>
        </div>  
    </nav>

我想念我的代码吗?我必须添加其他file.js吗?

谢谢!

0 个答案:

没有答案