Just proxy the modal-open
class for Bootstrap like this:
.bs-modal-open {
overflow: hidden;
}
.bs-modal-open .modal {
overflow-x: hidden;
overflow-y: auto;
}
// or using sass …
.bs-modal-open {
@extend .modal-open;
}
Add/remove the bs-modal-open
class to the body when opening/closing a BS modal:
$('.bs-modal')
.on('show.bs.modal', function (e) {
$('body').addClass('bs-modal-open');
})
.on('hidden.bs.modal', function (e) {
$('body').removeClass('bs-modal-open');
});
Finally add the bs-modal
class to each of your BS modals:
<div class="modal bs-modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
…
</div>
Related Posts:
- Bootstrap Dropdown menu is not working
- Adding images to a Bootstrap Carousel with AJAX
- JavaScript Loading Screen while page loads
- Bootstrap Dropdown menu is not working
- Bootstrap Dropdown menu is not working
- TypeError: $(…).modal is not a function with bootstrap Modal
- bootstrap 3 navbar collapse button not working
- How to center image in carousel
- Can Twitter Bootstrap alerts fade in as well as out?
- Automatically decrease font size for long words
- Modify Custom Field in Media Library using JavaScript
- Twitter Bootstrap Use Collapse in Custom Post Type
- How to properly add Bootstrap and JQuery Javascripts?
- How to Dynamically Load Content Into Body of Bootstrap Modal Window?
- Using bootstrap-slider and bootstrap-switch in wordpress admin panel
- Is it OK combined wp-include js, jquery, css? [closed]
- jQuery Validation plugin and Bootstrap 4 CSS classes
- Getting click on item to open closest relevant element (popup) with jQuery
- jQuery for Fade Preload Causes My Site Favicon to Disappear from Tab of Browser
- Site images are fixed in front of my site content [closed]
- Bootstrap with separate js File
- change the icon of a custom post type in WordPress to use twitter boostrap
- JavaScript sleep/wait before continuing [duplicate]
- Why does my JavaScript code receive a “No ‘Access-Control-Allow-Origin’ header is present on the requested resource” error, while Postman does not?
- How to change CSS using jQuery?
- How do I link a JavaScript file to a HTML file?
- What does [object Object] mean? (JavaScript)
- Remove class using jQuery
- Why does my JavaScript code receive a “No ‘Access-Control-Allow-Origin’ header is present on the requested resource” error, while Postman does not?
- How to set time delay in javascript
- JavaScript error (Uncaught SyntaxError: Unexpected end of input)
- JavaScript error (Uncaught SyntaxError: Unexpected end of input)
- How can I scroll to an element using jQuery?
- jQuery equivalent of JavaScript’s addEventListener method
- Adding an onclick function to go to url in JavaScript?
- Checking a Url in Jquery/Javascript
- My javascript is returning this error: $.ajax is not a function
- Best way to store a key=>value array in JavaScript?
- Javascript Runtime error: $ is undefined
- Change Background color (css property) using Jquery
- JavaScript: filter() for Objects
- JavaScript runtime error: ‘$’ is undefined
- When and why to ‘return false’ in JavaScript?
- Set timeout for ajax (jQuery)
- How to generate a simple popup using jQuery
- How does the data-toggle attribute work? (What’s its API?)
- Use images like checkboxes
- Setting background-image using jQuery CSS property
- ChangeDate – Date Picker Bootstrap
- Format date to MM/dd/yyyy in JavaScript
- What do curly braces in JavaScript mean?
- How is JavaScript .on() method defined?
- Understanding how data-dismiss attribute works in Bootstrap
- bootstrap-datetimepicker for bootstrap 4
- Click button copy to clipboard
- Rotate image with javascript
- How to make html table vertically scrollable
- Uncaught TypeError: Cannot read property ‘top’ of undefined
- Javascript isnull
- Equivalent of jQuery .hide() to set visibility: hidden
- Why is the jquery script not working?
- TypeError: $(…).DataTable is not a function
- How to make a simple image upload using Javascript/HTML
- Change text on hover, then return to the previous text
- How to make Bootstrap carousel slider use mobile left/right swipe
- Javascript TypeError: Cannot read property ‘indexOf’ of undefined
- JQuery: $.get is not a function
- Bootstrap throws Uncaught Error: Bootstrap’s JavaScript requires jQuery
- Bootstrap carousel not sliding
- How to get client’s IP address using JavaScript?
- Play/pause HTML 5 video using JQuery
- javascript function wait until another function to finish
- Simple throttle in JavaScript
- Refresh/reload the content in Div using jquery/ajax
- How to read data From *.CSV file using javascript?
- Enable & Disable a Div and its elements in Javascript
- How to get height of div in px dimension
- jQueryUI dialog width
- Bootstrap popover is not working
- How to display raw JSON data on a HTML page
- Bootstrap collapse isn’t working; hamburger menu not showing up
- How can I expand and collapse a using javascript?
- How to call a webservice method from an html page [javascript] with out refresh the page
- Javascript – ERR_CONTENT_LENGTH_MISMATCH
- Javascript : array.length returns undefined
- Random background images CSS3
- “Uncaught TypeError: a.indexOf is not a function” error when opening new foundation project
- The ‘describe’ keyword in javascript
- How can I remove all CSS classes using jQuery/JavaScript?
- Why is jquery show() not working in example
- jQuery scrollTop() method not working
- Creating Accordion Table with Bootstrap
- How to open a Bootstrap modal window using jQuery?
- Closing Bootstrap modal onclick
- Fully responsive HTML5 video
- How do I remove a box-shadow effect from an element when another element is hovered?
- How to change cursor from pointer to finger using jQuery?
- Slide right to left?
- Bootstrap Collapse not Collapsing
- Twitter Bootstrap Modal Form Submit