Link to home
Start Free TrialLog in
Avatar of darren-w-
darren-w-Flag for United Kingdom of Great Britain and Northern Ireland

asked on

Animation would like to fire off multiple squares

Hi,

on this page it the starts out by placing images using a bit of animation, what I would like to do is send them simutanusly say start another when the previous is half way, can anyone suggest a way of doing this?

Here is the present source:

$(function(){
    var t = [1,3,6,8,14,25,17,20,28,38,31,23]
    
    loopy();    
    
    function loopy(place){
        if(typeof(place) == 'undefined' ){
            place = 1;
        } 
        window.setTimeout(function() {
            $('#launchpad').empty();
            var end = $('div#pic'+t[place-1]);
            var image = end.clone().attr({
                width:0,
                height:0,
                'id':'star'
            });
            var post =end.offset(); 
            var pos =end.position(); 
            var tp = (post.top-157)+42;
            var lt = (pos.left-5)+42;
            $('#launchpad').append(image);   
            $("#star")
            .animate({
                opacity:0.1,
                top:tp,
                left:lt,
                width:'42px',
                height:'42px'
            },Math.sqrt(Math.pow(pos.top,2) + Math.pow(pos.left,2))*2)
            .hide('slow',function(){
                end.css('visibility','visible') 
                loopy(place+1)
            }) 
        },100)
    }       
});

Open in new window


Darren
ASKER CERTIFIED SOLUTION
Avatar of sunu340
sunu340
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of darren-w-

ASKER

Thanks, not finished this yet so may come back to it a later date, but will close to clear