我需要每5秒用Javascript中的fadeInDown和fadeOutDown效果更改單詞。 我有一組不同的單詞要顯示。我已經使用以下鏈接進行動畫製作,但是當單詞改變時它沒有動畫效果。需要用fadeinDown和fadeOutDown效果動畫單詞
動畫:http://jschr.github.io/textillate/
II。在動畫中,選擇'fadeInDown'+'同步' iii。對於出場的動畫,選擇「fadeOutDown」 +「同步
要想改變的話我用下面的代碼
<script>
$(function() {
var messages = [],
index = 0;
messages.push('awesome');
messages.push('incredible');
messages.push('cool');
messages.push('fantastic');
function cycle() {
$('#some-id').html(messages[index]);
index++;
if (index === messages.length) {
index = 0;
}
setTimeout(cycle, 5000);
}
cycle();
});
</script>
HTML code :
<div>
This is so<span id="some-id">awesome</span>
</div>
是你的問題如何添加jQuery的褪色或如何添加此textillate庫的動畫? – lossleader 2014-11-02 12:14:04