javascript - Same hover function for multiple paths in Raphael -
so i've got canvas , paths: var paper1 = raphael(10, 50, 960, 560); var mapshape1 = paper1.path("m339.098,175.503c0,0-55.555,58.823-16.34,75.163s227.451,49.02,227.451,49.02s67.321-25.49,47.713-50.98s-71.896-78.432-71.896-78.432l339.098,175.503z"); var mapshape2 = paper1.path("m548.902,306.876c0,0-209.15-32.026-228.758-46.405s-27.451-27.451-20.262-42.484s26.797-44.444,26.797-44.444l-41.83-86.928l-76.471,77.125c0,0-25.49,169.935,48.366,171.242s292.157-4.575,292.157-4.575v306.876z"); var mapshape3 = paper1.path("m296.614,86.614l38.562,83.66l194.771-7.843l75.817,81.7c0,0,130.066-84.967,73.203-118.301s503.15,48.706,463.935,51.974s296.614,86.614,296.614,86.614z"); and style them this: (i believe improved, there way paths @ once???) function style1(shape){ shape.attr({ "fill": "#33ccff", "stroke": "000000", "stroke-width": "5" }); } style1(map...