Twitter Bootstrap Datepicker within modal window

后端 未结 22 1682
旧时难觅i
旧时难觅i 2020-11-29 02:42

I am currently using the Twitter Bootstrap framework, and when using the modal windows I cannot get over js elements to work like datepicker or validation, though chosen and

相关标签:
22条回答
  • 2020-11-29 03:12

    I think is better to change the logical function in the plugin. Around row 552 i change this:

                var zIndex = parseInt(this.element.parents().filter(function(){
                    return $(this).css('z-index') !== 'auto';
                }).first().css('z-index'))+10;
    

    into this:

                var zIndex = parseInt(this.element.parents().filter(function(){
                    return $(this).css('z-index') !== 'auto';
                }).first().css('z-index')) + 10 * 1000; //think is enought
    
    0 讨论(0)
  • 2020-11-29 03:13

    For Bootstrap 3.x and Ace Template wrapbootstrap

    Datepicker and Timepicker inside a Modal

    <style>
        body.modal-open .datepicker {
            z-index: 1050 !important;
        }
        body.modal-open .bootstrap-timepicker-widget {
            z-index: 1050 !important;
        }
    </style>
    
    0 讨论(0)
  • 2020-11-29 03:13

    let me help you,

    you can to update your bootstrap.min.css

    in class dropdown-menu you can to change z-index value into 2000

    so datepicker will show up

    0 讨论(0)
  • 2020-11-29 03:16

    Try to change z-index value for .modal and .modal-backdrop less than .datepicker z-index value.

    0 讨论(0)
  • 2020-11-29 03:18

    if You use bootstrap V3 try this.

    
        .bootstrap-datetimepicker-widget 
        {
            z-index: 1200   !important;
        }
    
    
    0 讨论(0)
  • 2020-11-29 03:19

    I had this error, because i scrolled bottom. Datepicker had wrong top position in fixed. I just use it now like:

    $('#myModal').on('show.bs.modal', function (e) {
                $(document).scrollTop(0);
    });
    

    and its working fine now.

    0 讨论(0)
提交回复
热议问题