I have two modal popups.
Sign in form --> Forgot password form
When someone click forgot password. Current modal closed and forgot password modal appears. Works perfectly. But there was a problem. Sometimes, modal-admin class not apply for the new modal(forgot password) So I use this js script and problem now solved.
$( document ).ready(function() {
$('.modal').on('hidden.bs.modal', function () {
setTimeout(function() {
if($('.modal').hasClass('in')) {
$('body').addClass('modal-open');
}}),400
});
});
But when you switch between modals few times, right side scrollbar takes small time to disappear and I can see small movement in the modal window. This happend random times. This is happening without setTimeout also. I can't imagine why this happens. Any idea?