Bootstrap Modals keep adding padding-right to body after closed

后端 未结 30 1977
南方客
南方客 2020-12-12 12:36

I am using bootstrap and Parse framework to build a small webapp. But those Bootstrap modals keep adding padding-right to body after closed. How to solve this?

I tri

30条回答
  •  鱼传尺愫
    2020-12-12 13:22

    I dug into the bootstrap javascript and found that the Modal code sets the right padding in a function called adjustDialog() which is defined on the Modal prototype and exposed on jQuery. Placing the following code somewhere to override this function to do nothing did the trick for me (although I don't know what the consequence of not setting this is yet!!)

    $.fn.modal.Constructor.prototype.adjustDialog = function () { };

提交回复
热议问题