jquery - Background become black but the content of the modal doesn't appear -
i'm trying use modal attribute. when user click on image suppose display text have write following code.
<div class="col-md-4 gallery-left"> <a data-toggle="modal" data-target=".bs-example-modal-md" href="#mymodal" class="b-link-stripe b-animate-go thickbox"> <img class="img-responsive lot" src="{% static 'img/toothbrush.jpg' %}" alt=""> <div class="b-wrapper"> <div class="b-animate b-from-left b-delay03 "> <i class="plus second"> picture description </i> </div> </div> </a> </div> <div id="mymodal" class="modal fade" role="dialog"> <div class="modal-dialog"> <!-- modal content--> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">×</button> <h4 class="modal-title">modal header</h4> </div> <div class="modal-body"> <p>some text in modal.</p> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">close</button> </div> </div> </div> </div>
the background become black there no content display. have succeed use modal display image on user clicking using following code:
<a data-toggle="modal" data-target=".bs-example-modal-md" href="{% static 'img/toothbrush.jpg' %}" class="b-link-stripe b-animate-go thickbox">
why doesn't work when i'm trying display div text instead of image?
you have turned things around little bit.
<a data-toggle="modal" data-target=".bs-example-modal-md" href="#mymodal" class="b-link-stripe b-animate-go thickbox">
should
<a data-toggle="modal" data-target="#mymodal" href="#" class="b-link-stripe b-animate-go thickbox">
i.e reference id
of modal markup. or should add bs-example-modal-md
class #mymodal
:
<div id="mymodal" class="modal fade bs-example-modal-md" role="dialog">
both work. in either case should use href="#"
. here example #mymodal
-> http://jsfiddle.net/03m1fzso/ in opinion best solution since targeting class can lead unclarity when reexaminate code, besides risk of using class more once accident.
Comments
Post a Comment