Add image to animated gif using javascript -



Add image to animated gif using javascript -

i'd to, using javascript if possible, add together images (small stars) existing animated gif. there can little 0 stars, many 10, number not known until gif loaded on page. it'd bonus if stars "float" around image.

a cursory search around , google resulted in not much on subject. i'm wondering if i'm not searching using right terms.

can point me in right direction or give me illustration of similar?

so... this?

http://jsfiddle.net/caseyrule/e0a98pdu/3/

var w = $('#gifcontainer').width() - 12; var h = $('#gifcontainer').height() - 12; var stars = []; function randomlypositionstar( star ) { var x = (math.random() * w); var y = (math.random() * h); star.style.transform = 'translate('+x+'px,'+y+'px)'; } for(var = 0; i<10; i++ ){ var starsrc = 'http://upload.wikimedia.org/wikipedia/en/archive/6/60/20060130131745!linkfa-star.png'; var star = new image(); star.src = starsrc; star.classname = 'star'; randomlypositionstar( star ); $('#gifcontainer').append(star); stars.push( star ); } setinterval( function() { var = math.floor(math.random() * stars.length); randomlypositionstar( stars[i] ); }, 100);

javascript gif

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -