我正在使用Velocity UI庫進行文本動畫。我註冊了兩個效果(在& Out中,因此它處理顯示屬性),並且它們按順序運行。我如何循環序列?我試圖在序列中的最後一個選項中觸發它,但它不起作用(因爲序列的運行不是函數)。循環Velocity.js自定義效果序列
我在堆棧溢出和Github上找到了答案,但是我找不到答案。請給我一個建議,把它放在一個無限循環中是一個好方法。謝謝!
$.Velocity.RegisterUI("mythingIn", {
calls: [
[{ color: "#fff", opacity: 1 }, 0.5],
[{ color: "#ffac00" }, 0.5]
]
});
$.Velocity.RegisterUI("mythingOut", {
calls: [
[{ opacity: 0 }]
]
});
var a1wordflow1 = [
{ e: $('.a1w-1-1'), p: ("mythingIn"), o: { stagger: 70, duration: Math.random()*6000+14000 } },
{ e: $('.a1w-1-1'), p: ("mythingOut"), o: { stagger: 70, duration: 800 } },
{ e: $('.a1w-1-2'), p: ("mythingIn"), o: { stagger: 70, duration: Math.random()*6000+14000 } },
{ e: $('.a1w-1-2'), p: ("mythingOut"), o: { stagger: 70, duration: 800 } },
];
$.Velocity.RunSequence(a1wordflow1);
你能夠提供一個Codepen或類似的,我們可以看看你的代碼的結果,並能夠幫助你運行循環? –
它在測試頁面上運行,具有完整的數據:[link](http://www.viragcukor.hu/landing-v1.php)。我很快就創建了一個Codepen。 – Helga
太棒了,請在設置工作的Codepen時註釋。 –