html - Img src to a link -
is possible make chili img "a href". function of pop working fine, there no "hand", when hover picture.
html
<img src="/images/thumbs/image1.jpg" data-toggle="modal" data-target="#mymodal1" alt="trolltunga, norway" width="300px" height="200px" > <div id="mymodal1" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="mymodallabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-body"> <img src="//placehold.it/1000x600" class="img-responsive"> </div> </div> </div> </div>
js
function centermodal() { $(this).css('display', 'block'); var $dialog = $(this).find(".modal-dialog"); var offset = ($(window).height() - $dialog.height()) / 2; // center modal vertically in window $dialog.css("margin-top", offset); } $('.modal').on('show.bs.modal', centermodal); $(window).on("resize", function () { $('.modal:visible').each(centermodal); });
simple use code in css.
img:hover{ cursor: pointer; }
Comments
Post a Comment