HOW TO CLOSE A MODAL USE JS

66 views
Skip to first unread message

WEB LOVER

unread,
Nov 19, 2015, 11:37:40 PM11/19/15
to Ratchet
As the title describe how do i close the modal use js. The following is my code.


  1. <a href="#myModalexample" class="btn">Open modal</a>
  2. <div id="myModalexample" class="modal">
  3.   <header class="bar bar-nav">
  4.     <a class="icon icon-close pull-right" href="#myModalexample"></a>
  5.     <h1 class="title">Modal</h1>
  6.   </header>
  7.   <div class="content">
  8.     <p class="content-padded">The contents </p>
  9.   </div>
  10. </div>

WEB LOVER

unread,
Nov 19, 2015, 11:52:50 PM11/19/15
to Ratchet
【solved】the modal is launched by class "active", so we can remove the "active" class to close the modal:

$("#myModalexample").removeClass("active");

在 2015年11月20日星期五 UTC+8下午12:37:40,WEB LOVER写道:
Reply all
Reply to author
Forward
0 new messages