Jquery: syntax for inserting a function

Posted by kelly on Stack Overflow See other posts from Stack Overflow or by kelly
Published on 2010-06-10T22:14:59Z Indexed on 2010/06/10 22:22 UTC
Read the original article Hit count: 278

Filed under:

I'm trying to integrate an animation by using the bezier path plug-in and I can't seem to implement it right.

Stripped down, here's what I have:

    $('#next2btn').live('click', function(){
       $(this).attr('id','next3btn');
        $('#content2').show(300, function() {
            $('#account').fadeTo(500,1.0)
            var arc_params = {
                center: [278,120],
                radius: 186,
                start: -90,
                end: 90,
                dir: -1
                };
            });
        $("#account").animate({path : new $.path.arc(arc_params)},1000);
});

So, I'm trying to add this piece of code into what I have:

    var arc_params = {
                center: [278,120],
                radius: 186,
                start: -90,
                end: 90,
                dir: -1
              };
        });
$("#account").animate({path : new $.path.arc(arc_params)},1000)

which works on its own as does the other.

I'm thinking it's something about declaring that variable and where I do that.

I'm essentially chaining a few different animations/actions upon a button click.

Thanks for any insight- kj

© Stack Overflow or respective owner

Related posts about jQuery