Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make modal windows scrollable #850

Merged
merged 2 commits into from
Dec 26, 2011
Merged

Make modal windows scrollable #850

merged 2 commits into from
Dec 26, 2011

Conversation

sferik
Copy link
Contributor

@sferik sferik commented Dec 26, 2011

See #849 for details.

I put the output of make in a separate commit, in case you don't want to pull that.

@fat
Copy link
Member

fat commented Dec 26, 2011

looks good to me - thanks

fat added a commit that referenced this pull request Dec 26, 2011
@fat fat merged commit 1c7c5f7 into twbs:master Dec 26, 2011
@NelsonReis
Copy link

Can't this be also applied to 2.0-wip?

@fat
Copy link
Member

fat commented Dec 27, 2011

it is in a branch i'm working on, but haven't pushed it yet.

@dmackerman
Copy link

Anyway to swallow the scroll event for the body behind it?

@jocubeit
Copy link

jocubeit commented Mar 2, 2012

Twitter Bootstrap 2.0.1 (probably earlier versions too) inserts a modal-open CSS class on the body element when it is shown, and this class is removed when the modal is hidden. You can instruct the body to not scroll while the modal is visible by adding the following to your CSS:

body.modal-open {
  overflow: hidden;
}

I use this in my apps because I find it distracting when the body scrolls behind the backdrop. Scrolling is reinstated when the modal is dismissed. Hope this helps.

@NelsonReis
Copy link

@MeetDom Does this still work for you? I've tried your solution but it scrolls anyway.

@jocubeit
Copy link

Yes definitely works for me in Safari Versions 5.1/5.2 and Chrome Version 19.0.1084.52 in Bootstrap 2.0.1/2.0.2. I haven't tried it in any other browsers or Bootstrap 2.0.3 yet.

andybenedict pushed a commit to andybenedict/bootstrap that referenced this pull request Sep 8, 2015
tech-jarvis added a commit to tech-jarvis/jarvis-hydrant that referenced this pull request Dec 22, 2024
I'm hopeful this will be fixed in the next version of Bootstrap. See:
twbs/bootstrap#849 and
twbs/bootstrap#850
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants