简体   繁体   中英

Animating several elements at the same time?

I saw another post on here saying this would work - and it's definitely not. Wondering why these are not all executing at once?

I am simply trying to get the top and opacity animations to happen at once. Here's a fiddle: http://jsfiddle.net/DU8N2/

$(".wordcar").animate({
       top:"32px"
    }, { duration: 2000, queue: false });
    $(".wordcar li.next").animate({
       opacity:"1"
    }, { duration: 2000, queue: false });
    $(".wordcar li.current").animate({
       opacity:"0.2"
    }, { duration: 2000, queue: false });
     $(".wordcar li.ondeck").animate({
       opacity:"0.2"
    }, { duration: 2000, queue: false });
     $(".wordcar li.previous").animate({
       opacity:"0.0"
    }, { duration: 2000, queue: false });

It's not in a queue. Try setting the fade animations duration: 1000 , instead of 2000 and there you have your magic.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM