Created
August 3, 2012 14:45
-
-
Save renaehodgkins/3248289 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bindHoverToCountry: (paper, country_iso_code, path)-> | |
that = this | |
path.hover( | |
(e)-> | |
# when mouse hover the country, we build fill the country path with highlight color and display a tooltip around the mouse position | |
name = that.worldmap.names[country_iso_code] | |
desc = "#{that.data[name]} %" | |
this.tipSet = that.drawCountryTooltip(paper, e.offsetX, e.offsetY, name, desc) | |
this.c = this.c || this.attr("fill") | |
this.stop().animate({fill: "#C13A27"}, 500) | |
(e)-> | |
this.tipSet.remove() | |
this.stop().animate({fill: this.c}, 500) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment