officePicture.ftl 1.2 KB

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