img.html 668 B

123456789101112131415161718192021222324252627
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <!--
  5. <link rel="stylesheet" href="style.css">
  6. -->
  7. <script src="../dist/svg-pan-zoom.js"></script>
  8. </head>
  9. <body>
  10. <h1>Demo for svg-pan-zoom: SVG in HTML 'img' element</h1>
  11. <img id="demo-tiger" src="tiger.svg" alt="svg image of a tiger" style="width: 500px; height: 500px; border:1px solid black; "/>
  12. <script>
  13. // Don't use window.onLoad like this in production, because it can only listen to one function.
  14. window.onload = function() {
  15. svgPanZoom('#demo-tiger', {
  16. zoomEnabled: true,
  17. controlIconsEnabled: true
  18. });
  19. };
  20. </script>
  21. </body>
  22. </html>