officePicture.ftl 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <title>PDF图片预览</title>
  6. <script src="js/lazyload.js"></script>
  7. <style>
  8. .container{
  9. width: 100%;
  10. height: 100%;
  11. }
  12. .img-area{
  13. text-align: center
  14. }
  15. </style>
  16. </head>
  17. <body bgcolor="#404040">
  18. <div class="container">
  19. <#list imgurls as img>
  20. <div class="img-area">
  21. <img class="my-photo" alt="loading" title="查看大图" style="cursor: pointer;" data-src="${img}" src="images/loading.gif" onclick="changePreviewType('allImages')">
  22. </div>
  23. </#list>
  24. </div>
  25. <img src="images/pdf.svg" width="63" height="63" style="position: fixed; cursor: pointer; top: 40%; right: 48px; z-index: 999;" alt="使用PDF预览" title="使用PDF预览" onclick="changePreviewType('pdf')"/>
  26. <script>
  27. window.onload=checkImgs;
  28. window.onscroll = throttle(checkImgs);
  29. function changePreviewType(previewType) {
  30. var url = window.location.href;
  31. if (url.indexOf("officePreviewType=image") != -1) {
  32. url = url.replace("officePreviewType=image", "officePreviewType="+previewType);
  33. } else {
  34. url = url + "&officePreviewType="+previewType;
  35. }
  36. if ('allImages' == previewType) {
  37. window.open(url)
  38. } else {
  39. window.location.href = url;
  40. }
  41. }
  42. </script>
  43. </body>
  44. </html>