无法使用$ .Velocity.RunSequence循环播放动画序列

时间:2017-05-30 11:56:09

标签: javascript animation css-animations velocity.js

我正在尝试使用Velocity UI库循环一系列动画,但序列成功运行一次然后停止。

我尝试在animationSequence之后添加{loop:" true"},但它没有工作。请帮忙。

以下是剧本:

var animationSequence = [
{ 
  e: $(".custom-set-1"), 
  p: { opacity: 1 }, 
  o: { duration: 1000 } 
}, { 
  e: $(".custom-set-1"), 
  p: { opacity: 0 }, 
  o: { duration: 1000, delay: 3500 } 
}, { 
  e: $(".custom-set-2 .text-1"), 
  p: { opacity: 1 }, 
  o: { duration: 1000 } 
}, { 
  e: $(".custom-set-2 .text-2"), 
  p: { opacity: 1 }, 
  o: { duration: 1000, delay: 1000 } 
}, { 
  e: $(".custom-set-2 .text-1"), 
  p: { opacity: 0 }, 
  o: { duration: 1000, delay: 3500 } 
}, { 
  e: $(".custom-set-2 .text-2"), 
  p: { opacity: 0 }, 
  o: { duration: 1000 } 
}, { 
  e: $(".custom-set-3 .text-1"), 
  p: { opacity: 1 }, 
  o: { duration: 1000 } 
}, { 
  e: $(".custom-set-3 .text-2"), 
  p: { opacity: 1 }, 
  o: { duration: 1000, delay: 1000 } 
}, { 
  e: $(".custom-set-3 .text-1"), 
  p: { opacity: 0 }, 
  o: { duration: 1000, delay: 3500 } 
}, { 
  e: $(".custom-set-3 .text-2"), 
  p: { opacity: 0 }, 
  o: { duration: 1000 } 
}, { 
  e: $(".custom-set-4"), 
  p: { opacity: 1 }, 
  o: { duration: 1000 } 
}, { 
  e: $(".custom-set-4"), 
  p: { opacity: 0 }, 
  o: { duration: 1000, delay: 3500 } 
}, { 
  e: $(".custom-set-5"),
  p: { opacity: 1 }, 
  o: { duration: 1000 } 
}, { 
  e: $(".custom-set-5"), 
  p: { opacity: 0 }, 
  o: { duration: 1000, delay: 3500 } 
}];

$.Velocity.RunSequence(animationSequence, {loop: "true"});

0 个答案:

没有答案