HLRosenberger
asked on
D3, mouseover, SVG, Javacript
I have SVG file. Using D3 to load. I want to change the fill color and/or the stroke width or color of a path on mouseover and mouseout. I have the mouse event working, but I cant get the attributes/colors, etc, to change. I can get the opacity to change. See code below .
sectionLayer.on('mouseover ', function () {
d3.select(this).style("opa city", 0);
d3.select(this).style("str oke-width" , 13);
d3.select(this).style("str oke", "blue");
d3.select(this).style("fil l", "green");
});
sectionLayer.on('mouseover
d3.select(this).style("opa
d3.select(this).style("str
d3.select(this).style("str
d3.select(this).style("fil
});
sectionLayer.on('mouseover', function () {
this.style.opacity = '0';
this.setAttribute("stroke-width", '13');
this.setAttribute("stroke", "blue");
this.setAttribute("fill", "green");
});
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Got it! Thanks!
You're welcome!
ASKER