Bootstrap Modal popping up but has a “tinted” page and can't interact

試著忘記壹切 提交于 2019-11-28 04:59:17

Ok, so I figured out the issue.

If the modal container has a fixed position or is within an element with fixed position this behavior will occur.

Easiest way is to just move the modal div so it is outside any elements with special positioning. One good place might be just before the closing body tag .

This is what I did, and it worked.

This happened to me, and it took ages to diagnose. If it happens to you, add this to your css:

div.modal div.modal-backdrop {
    z-index: 0;
}

EDIT: You may need more specificity for this setting to be picked up. As Nick Spoon suggests, you can use

body.modal-open div.modal-backdrop { 
    z-index: 0; 
}

And you may need to add more qualifiers, depending on what the rest of your CSS is doing. You can also use !important, but that's just sweeping the problem under the rug.

Miguel Pereira

I found a good fix for this problem here:

https://stackoverflow.com/a/18764086

Add -webkit-transform: translateZ(0) to the position: fixed element. This forces Chrome to use hardware acceleration to continuously paint the fixed element and avoid this bizarre behavior.

nrajsharma794

If you want to open the print dialog on button present on modal itself and after printing your webpage is not accessible then it will definitely work for you rather then the window.print().

Use below code. First of all you need to close the modal dialog and open the print dialog after few seconds.

setTimeout(function() { printnow('printdiv', 10); }, 500);

I fixed this problem by moving all modal html to the bottom of my file! Nothing else worked. Only the button to open the modal is within the rest of the html. This could have something to do with body tag declarations but I don't have time to worry about it.

I ran into this as well and found this exact phenomenon occurs with the screen freezing after clicking the button to open a Modal and found this was due to an unclosed that I accidently deleted.

When I added the closing , the Modal Popup started working again.

If you're using ASP.NET, make sure you place the modal's div block inside a <asp:Content ContentPlaceHolderID="BottomOfForm" runat="server">.

I know this is an old question, but I had a similar issue and in case anyone has the same, here is what worked for me. Make sure you include the modal css file!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!