Same hover function for multiple paths in Raphael

后端 未结 4 1054
情书的邮戳
情书的邮戳 2021-02-06 11:27

So I\'ve got my canvas and my 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.4         


        
4条回答
  •  粉色の甜心
    2021-02-06 11:49

    The shortest way would be to have your paths being pushed in a set and then use forEach on your set to style each path.

    You would then bind hover handlers the same way, with handlers being first referenced as closure variables.

提交回复
热议问题