jQuery datapicker appearing behind twitter bootstrap modal

后端 未结 3 561
孤街浪徒
孤街浪徒 2021-01-05 01:54

I am using Bootstrap v2.3.2 and jQuery Datepicker v1.10.0,

On a modal I am trying to make use of the datepicker and it is appearing behind the modal on Firefox and

相关标签:
3条回答
  • 2021-01-05 02:33

    As @Matt answered, apply z-index higher than modal’s z-index, suppose modal has the below z-index:

    modal.fade {
        z-index: 10000000 !important;
    }
    

    Then apply z-index more than modal for datepicker class:

    .datepicker {z-index: 20000000 !important}
    
    0 讨论(0)
  • 2021-01-05 02:40

    I faced the same issue, fixed it with;

    .datepicker{z-index:9999 !important}
    

    Ref: github

    0 讨论(0)
  • 2021-01-05 02:46

    This answer covers the issue.

    This is a z-index issue. Normally applying a higher z-index via CSS would work, however jQuery resets the CSS each time the Datepicker UI is drawn.

    The solution re-applies the CSS each time it's drawn by using the beforeShow property.

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