Choosing inline SVG and jQuery
I have an embedded SVG in an HTML file. This SVG has an animation inside with the id "move".
If I call this animation using jQuery 1.9.1 to change its attributes like:
$("#move").attr("from", "500");
it works fine (at least in Firefox 16.0.1, I haven't tested other browsers).
If I try to run the animation using jQuery like this:
$("#move").beginElement();
it doesn't work, again in Firefox.
If I call it with JavaScript like this:
var move=document.getElementById("move");
move.beginElement();
it works.
How do I call a function beginElement()
using jQuery?
Thank.
+3
user2088176
source
to share
1 answer
This will do what you ask ...
$("#move")[0].beginElement();
Without knowing more, I cannot say much more. jQuery()[0]
returns a DOM element, not a jQuery object.
+1
Archer
source
to share