html - Modal Closes, but scroll bar doesn't come back -
i have bootstrap 3 modal close , homecoming page proper state (which showing vertical scroll bar) when close 'close button' or 'x' in top right corner. when effort have "select button" in modal close after making ajax phone call vertical scroll bar not homecoming page. in code have 'onclick' event calling .modal('hide') having: data-dismiss="modal" on button itself. ajax phone call executes correctly well. can't see why preventing scroll bar reappearing in same manner when 1 of close buttons selected.
--thank insights.
<div class="modal fade" id="modal_1timepmt" tabindex="-1" role="dialog" aria-labelledby="1timepmtlabel" aria-hidden="true"> <div class="modal-dialog admin_modal_dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title">some other details</h4> </div> <div class="modal-body"> <div class="container content-box live-box"> <h3>some heading here</h3> <form id="date_exp" name="date_exp"> <div class="form-group" id="exp_form"> <label for="log_start" class="control-label"><small>date</small></label> <input type="date" class="form-control input-sm" name="exp_date" id="exp_date" data-format="yyyy-mm-dd" > <a href="/?object=result_detail&action=exp_date" onclick="priv_ajax.go({ url:this.href, div:'web_adm_details', data:priv_forms.capture(document.forms['date_exp']) }); homecoming false; $('#modal_1timepmt').modal('hide');" > <button style="margin-left: 10px; margin-top: 10px;" class="btn btn-default btn-xs" data-dismiss="modal">select</button></a> </div> </form> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">close</button> </div> </div> </div>
to help else may run this. upon farther inspection of dom after modal closed noticed body still had class applied: ".modal-open".
removal of class bring page normal conditions. next simple line of code attached onclick event solved issue (although still haven't figured out underlying cause).
$('body').removeclass('modal-open'); html ajax twitter-bootstrap-3 scrollbar
No comments:
Post a Comment