简体   繁体   English

引导导航栏中的链接无效菜单项

[英]Links not working menu items in bootstrap navbar

I am fairly new to web development and the bootstrap framework. 我对Web开发和Bootstrap框架还很陌生。 What I simply want is that when I click on one of the options in the bootstrap navbar (specifically the team option) it should take me to that specific page. 我只想要的是,当我单击引导导航栏中的选项之一(特别是团队选项)时,它应该带我到该特定页面。 This is the only link I have in my menu that takes me to a different pages. 这是我菜单中唯一将我带到其他页面的链接。 All other links take to specific sections on the same page. 所有其他链接都指向同一页面上的特定部分。 在此处输入图片说明

When I open up the Console Window, I get the following error message - https://gyazo.com/001f90dc8207f99c8692946df9f49163 当打开控制台窗口时,出现以下错误消息-https://gyazo.com/001f90dc8207f99c8692946df9f49163

Here is the HTML Code : 这是HTML代码:

<nav class="navbar" data-spy="affix">
        <div class="container-fluid">
            <div class="container">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand" href="/"><img src="images/logo-navy.png"></a>
                </div>
                <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                    <ul class="nav navbar-nav navbar-right">
                        <li class="dropdown"><a href="#" data-toggle="dropdown" class="dropdown-toggle" target="_blank">Home<b class="caret"></b></a>
                        <ul class="dropdown-menu">
                            <li><a href="#about">About</a></li>
                            <li><a href="#partners">Partners</a><li>
                            <li><a href="#news">In the news</a><li>
                        </ul>
                        </li>
                        <!--<li><a href="/resources.php" target="_blank">Resources</a><li>-->
                        <li><a href="/team.php" data-target="/team.php" target="_blank">Team</a></li>
                        <li><a href="#contact">Contact</a></li>
                    </ul>
                </div>
            </div>
        </div>
    </nav>

Help would be appreciated. 帮助将不胜感激。

用此替换您的行并检查

<li><a href="team.php" data-target="team.php" target="_blank">Team</a></li>

Try removing 尝试移除

data-target="/team.php"

from the link. 从链接。 data-target, I believe, is Bootstrap using JQuery to look for an item on the page. 我相信数据目标是Bootstrap,它使用JQuery在页面上查找项目。 So JQuery is being called, but it isn't able to find /team.php. 因此,正在调用JQuery,但找不到/team.php。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM