Browse Source

修复压缩包内多图片时总是从第一张开始预览的问题

pull/2/head
kl 7 years ago
parent
commit
cd8d1e2ba8
  1. 1
      jodconverter-web/src/main/java/com/yudianbank/web/controller/OnlinePreviewController.java
  2. 10
      jodconverter-web/src/main/resources/web/picture.ftl

1
jodconverter-web/src/main/java/com/yudianbank/web/controller/OnlinePreviewController.java

@ -69,6 +69,7 @@ public class OnlinePreviewController {
imgUrls = Lists.newArrayList(url);
}
model.addAttribute("imgurls", imgUrls);
model.addAttribute("currentUrl",url);
return "picture";
} else if (type.equalsIgnoreCase("simText")) {
ReturnResponse<String> response = simTextUtil.readSimText(decodedUrl, fileName);

10
jodconverter-web/src/main/resources/web/picture.ftl

@ -7,20 +7,22 @@
<style>
* { margin: 0; padding: 0;}
#dowebok { width: 800px; margin: 0 auto; font-size: 0;}
#dowebok li { display: inline-block; width: 32%; margin-left: 1%; padding-top: 1%;}
#dowebok li { display: inline-block;width: 50px;height: 50px; margin-left: 1%; padding-top: 1%;}
/*#dowebok li img { width: 200%;}*/
</style>
</head>
<body>
<ul id="dowebok">
<#list imgurls as img>
<li><img url="${img}" src="${img}" width="800px" height="auto"></li>
<li><img id="${img}" url="${img}" src="${img}" width="50px" height="50px"></li>
</#list>
</ul>
<script src="js/viewer.min.js"></script>
<script>
var viewer = new Viewer(document.getElementById('dowebok'), {url: 'src'});
viewer.show();
var viewer = new Viewer(document.getElementById('dowebok'), {
url: 'src'
});
document.getElementById("${currentUrl}").click();
</script>
</body>

Loading…
Cancel
Save