Skip to content

Instantly share code, notes, and snippets.

@derekblank
Created June 11, 2013 20:57
Show Gist options
  • Save derekblank/5760611 to your computer and use it in GitHub Desktop.
Save derekblank/5760611 to your computer and use it in GitHub Desktop.
Allow user to interact with Raphael regions
for region of worldRaphael
((rg, region) =>
worldRaphael[region].node.id = region
rg[0].onmouseover = (e) =>
rg.animate
fill: @hoverColor, 200
rg[0].onmouseout = (e) =>
rg.animate
fill: @baseColor, 200
rg[0].onclick = (e) =>
@goToURL(e)
) worldRaphael[region], region
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment