简体   繁体   English

Bootstrap 3.2下拉菜单切换在iPhone上不起作用

[英]Bootstrap 3.2 Dropdown Menu Toggle not working on iPhone

I have the below menu which I use Bootstrap 3.2. 我有下面的菜单,使用的是Bootstrap 3.2。 The menu + toggle button works great on any browsers on Android but iOS. 菜单+切换按钮在Android上的所有浏览器(iOS除外)上均可正常使用。

I can click on the button then the menu will show up & hide right away after showing. 我可以单击按钮,然后菜单将显示并在显示后立即隐藏。

I used a lot of work-around & fix, disable touchstart in bootstrap.js or changing z-index of navbar. 我使用了很多解决方法和修复方法,在bootstrap.js中禁用touchstart或更改navbar的z-index。 . . but it won't help me anyway with this problem. 但是无论如何这对我都没有帮助。

The menu seems to show up after click the toggle button but I can't see anything. 单击切换按钮后,菜单似乎显示出来,但是我什么也看不到。 I have to touch the toggle button again as closing the menu & touch again to open the menu again. 我必须在关闭菜单时再次触摸切换按钮,然后再次触摸以再次打开菜单。

You guy can have a check if you have iPhone at www.vietwash.vn 您可以在www.vietwash.vn上查看是否有iPhone。

Thank you for your concern about my problem. 感谢您对我的问题的关注。

<nav class="navbar navbar-default col-xs-12 col-sm-12 col-lg-12"
                    role="navigation">
                    <div class="navbar-header">
                        <button type="button" class="navbar-toggle" data-toggle="collapse"
                            data-target="#example-navbar-collapse">
                            <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="#"> <jdoc:include type="modules"  name="top-logo" style="xhtml" />
                        </a>
                    </div>
                    <div class="collapse navbar-collapse" id="example-navbar-collapse">
                        <ul class="nav navbar-nav">

                            <li id="home" class="active"><a href="<?php JUri::base();?>">Trang
                                    chủ</a></li>

                            <li id="intro" class="dropdown"><a href="#"
                                class="dropdown-toggle" data-toggle="dropdown"> Giới thiệu <b
                                    class="caret"></b>
                            </a>
                                <ul class="dropdown-menu">
                                    <li><a
                                        href="<?php echo JUri::base() . "index.php?option=com_content&view=article&id=1"?>">Về
                                            chúng tôi</a></li>

                                    <li><a
                                        href="<?php echo JUri::base() . "index.php?option=com_content&view=article&id=2"?>">Công
                                            nghệ Vietwash</a></li>

                                    <li><a
                                        href="<?php echo JUri::base() . "index.php?option=com_content&view=article&id=6"?>">Trải
                                            nghiệm phòng chờ</a></li>
                                </ul></li>
                            <li id="service"><a
                                href="<?php echo JUri::base() . "index.php?option=com_content&view=featured&Itemid=106"?>">Dịch
                                    vụ</a></li>
                            <li id="news"><a
                                href="<?php echo JUri::base() . "index.php?option=com_content&view=category&layout=blog&id=9&Itemid=105"?>">Tin
                                    tức</a></li>
                            <li id="contact"><a
                                href="<?php echo JUri::base() . "index.php?option=com_content&view=featured&Itemid=107"?>">Liên
                                    hệ</a></li>

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

I guess there is a problem in your CSS. 我想您的CSS中有问题。 Take a look at line 188 in your responsive.css . 要知道你自己看看行188 responsive.css There's @media only screen and (max-width: 480px) and (min-with: 321px) . @media only screen and (max-width: 480px) and (min-with: 321px)

Try to remove: 尝试删除:

position: absolute
top: 50px

Or replace it to position: static . 或将其替换为position: static

Additional remarks 补充说明

  • You're using col-xs-12 col-sm-12 col-lg-12 - rather use container-fluid 您正在使用col-xs-12 col-sm-12 col-lg-12而是使用container-fluid
  • When you use col-lg-8 bootstrap makes it full-width for elements smaller than screen-lg-min . 当您使用col-lg-8引导程序时,对于小于screen-lg-min元素,引导程序将col-lg-8全角。 So col-xs-12 col-sm-12 are obsolete. 所以col-xs-12 col-sm-12已过时。
  • You have some problem in footer. 页脚有问题。 Because of improper structure: .container > .row > .container again. 由于结构不正确, .container > .row > .container再次.container > .row > .container

Cheers mate! 队友的欢呼声! I hope it helps. 希望对您有所帮助。

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

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