javascript - Bootstrap Modal clickable div -
i'm trying make div clickable open modal. div has background image class on it. when click image modal pop gallery inside modal. i'm having hard time trying figure out. i'm not sure trigger goes. use bootstrap button trigger? each of "box's" has background image on them. code have far is:
<div class="row no-side-padding"> <div class="col-sm-3 no-side-padding-2"> <div class="assistants-box"> <h2>assistants</h2> </div> </div> <div class="col-sm-3 five-padding-left no-padding-right"> <div class="chairs-box"> <h2>chairs</h2> </div> </div> <div class="col-sm-3 five-padding-left no-padding-right"> <div class="craft-fairs-box"> <h2>craft fairs</h2> </div> </div> <div class="col-sm-3 five-padding-left no-padding-right"> <div class="materials-box"> <h2>materials</h2> </div> </div> </div>
here it's explained in bootstrap's docs.
you can use js or html way.
js:
basicly should call on click:
$('#mymodal').modal('show');
html way:
on button:
<button type="button" data-toggle="modal" data-target="#mymodal">launch modal</button>
on anchor:
the other markup:
<div id="mymodal" class="modal fade"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <!-- header --> <div class="modal-header"> <h1>header</h1> </div> <!-- body --> <div class="modal-body"> <p>body</p> </div> <!-- footer --> <div class="modal-footer modal-footer--mine"> <button type="button" class="btn btn-default" data-dismiss="modal">close</button> </div> </div> </div> </div>
Comments
Post a Comment