我需要每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