D
D
drtvader2016-03-24 10:00:46
css
drtvader, 2016-03-24 10:00:46

Why does the header shift when opening the bootstrap modal window?

Hello. When opening the modal, the header shifted, I found a fix,

var fixedCls = '.minimized-header,.b-filter--floating';
var oldSSB = $.fn.modal.Constructor.prototype.setScrollbar;
$.fn.modal.Constructor.prototype.setScrollbar = function () {
    oldSSB.apply(this);
    if (this.bodyIsOverflowing && this.scrollbarWidth)
        $(fixedCls).css('padding-right', this.scrollbarWidth);
}

var oldRSB = $.fn.modal.Constructor.prototype.resetScrollbar;
$.fn.modal.Constructor.prototype.resetScrollbar = function () {
    oldRSB.apply(this);
    $(fixedCls).css('padding-right', '');
}

But when opening a new modal window in a modal window, the header still twitches. Why is that?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
doctorcat, 2016-03-24
@doctorcat

Please upload a non-working example on codepen.io https://jsfiddle.net/
But this is only if you want someone to help you :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question