I am trying to set up a hover for a raphael element so that when the mouse is on the element, it has a glow and when the mouse leaves, the glow is removed. I have figured out ho
This is how I add / remove the glow effect using Raphael:
paper.circle(x, y, r)
.attr({fill: "lightblue", stroke: "lightblue", "stroke-width": 6})
.hover(function() {
this.glowEffect = this.glow({color:"#1693A5", width: 2});
}, function() {
this.glowEffect.remove();
})
.id = "example";
I just add ".hover" to the Raphael element.
You could also do something like:
var c = paper.circle(x, y, r);
c.hover(function() {
this.glowEffect = this.glow({color:"#1693A5", width: 2});
}, function() {
this.glowEffect.remove();
});