12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- {extend name="layout/content"}
- {block name="content"}
- <style>
- .wrapper-content{padding:0;margin:0;}
- .viewer-close{display:none;}
- </style>
- <div id="showBigPic">
- <img id="_pic0001" src="{$img}" style="width:0;height:0;"/>
- </div>
- <script type="text/javascript">
- var __initialize = function () {
- var sbp = $("#showBigPic");
- $("#_pic0001").viewer({
- toolbar: true,
- fullscreen: false
- });
- $("#_pic0001").click();
- $(".viewer-prev").click(function () {
- var src = $("#_pic0001").attr("src");
- var imgs = parent.$(".imgUrl");
- var showPicIndex = 0;
- var showTitleName = "";
- imgs.each(function (index) {
- if ($(this).attr("src") == src) {
- showPicIndex = index;
- showPicIndex = showPicIndex == 0 ? imgs.length - 1 : showPicIndex - 1;
- showTitleName = imgs.eq(showPicIndex).parent("div").prev("div").text();
- var newUrl = imgs.eq(showPicIndex).attr("src");
- parent.$(".layui-layer-title").text(showTitleName);
- window.location.href = "/common/api/imgViewer?picShow=" + encodeURIComponent(newUrl);
- }
- })
- })
- $(".viewer-next").click(function () {
- var src = $("#_pic0001").attr("src");
- var imgs = parent.$(".imgUrl");
- var showPicIndex = 0;
- var showTitleName = "";
- imgs.each(function (index) {
- if ($(this).attr("src") == src) {
- showPicIndex = index;
- showPicIndex = showPicIndex == imgs.length - 1 ? 0 : showPicIndex + 1;
- showTitleName = imgs.eq(showPicIndex).parent("div").prev("div").text();
- var newUrl = imgs.eq(showPicIndex).attr("src");
- parent.$(".layui-layer-title").text(showTitleName);
- window.location.href = "/common/api/imgViewer?picShow=" + encodeURIComponent(newUrl);
- }
- })
- })
- }();
- </script>
- {/block}
|