javascript - Bootstrap modal inside a modal; Cannot scroll after closing modal -
i have bootstrap modal calls bootstrap modal. issue when open second bootstrap modal , close first bootstrap modal not scroll anymore. instead scroll obtained background main page. should need here when close second modal first modal gets focused , obtain scroll before second modal. on highly appreciated.
$('#modaltrigger').on('click', function () { settimeout(function () { $('#modalbody').html($('#contenttext').html()); }, 1000); }); $('#btnprimarymodalaction').on('click', function () { $('#secondarymodal').modal('show'); });
here link jsfiddle contains 2 bootstrap modal defines situation mentioned above.
your issue has deal how bootstrap 'locking' body element when modal opened. on body element when modal opened add class modal-open
. when open second modal, nothing happens, when close .. removes needed class model-open
. need add logic js keep class there until last modal closed. it's not made adding modals inside of modals.
i suggest try using the modal event methods have available through bootstrap circumvent here
Comments
Post a Comment