简体   繁体   中英

Modal is overlapping the content and making the content unclickable in bootstrap?

I have made a modal which is displaying in footer but when the modal appears it overlaps the overall div and make the side bar unclickable.

Here is the code:

<footer>     
<div class="modal custom show" id="trackModal"  role="dialog" aria-labelledby="trackModalLabel" aria-hidden="false">
                 <div class="modal-dialog" id="popup">
                     <div class="modal-content">
                          <img id="popclose" src="~/Content/MediaCenter/assets/images/cookies.jpg">
                     </div>
                  </div>
        </div>
<footer>

Here is the css

div#popup {
    left: 18%;
}
div#trackModal {
    z-index: 1049;
}

.modal.custom .modal-dialog {
    position: fixed;
    bottom: 0;
    right: 0;
    margin: 0;
    content: "";
    width: 130%;
    display: none;
}

I have tried visibility:hidden ; overflow-x:auto and overflow-y:auto . But result remains the same.

Please if anyone can help?

Use Z-index property to the model like this:

   .modal.custom .modal-dialog {
        position: fixed;
        bottom: 0;
        right: 0;
        margin: 0;
        content: "";
        width: 130%;
        display: none;
        z-index: -1; 
    }

so now, side bar will goes front of your model. Try it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM