I am trying to add an animation effect to an SVG Path when a button is clicked
JSFiddle as requested: http://jsfiddle.net/xH7FF/
I have the following animation:
.path {
stroke-dasharray: 1000;
stroke-dashoffset: 1000;
animation: dash 5s linear alternate infinite;
}
@keyframes dash {
from {
stroke-dashoffset: 1000;
}
to {
stroke-dashoffset: 0;
}
}
So when a button is clicked
$("#buttonhere").click(function(){
$("#pathname").addClass("path");
}
It should add the class to the path, and the animation should start, but it does not. Anybody know if these is possible, and if so what I am doing wrong, or what I can do to fix it. Thanks!