Bootstrap navBar重叠模态淡入淡出

时间:2015-11-13 12:14:07

标签: css twitter-bootstrap laravel twitter-bootstrap-3 bootstrap-modal

我有一个来自bootstrap的导航栏,我把它固定在顶部,当我到达一个模态淡入淡出窗口重叠并且不让我点击任何东西时出现问题,我让代码在这里:

<!-- Navigation bar-->
    <nav class="navbar navbar-inverse navbar-fixed-top">
        <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->
        <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="{!!URL::to('/')!!}">SCM</a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
                <li><a href="{!!URL::to('/')!!}">Home <span class="sr-only">(current)</span></a></li>
                <li><a href="#">Contacto</a></li>
                <li><a href="#"><i class="fa fa-calendar fa-fw"></i> Horarios</a></li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        <li><a href="#">Action</a></li>
                        <li><a href="#">Another action</a></li>
                        <li><a href="#">Something else here</a></li>
                        <li role="separator" class="divider"></li>
                        <li><a href="#">Separated link</a></li>
                        <li role="separator" class="divider"></li>
                        <li><a href="#">One more separated link</a></li>
                    </ul>
                </li>
            </ul>
            {{-- LOGIN --}}
            @if(!Auth::check())
            <ul class="nav navbar-nav navbar-right">
                <li><a class="btn" data-toggle="modal" data-target="#exampleModal" data-whatever="@getbootstrap"><i class="fa fa-sign-in fa-fw"></i> Login</a>
                    <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
                        <div class="modal-dialog" role="document">
                            <div class="modal-content">
                                {!!Form::open(['url'=>'login', 'method'=>'POST'])!!}
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">  <span aria-hidden="true">&times;</span></button>
                                    <h4 class="modal-title" id="exampleModalLabel">Iniciar sesion</h4>
                                </div>
                                <div class="modal-body">
                                    <div class="form-group">
                                        <label for="recipient-name" class="control-label">Email:</label>
                                        <input name="email" type="text" class="form-control" id="recipient-name">
                                    </div>
                                    <div class="form-group">
                                        <label for="message-text" class="control-label">Contraseña:</label>
                                        <input name="password" type="password" class="form-control" id="recipient-password">
                                    </div>
                                </div>
                                <div class="modal-footer">
                                    <button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
                                    {!!Form::submit('Entrar', ['class' => 'btn btn-primary'])!!}
                                </div>
                                {!!Form::close()!!}


                                <a class="btn" data-toggle="modal" data-target="#passwordRecover" data-whatever="@getbootstrap"> ¿No recuerdas tu contraseña?</a>
                                    <div class="modal fade" id="passwordRecover" tabindex="0" role="dialog" aria-labelledby="exampleModalLabel">
                                        <div class="modal-dialog" role="document">
                                            <div class="modal-content">
                                                {!!Form::open(['url'=>'/password/email', 'method'=>'POST'])!!}
                                                <div class="modal-header">
                                                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">  <span aria-hidden="true">&times;</span></button>
                                                    <h4 class="modal-title" id="exampleModalLabel">No recuerdo mi contraseña</h4>
                                                </div>
                                                <div class="modal-body">
                                                    {!! csrf_field() !!}
                                                    <div class="form-group">
                                                        <label for="recipient-name" class="control-label">Email:</label>
                                                        <input name="email" type="email" value="{{ old('email') }}" class="form-control" id="recipient-name">
                                                    </div>                                                        
                                                </div>
                                                <div class="modal-footer">
                                                    <button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
                                                    {!!Form::submit('Enviar', ['class' => 'btn btn-primary'])!!}
                                                </div>
                                                {!!Form::close()!!}
                                            </div>
                                        </div>
                                    </div>
                            </div>
                        </div>
                    </div></li>
                </ul>
                @else
                <ul class="nav navbar-nav navbar-right">
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{{Auth::user()->name}} <i class="fa fa-user fa-fw"></i><span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        <li><a href="{!! url("/user/profile/".Auth::user()->id) !!}">Perfil</a></li>
                        @if(Auth::user()->type_id == 1)
                        <li><a href="{!!URL::to('/user')!!}">Administrar</a></li>
                        @endif
                        <li role="separator" class="divider"></li>
                        <li><a href="{!!URL::to('/logout')!!}"><i class="fa fa-sign-out fa-fw"></i>Logout</a></li>
                    </ul>
                </li>
                </ul>
                @endif
                {{-- /.LOGIN --}}
        </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
</nav>

我在 custom.css

上制作了padding-top: 50px;

1 个答案:

答案 0 :(得分:1)

div中获取模态<nav>。我没有删除所有服务器检查,因此可以看到@iffiddle link