Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

close bootstrap modal with javascript

$('#myModal').modal('hide');
Comment

modal dismiss

<!-- Button trigger modal -->
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModalCenter">
  Launch demo modal
</button>

<!-- Modal -->
<div class="modal fade" id="exampleModalCenter" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
  <div class="modal-dialog modal-dialog-centered" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLongTitle">Modal title</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">×</span>
        </button>
      </div>
      <div class="modal-body">
        ...
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary">Save changes</button>
      </div>
    </div>
  </div>
</div>
Comment

when modal close event

$("yourid").on('hide.bs.modal', function(){
	// do it here
});
Comment

bootstrap modal on close

$('#myModal').on('hidden.bs.modal', function () {
    // do something…
});
Comment

bootstrap modal not close

  		$('#MymodalPreventScript').modal({
    		backdrop: 'static',
    		keyboard: false
		});
Comment

bootstrap 3 modal close only with button

<--! Add following to modal Div : data-backdrop='static' -->
<div id="modal" class="modal hide fade in" data-keyboard="false" data-backdrop="static">
Comment

Close Modal

 .close.mat-button {
    position: absolute;
    top: 0;
    right: 0;
    padding: 5px;
    line-height: 14px;
    min-width: auto;
}
   <button class="close" mat-button [mat-dialog-close]="true">X</button>

Comment

PREVIOUS NEXT
Code Example
Javascript :: how to fix eslint error no-prototype-builtins 
Javascript :: flutter jsonDecode UTF8 
Javascript :: jquery get height of element 
Javascript :: canvas round rectangle 
Javascript :: js json upload 
Javascript :: in array in js 
Javascript :: array differenc javascript 
Javascript :: rectbutton disable 
Javascript :: unable to resolve path to module eslint(import/no-unresolved) absoute path 
Javascript :: get current month number javascript 
Javascript :: javascript check if is array 
Javascript :: javascript radio button change event 
Javascript :: how to add 4 business days in javascript 
Javascript :: javascript random alphabet 
Javascript :: express static auth 
Javascript :: jquery select element based on for attribute 
Javascript :: check jquery version on console 
Javascript :: getServerSideProps cookie 
Javascript :: find particular object from array in js 
Javascript :: node_env is not an internal or external command error 
Javascript :: jquery calculate datetime difference 
Javascript :: define keyframes with javascript 
Javascript :: add 10 seconds to date javascript 
Javascript :: remove duplicate objects from array javascript 
Javascript :: arrow function forms in javascript 
Javascript :: javascript give class to element 
Javascript :: javascript fillstyle 
Javascript :: change js to json 
Javascript :: why use currying 
Javascript :: add element to array using splice 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =