Hi I’m currently experimenting with Raphael JS 2 and have produced a nice circle of paths but after much searching cannot figure out how to implement a hover event on these paths to change the color…
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This fiddle changes a bit the way you set the hover functions. If that’s not what you want, please explain.
http://jsfiddle.net/vzkxC/1/
Raphael’s documentation http://raphaeljs.com/reference.html#Element.hover says you can pass the context of the hoverIn and hoverOut functions as third and fourth parameters (in my example they’re both
cItem). These are the values of thethisinside the callbacks.Of course, you could move the
hoverInandhoverOutfunctions to an appropriate scope (out of theforloop)