Guest User

Untitled

a guest
Jun 24th, 2015
353
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   // sample usage of the onClick and onHover options (click on the map to run onClick function)
  2.   $('#map-continents').cssMap({
  3.     'size': 540,                  // set map size to 540px wide;
  4.     'onClick': function(e){
  5.       var link = e.children('a').attr('href'),        // get link's URL; => #europe;
  6.           text = e.children('a').eq(0).text(),       // get text of the link; => Europe;
  7.           className = e.attr('class').split(' ')[0];  // get class name of the list item; => c4;
  8.     // ----------------------------------------------------------------------------------------
  9.     switch (className) {
  10.         case "c1":
  11.             document.getElementById("buttonAustralia").click();
  12.             alert(className);
  13.         break;
  14.     }
  15.      }
  16.    });
Advertisement
Add Comment
Please, Sign In to add comment