Shadowbox from Image Map


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. ////INCLUDES///
  2.  
  3. <script src="/includes/js-shadowbox.js" type="text/javascript"></script>
  4. <link href="/includes/css-shadowbox.css" rel="stylesheet" type="text/css" />
  5.  
  6. ////INIT///
  7.  
  8. <script type="text/javascript">
  9. Shadowbox.init({
  10. overlayOpacity: 0.75,
  11. displayCounter: false,
  12. overlayColor: "#999"
  13. });
  14.  
  15. window.onload = function() {
  16. Shadowbox.setup(document.getElementById("Map1").getElementsByTagName("area"),{width : 900, height: 600});
  17. Shadowbox.setup(document.getElementById("Map2").getElementsByTagName("area"),{width : 900, height: 600});
  18. }
  19. </script>
  20.  
  21.  
  22. ////HTML///
  23.  
  24. <map name="Map1" id="Map1">
  25. <area shape="rect" coords="462,95,505,163" href="/thislink.php" alt="link" />
  26. </map>
  27.  
  28.  
  29. ///ADD IMAGES ///
  30.  
  31. close.png
  32. close-over.png
  33. loading.gif

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.