thanks, both of those work on the codepen.. I was sure Id tried that!
but the problem is complicated in that i really want to select all of a class to each be animated:
How should I do that? Ive seen somewhere that the selector should be $(".classname") but that dont work!
grateful for help
--
the js is like this:
var peep=new Array();
$(document).ready(function(){
for (j=0; j<=20; j++) { /// no of paths
var randx=parseInt(getRandom(0,1800));
var y=900;
peep[j] = document.createElementNS('http://www.w3.org/2000/svg' 'ellipse');
peep[j].setAttributeNS("null", "class", "peeple");
peep[j].setAttributeNS(null, "cx", randx);
peep[j].setAttributeNS(null, "cy", y);
peep[j].setAttributeNS(null, "rx", getRandom(15,20));
peep[j].setAttributeNS(null, "ry", getRandom(20,40));
peep[j].setAttributeNS(null, "fill", "grey");
peep[j].setAttributeNS(null, "stroke", "none");
document.getElementById("svg").appendChild(peep[j]);
}
var tl = new TimelineMax({repeat:-1, yoyo:true});
tl.to($("#wob"), 1, {rotation:"90", transformOrigin:"left top"});
});
function getRandom(min, max) {
return (Math.random() * (max - min) + min);
}