I have an SVG file with a js function defined inside (performing some GreenSock animations). The SVG simplified :
<svg baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" >
<script type="text/javascript">
var tl = new TimelineMax({paused: "true"});
function hideShapes() {
tl.reverse();
}
function animateJS(svg) {
tl
.to(svg, 1, {delay: 1, attr:{viewBox:"-120 -96 392 96"}} )
.staggerTo(".symbol_copy", 1, {
autoAlpha: true,
svgOrigin: "8px 56px",
cycle: {
rotation: [-100,-75,-50,-25],
rotationZ: 0.001,
delay: function(index) { return 0.7-(0.15 * index); }
}
},
0
);
tl.play();
}
</script>
</svg>
I am looking for a way to call the animateJS
function from the JQuery code.