Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一些代码充当预加载器,在所有 JS 加载之前显示。唯一的问题是我看到预加载器出现在进入页面的内容的顶部。
如何调整下面的代码以淡出“#loading-mask”div,以空白屏幕暂停 0.5 秒,然后淡入我的页面内容?
主要目标是阻止两者重叠
这是我的代码:
$('#loading-mask').fadeOut();
$('#loading-mask').fadeOut(500, function() { setTimeout(500); $('#content').fadeIn() });