js代码
<script src="js/jquery-2.1.1.min.js" type="text/javascript"></script> <script type="text/javascript" src="js/imageviewer.min.js"></script> <script type="text/javascript"> $(function () { var viewer = ImageViewer(); $('.gallery-items').click(function () { var imgSrc = this.src, highResolutionImage = $(this).data('high-res-img'); viewer.show(imgSrc, highResolutionImage); }); }); </script>