1 回答

TA贡献1829条经验 获得超9个赞
将你的第二部分放入一个单独的函数中,然后使用settimeout(你可以自己调整时间)
$('#startButton').on('click', function() {
// run animation on click
document.getElementById("rightHand").animate([
{ transform: 'translateY(80px)' },
{ transform: 'translateY(0px)' }
], {
duration: 100
});
// say after 3 seconds to trigger secondpart
setTimeout(function(){ secondpart(); }, 3000);
});
function secondpart()
{
//run second part
$('#portfolio').show();
$('.footer').show();
var hash = $('#portfolioSection');
$('html, body').animate({
scrollTop: $(hash).offset().top
}, 800);
}
添加回答
举报