模态交叉按钮不适用于鼠标单击

问题描述 投票:0回答:1

我在引导程序中有一个模态。模态可以正常工作,但是它的交叉按钮不适用于鼠标单击。我的意思是,如果我想使用鼠标来关闭模态,则其交叉按钮不起作用。对于键盘,我的意思是ESC按钮可以。有人可以帮我吗?

我的模式代码:

<div class="modal fade" id="myModal" tabindex="-1" role="basic" aria-hidden="true">
                            <div class="modal-dialog" style="border-radius: 30px;">
                                <div class="modal-content help-popup" style="">
                                    <div class="modal-header">
                                        <h4 class="modal-title"> Login To Continue...</h4>
                                        <span class="btn_close">
                                            <i class="fa fa-times" aria-hidden="true"></i>
                                        </span>
                                    </div>
                                    <div class="modal-body">
                                        <div class="row side_pop">
                                            <div class="col-md-12 col-sm-12 col-xs-12">
                                                <div class="modal-body">
                                                    <div class="col-md-6">
                                                        @if(count($errors)>0)
                                                            <div class = "alert alert-error" style="color:red">
                                                                @foreach($errors->all() as $error)
                                                                    <div class="alert alert-warning alert-block">
                                                                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                                                            <span aria-hidden="true">&times;</span></button>
                                                                        <strong>{{ $error }}</strong>
                                                                    </div>
                                                                @endforeach
                                                            </div>
                                                        @endif
                                                        @include('backend.layout.flash-message')
                                                            <fieldset>
                                                                {{ Form::open(['route' => 'login','class'=>'login-form']) }}
                                                                <div class="form-group">
                                                                    <label class="control-label"
                                                                           style=" font-weight: bold;">Email
                                                                        ID</label>
                                                                    {!! Form::email('email', null,['id' => 'email','class'=>'form-control','placeholder'=>'Email or Candidate Phone','autocomplete'=>'off','required']) !!}
                                                                    @if ($errors->has('email'))
                                                                        <span class="invalid-feedback" role="alert"
                                                                              style="color:red">
                                                                <strong
                                                                    style="color:red">{{ $errors->first('email') }}</strong>
                                                            </span>
                                                                    @endif
                                                                </div>
                                                                <div class="form-group">
                                                                    <label class="control-label"
                                                                           style=" font-weight: bold;">Password</label>
                                                                    {!! Form::password('password',['id' => 'password','class'=>'form-control','placeholder'=>'Password','autocomplete'=>'off','required']) !!}
                                                                    @if ($errors->has('password'))
                                                                        <span class="invalid-feedback" role="alert"
                                                                              style="color:red">
                                                                <strong
                                                                    style="color:red">{{ $errors->first('password') }}</strong>
                                                            </span>
                                                                    @endif
                                                                </div>
                                                                <div class="form-actions">
                                                                    <button type="submit"
                                                                            class="btn btn-primary uppercase">Login
                                                                    </button>

                                                                    @if (Route::has('password.request'))
                                                                        <a href="{{ route('password.request') }}"
                                                                           id="forget-password"
                                                                           class="forget-password" >Forgot
                                                                            Password?</a>
                                                                    @endif
                                                                </div>
                                                                {{ Form::close() }}
                                                            </fieldset>
                                                    </div>
javascript html css bootstrap-modal
1个回答
0
投票

我通过将data-dismiss =“ modal”输入到模态的十字按钮中来获得解决方案。现在按钮属性为

<span class="btn_close">
   <i class="fa fa-times" aria-hidden="true" data-dismiss="modal"></i>
</span>
© www.soinside.com 2019 - 2024. All rights reserved.