简体   繁体   English

Bootstrap导航菜单在Mobile View上不起作用

[英]Bootstrap Navigation Menu Not Working On Mobile View

With the help of some SO users, I was able to get part of my navigation question answered. 在某些SO用户的帮助下,我得以解答部分导航问题。 With putting a "display:none;" 加上“ display:none;” tag on my nav ID, the navigation menu collapsed when viewing for mobile. 标签标记在我的导航ID上,则在查看移动版时导航菜单会折叠。

The new issue is, after doing so I cannot open/close the navigation button in mobile view. 新的问题是,这样做之后,我无法在移动视图中打开/关闭导航按钮。 I have seen other SO questions explaining missing scripts and not labeling IDs properly. 我还看到了其他SO问题,这些问题解释了缺少的脚本并且未正确标记ID。 After looking my project over for about a week, I believe I do not have any of these issues. 在查看了大约一个星期的项目后,我相信我没有任何这些问题。

Can any Bootstrap programmers out there assist me? 那里的Bootstrap程序员可以帮助我吗? I believe it has something to do with the "display:none;" 我认为这与“ display:none;”有关。 tag on the nav ID. 导航ID上的标签。 Website link: www.thesunkenweb.com/loteksystems and HTML/CSS is below. 网站链接:www.thesunkenweb.com/loteksystems和HTML / CSS在下面。 I think the issue may be lay somewhere within the ".hidden" class on the main.css style page, as well the @767px media query on the responsive.css style page. 我认为问题可能出在main.css样式页面上的“ .hidden”类中,以及active.css样式页面上的@ 767px媒体查询中。 Both include the "display:none;". 两者都包含“ display:none;”。 Maybe they are eliminating each other? 也许他们正在互相淘汰? Many thanks! 非常感谢!

<!-- Start Header Section -->
<header class="main_menu_sec navbar navbar-default navbar-fixed-top">
<div class="container">
    <div class="row">
        <div class="col-lg-3 col-md-3 col-sm-12">
            <div class="lft_hd">
                <a href="index.html"><img src="http://www.thesunkenweb.com/loteksystems/img/LotekSystemsLogo_1.png" alt="Lotek Systems"/></a>
            </div>
        </div>          
        <div class="col-lg-9 col-md-9 col-sm-12">
            <div class="rgt_hd">                    
                <div class="main_menu">
                    <nav id="nav_menu">
                        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        </button>   
                    <!-- Collect the nav links, forms, and other content for toggling -->
                    <div class="collapse navbar-collapse" id="navbar">>
                        <ul>
                            <li><a class="page-scroll" href="index.html">Home</a></li> 
                            <li><a class="page-scroll" href="#abt_sec">About Us<i class="fa fa-angle-down"></i></a>
                                <ul>
                                    <li><a class="page-scroll" href="#tm_sec">Meet Andy</a></li>
                                    <li><a class="page-scroll" href="#tstm_sec">Testimonials</a></li>
                                    <li><a class="page-scroll" href="#clt_sec">Experience</a></li>
                                </ul>
                            </li>                       
                            <li><a class="page-scroll" href="#pr_sec">Services<i class="fa fa-angle-down"></i></a>
                                <ul>
                                    <li><a class="page-scroll" href="CustomCloudManagement.html">Custom Managed Cloud Hosting</a></li>
                                    <li><a class="page-scroll" href="CloudMigration.html">Cloud Migration</a></li>
                                    <li><a class="page-scroll" href="ApplicationManagement.html">Application Management</a></li>
                                    <li><a class="page-scroll" href="ComputerRepairs.html">Computer Repairs</a></li>
                                </ul>
                            </li>
                            <li><a class="page-scroll" href="#ctn_sec">Contact Us</a></li>
                        </ul>
                    </div>      
                    </nav>          
                </div>                          
            </div>
        </div>  
    </div>  
</div>  
 </header>
 <!-- End Header Section -->

On line 74 of responsive.css you have the following code: 在response.css的第74行,您具有以下代码:

@media (max-width: 767px)        
    #navbar {
        display: none;
    }
}

And that is stopping Bootstrap's toggle functionality to show and hide your navigation. 这样就停止了Bootstrap的切换功能来显示和隐藏导航。 If you remove that code the navigation will work correctly. 如果删除该代码,导航将正常工作。

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

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