How to make ClockPicker for Bootstrap (Plugin) appear in the form of a Bootstrap Modal popup?

Here is a link to ClockPicker for Bootstrap: http://www.jqueryrain.com/?B83aD_dg

It works great; however, when I try to use it to enter text input in the Bootstrap modal popup, the clock appears behind the modal popup. How can I make the clock manager appear in (or in front of) a modal popup?

Here is an image of what is happening:

enter image description here

I tried changing the z-index of the div to be in front; I also tried changing the z-index of each element in clockpicker.cssto be in front (for example: z-index: 1120). However, all this means that the clock disappears.

<div class="modal fade appointment-modal"
     id="appointment-modal"
     tabindex="-1"
     role="dialog"
     aria-labelledby="myModalLabel"
     aria-hidden="true">

<div class="modal-dialog tutors-modal">
    <div class="modal-content tutors-modal">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            <h4 class="modal-title">Appointment Scheduler</h4>
        </div>
        <div class="modal-body" style="height: 575px; left: 2.5%;">
            <div class="container">
                <div class="row">
                    <div class="col-md-12">     
                        <div class="alert alert-danger"><span class="glyphicon glyphicon-alert"></span>
                            <form role="form" action="/portal/make-appointment/" method="post" id="appointment_form" class="form-horizontal">
                                <div class="col-lg-6">

                                    <div class="input-group clockpicker" id = "clockpicker" style="padding: 6px; padding-bottom: 20px;">
                                        <input type="text" class="form-control" id = "time" name="time" value="08:00">
                                        <span class="input-group-addon">
                                            <span class="glyphicon glyphicon-time"></span>
                                        </span>
                                    </div>
                                    <script type="text/javascript">
                                        var input = $('#time');
                                        input.clockpicker({
                                            autoclose: true
                                        });
                                    </script>
                                    <input type="submit" name="submit" id="submit" value="Schedule Appointment" class="btn btn-info pull-right">
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="modal-footer">
        </div>
    </div>
</div>

+4
2

JSFiddle .

, , z- , z- -.

, , , CSS:

.clockpicker-popover {
    z-index: 999999;
}
+5

.clockpicker-popover 
{
   z-index: 999999 !important;
}
0

Source: https://habr.com/ru/post/1542689/


All Articles