I have observed when bootstrap dialog opens, body tag of html gets following css.
<body class="modal-open" style="padding-right: 17px;">
I think this is causing the UI to shake. How can I get rid of this weird behavior. I have created fiddle. But this issue is not produced there. But in my local environment I am able to reproduce this. JSFiddle
Answer: Use the modal('hide') Method You can simply use the modal('hide') method to hide or close the modal window in Bootstrap using jQuery. Other related Bootstrap's modal methods are modal('show') and modal('toggle') .
Inside the Open event handler of the jQuery UI Dialog Modal Popup box, using the JavaScript setTimeout function and the jQuery UI Dialog “close” command, the jQuery UI Dialog Modal Popup box is set to automatically close after delay of 5 seconds (some seconds). This dialog will automatically close in 5 seconds.
Live Demo: Dispose Bootstrap Modal Using jQuery. First launch modal, then close it, then press "Dispose Modal" button to remove the modal data stored on the DOM element. Press Ctrl+Shift+J (Windows / Linux) or Cmd+Opt+J (Mac) to open the browser console panel.
There are few ways to close modal in Bootstrap: click on a backdrop, close icon, or close button. You can also use JavaScript hide method. Click the button to launch the modal. Then click on the backdrop, close icon or close button to close the modal.
Just add this to your css:
.modal-open {
padding-right: 0px !important;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With