我正在使用QueryLoader2,我希望从fadeInUp
和#projects-list
中移除footer p
类,但由于某种原因,它不会这样做。我希望在slideDown()
的回调函数之后立即删除这些类。我的格式不正确吗?
window.addEventListener('DOMContentLoaded', function() {
new QueryLoader2(document.querySelector("body"), {
barColor: "#fff",
backgroundColor: "#000",
percentage: true,
barHeight: 1,
minimumTime: 200,
fadeOutTime: 0,
onComplete: function() {
$('#masthead').slideDown(100, function(){
$('#projects-list, footer p').show().addClass('fadeInUp');
});
$('#projects-list, footer p').removeClass('fadeInUp');
}
});
});
答案 0 :(得分:1)
根据上面的代码,您将删除该类,然后在100ms后添加它。这使得它看起来不会删除fadeInUp
类。
或者:
setTimeout
或slideDown
完整功能中。答案 1 :(得分:0)
我没有测试过这个,但尝试这样的事情:
onComplete: function() {
$('#masthead').slideDown(100, function(){
//this is very you should have your code that you want to execute after
// slide down
$('#projects-list, footer p').removeClass('fadeInUp');
// do you need the line below?
//$('#projects-list, footer p').show().addClass('fadeInUp');
});
}