thumbnailViewer.html 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1"/>
  5. <style tyle="text/css">
  6. html,body{
  7. width: 100%;
  8. height: 100%;
  9. }
  10. #mainViewContainer {
  11. width: 95%;
  12. height: 95%;
  13. border: 1px solid black;
  14. margin: 10px;
  15. padding: 3px;
  16. overflow: hidden;
  17. }
  18. #mainView {
  19. width: 100%;
  20. height: 100%;
  21. min-height: 100%;
  22. display: inline;
  23. }
  24. .thumbViewClass {
  25. border: 1px solid black;
  26. position: absolute;
  27. bottom: 5px;
  28. left: 5px;
  29. width: 20%;
  30. height: 30%;
  31. margin: 3px;
  32. padding: 3px;
  33. overflow: hidden;
  34. }
  35. #thumbView {
  36. z-index: 110;
  37. background: white;
  38. }
  39. #scopeContainer {
  40. z-index: 120;
  41. }
  42. </style>
  43. </head>
  44. <body>
  45. <div id="mainViewContainer">
  46. <embed id="mainView" type="image/svg+xml" src="tiger.svg"/>
  47. </div>
  48. <div id="thumbViewContainer">
  49. <svg id="scopeContainer" class="thumbViewClass">
  50. <g>
  51. <rect id="scope" fill="red" fill-opacity="0.1" stroke="red" stroke-width="2px" x="0" y="0" width="0" height="0"/>
  52. <line id="line1" stroke="red" stroke-width="2px" x1="0" y1="0" x2="0" y2="0"/>
  53. <line id="line2" stroke="red" stroke-width="2px" x1="0" y1="0" x2="0" y2="0"/>
  54. </g>
  55. </svg>
  56. <embed id="thumbView" type="image/svg+xml" src="tiger.svg" class="thumbViewClass"/>
  57. </div>
  58. <script src="../dist/svg-pan-zoom.js" type="text/javascript" ></script>
  59. <script src="./thumbnailViewer.js" type="text/javascript" ></script>
  60. <script type="text/javascript">
  61. thumbnailViewer({mainViewId: 'mainView',thumbViewId: 'thumbView'});
  62. </script>
  63. </body>
  64. </html>