javascript - Adding events to SVG text element -
I have a svg element I have added a mousemove event
handler for it and it works fine Does.
Now I add text element to it and in this added mouseover event
headlar, but the event is not a fire. Other elements such as Path and Row
are firing phenomena but there are no text
elements.
To create the text element and force the event handler, click on it below my code.
Function texturelabel (cx, cy, llb, color) {var svgns = "http://www.w3.org/2000/svg"; Var tlbl = document.createElementNS (svgns, "text"); Tlbl.setAttribute ("fill", color); Tlbl.setAttribute ("x", cx); Tlbl.setAttribute ("y", cy); Tlbl.textContent = lbl; Tlbl.setAttributeNS (empty, "square", "TKLBL"); Tlbl.setAttributeNS (empty, "onMosOver", overtail label); Return TLLL; } Function overTickLabel (evt) {// This function has not been executed on mouseover $ ("# preview_grid"). Trigger ("mouseover"); Console.log (evt); }
Thanks.
Comments
Post a Comment