Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  • Thread Tools
  • Rate This Thread
  1. #1
    New to the CF scene
    Join Date
    May 2016
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Animate multiple width in a single line of code

    Hi there,

    I'm wondering if is possible to load an animation with different width and a small delay each time the width gets bigger.

    For example:

    This is the original code:

    The css for the <div cortana_blurb> is set to width: 0;

    MU.showBlurb = function(){
    TweenMax.to(cortana_blurb, .15, {width: 34, ease:Linear.easeNone}), .4;
    TweenMax.to(cortana_blurb, .15, {width:64, ease:Linear.easeNone, delay:.4 });
    TweenMax.to(cortana_blurb, .15, {width:111, ease:Linear.easeNone, delay:.8 });
    TweenMax.to(cortana_blurb, .15, {width:144, ease:Linear.easeNone, delay:1.2 });
    TweenMax.to(cortana_blurb, .15, {width:204, ease:Linear.easeNone, delay:1.6 });
    }

    What I want is to minimize it to one line code like:

    MU.showBlurb = function(){
    TweenMax.to(cortana_blurb, .15, {width: 34, 64, 111, 144, 204, ease:Linear.easeNone}), .4;
    }

    I know it's a trick one, but if there is a way to do it and you guy could help me it will be great.

    Kind regards,

    Fernando Fas

  2. #2
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,364
    Thanks
    52
    Thanked 531 Times in 525 Posts
    You may be disappointed with the response to your queries in this section of the forum.
    It is meant for completed code (code that works), not questions about coding.
    You would be wise to move it to the appropriate section of the forums
    and read the purpose of each section of the forums in the "sticky" area.

  3. #3
    $object->toCD-R(LP); vinyl-junkie's Avatar
    Join Date
    Jun 2003
    Posts
    3,197
    Thanks
    2
    Thanked 30 Times in 30 Posts
    Thread has been moved to the JavaScript Programming forum.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more
    SNAP to it!

  4. #4
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    4,595
    Thanks
    14
    Thanked 480 Times in 475 Posts
    I know it's a trick one, but if there is a way to do it and you guy could help me it will be great.
    not gonna work unless TweenMax supports it (=> check its documentation) or you modify TweenMax's source code to do that. (although right now it errors out due to the syntax error you wrote)
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  5. #5
    New to the CF scene
    Join Date
    May 2016
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks guys. I'm sorry to post it on the wrong thread. I'm new on the forum and I will make it better next time.

    Thanks for all your replies and concerns.

    Kind regards,

    Fernando Fas


 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •