所以我有这个脚本,用于在页面加载时显示这个定位图形。
$(window).load(function() { // makes sure the whole site is loaded
$("#status").fadeOut(); // will first fade out the loading animation
$("#preloader").delay(100).fadeOut("fast"); // will fade out the white DIV that covers the website.
})
这会在页面加载时立即显示。知道如何在页面退出时显示这个节目吗?那么对于用户来说,它从点击到加载是一致的吗?
最佳答案
使用卸载
。
$(window).unload(function() {
$("#status").fadeOut();
$("#preloader").delay(100).fadeOut("fast");
});
关于链接上的 jQuery 单击以启用加载图形,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14451112/