我是JavaScript的新手,正在学习如何使用blast.js。我拍摄了一个基本的脚本,该脚本可通过单击生成动画。页面加载后如何制作动画?
$(function() {
$('#test').on('click', function() {
// Blasts the title
var words = $('h1').blast({
delimiter: 'word'
});
words.each(function(i) {
// Initialization of the position
$(this).css({
position: 'relative',
top: 150,
})
.delay(i * 70)
.animate({
top: '50px'
}, 400, );
});
});
});
答案 0 :(得分:0)
尝试
$(function() {
// Blasts the title
var words = $('h1').blast({
delimiter: 'word'
});
words.each(function(i) {
// Initialization of the position
$(this).css({
position: 'relative',
top: 150,
})
.delay(i * 70)
.animate({top: '50px'}, 400,);
});
});