Activate/Initialize

Buy now Get support

Use the click-to-activate option to show zoom on click/tap instead of hover.

Use the click-to-deactivate option to hide zoom on click.

Set the initialize-on option to 'click' to download the large image upon click on the main image or additional thumbnails (reduces bandwidth usage, but slows the user experience).

Use the initialize-on option to 'mouseover' to download the image upon first mouseover (also to reduce bandwidth).

Here's the code:

  1. <html>
  2.     <head>
  3.         <title>Magic Zoom: Activate/Initialize</title>
  4.        
  5.         <!-- link to magiczoom.css file -->
  6.         <link href="magiczoom/magiczoom.css" rel="stylesheet" type="text/css" media="screen"/>
  7.         <!-- link to magiczoom.js file -->
  8.         <script src="magiczoom/magiczoom.js" type="text/javascript"></script>
  9.        
  10.     </head>
  11.     <body>
  12.        
  13.         <p>Use the click-to-activate option to show zoom on click/tap instead of hover.</p>
  14.  
  15.         <!-- define Magic Zoom with click-to-active option -->
  16.         <a href="images/r1-blue-3.jpg" class="MagicZoom" rel="click-to-activate: true"><img src="images/r1-blue-2.jpg"/></a>
  17.  
  18.         <p>Use the click-to-deactivate option to hide zoom on click.</p>
  19.  
  20.         <!-- define Magic Zoom with click-to-deactive option -->
  21.         <a href="images/r1-blue-3.jpg" class="MagicZoom" rel="click-to-deactivate: true"><img src="images/r1-blue-2.jpg"/></a>
  22.  
  23.         <p><a name="initialize-on-click">Set the initialize-on option to 'click' to download the large image upon click on the main image or additional thumbnails (reduces bandwidth usage, but slows the user experience).</a></p>
  24.  
  25.         <!-- define Magic Zoom with the initialization on click -->
  26.         <a id="zoom3" href="images/r1-red-3.jpg" class="MagicZoom" rel="initialize-on: click"><img src="images/r1-red-2.jpg"/></a>
  27.         <p style="margin-top: 20px;">
  28.             <a href="images/r1-red-3.jpg" rel="zoom-id: zoom3" rev="images/r1-red-2.jpg" title="White Yahama YZF-R1"><img src="images/r1-red-1.jpg"/></a>
  29.             <a href="images/r1-black-3.jpg" rel="zoom-id: zoom3" rev="images/r1-black-2.jpg" title="Black Yamaha YZF-R1"><img src="images/r1-black-1.jpg"/></a>
  30.             <a href="images/r1-blue-3.jpg" rel="zoom-id: zoom3" rev="images/r1-blue-2.jpg" title="Blue Yamaha YZF-r1"><img src="images/r1-blue-1.jpg"/></a>
  31.         </p>
  32.  
  33.         <p>Use the initialize-on option to 'mouseover' to download the image upon first mouseover (also to reduce bandwidth).</p>
  34.         <!-- define Magic Zoom with the initialization on mouse over -->
  35.         <a href="images/r1-black-3.jpg" class="MagicZoom" rel="initialize-on: mouseover"><img src="images/r1-black-2.jpg"/></a>
  36.        
  37.     </body>
  38. </html>