我使用jQuery libary類型,它在這裏找到:http://macarthur.me/typeit/docs/如何在每次字符串迭代後調用回調函數?
這裏是我的代碼
$('.type-it').typeIt({
strings: ['Text 1','Text 2'],
speed: 110,
breakLines: false,
callback: function() { $('.type-it').css('background-color', '#EFC137').delay(1000).queue(function() {$('.type-it').empty() }) }
})
.tiPause(1000);
我想要做的就是運行的回調函數,每個字符串類型,而不是之後畢竟字符串鍵入。
任何想法?
在此先感謝。
https://jsfiddle.net/pj3frgtt/ –
回調函數不是從每次迭代觸發我覺得從該庫和它不提供返回的值,則需要請使用[MutationObserver]示例(https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver) – Roljhon
但我希望它在每次迭代後都能運行。 –