If I open a modal dialog, through Twitter Bootstrap, I've noticed that it pushes all the html content of the page (i.e., in the container
) to the left a little bit, and then puts it back to normal after closing itself. However, this only happens if the browser width is large enough to not be on the "mobile" (i.e., smallest) media query. This occurs with the latest versions of FF and Chrome (haven't tested other browsers).
You can see the problem here: http://jsfiddle.net/jxX6A/2/
Note: You have to increase the width of the "Result" window so it switches to the "med" or "large" media query css.
I have setup the HTML of the page based upon the examples shown on Bootstrap's site:
<div class='container'>
<div class='page-header'>
<h4>My Heading</h4>
</div>
<div id='content'>
This is some content.
</div>
<div class='footer'>
<p>© 2013, me</p>
</div>
</div>
I'm guessing this is not supposed to happen, but I'm not sure what I've done wrong.
EDIT: This is a known bug, for more (and up-to-date) information, please see: https://github.com/twbs/bootstrap/issues/9855
I have same problem and I got solution that is work for me....
place this code at top of your
style.css
fileI fixed my problem and I think it will work for everyone. In bootstrap.js there's a line:
if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
It means in some case Bootstrap will add a padding-right of scrollbar width while opening a modal. So @pmanOnu was half way right, but don't delete this whole line of code but only
replace
bodyPad + this.scrollbarWidth
in bootstrap.js with0
to make Bootstrap adding a padding-right of 0px (which is the same of not adding).
Then add
.modal-open {overflow: initial;}
to your custom css to prevent Bootstrap from disabling scrollbar while opening modals.I tweaked this answer further up this thread by TBAG
With a minor tweak it works on the desktop, for mobile devices overflow is set to hidden
final code
Hope this helps!
Just do this simply and thats all
Works for me. Short and does the job.
i have faced same problem and following solution
Try to change all occurence of below
with
on your bootstrap.js file.
That's All..