css - Open images in a Modal way, using Struts2 and bootstrap -
i want try open images website on click in modal way. i'm using struts2, bootstrap. show me please correct way, example?
this code:
<div class="row"> <s:iterator value="gallerylist" var="gallerytemp"> <div class="col-xs-5 col-md-3"> <div class="thumbnail"> <a href=""><img src='userfiles/images/<s:property value="%{#gallerytemp.imagename}" />' class="thumbnail" data-toggle="modal" data-target="#mymodal<s:property value="%{#gallerytemp.id}" />" alt="body img" /> </a> <div class="modal fade" id="mymodal<s:property value="%{#gallerytemp.id}" />" tabindex="-1" role="image" aria-labelledby="mymodallabel" aria-hidden="true"> <img src='userfiles/images/<s:property value="%{#gallerytemp.imagename}" />' class="thumbnail" data-toggle="modal" data-target="#mymodal" alt="body img" /> </div> <div class="caption"> <center><h4><s:property value="%{#gallerytemp.description}" escapehtml="false"/></h4> </center> </div> </div> </div> </s:iterator> </div>
try code
<div class="row"> <s:iterator value="gallerylist" var="gallerytemp"> <div class="col-xs-5 col-md-3"> <div class="thumbnail"> <a href="#"><img src='userfiles/images/<s:property value="%{#gallerytemp.imagename}" />' class="thumbnail" data-toggle="modal" data-target="#mymodal<s:property value="%{#gallerytemp.id}" />" alt="body img" /></a> </div> <div class="modal fade" id="mymodal<s:property value="%{#gallerytemp.id}" />" tabindex="-1" role="image" aria-labelledby="mymodallabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <div class="caption"> <center><h4><s:property value="%{#gallerytemp.description}" escapehtml="false"/></h4> </center> </div> </div> <div class="modal-body"> <img src='userfiles/images/<s:property value="%{#gallerytemp.imagename}" />' class="thumbnail" data-toggle="modal" data-target="#mymodal" alt="body img" /> </div> </div> </div> </div> </s:iterator> </div>
Comments
Post a Comment