链接上的 jQuery 单击以启用加载图形

标签 jquery css html page-loading-message

所以我有这个脚本,用于在页面加载时显示这个定位图形。

    $(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/

相关文章:

javascript - 将文本传递到Twitter Web Intent时的未定义值

javascript - Jquery/ajax循环SetTimeout

css - IE 11 无法正确处理字体声明

html - 如何确保网站适合所有屏幕分辨率?

html - 如何对齐正文内容使其与页眉和页脚对齐

javascript - 如何将类添加到div中的当前事件div

jquery - 如何将自定义行为附加到 jsTree 中的双击?

html - 为什么默认情况下 css 不支持变量和层次结构?

javascript - 使用 readAsDataURL 检索原始图像时的图像方向

jquery - 显示具有不同标题的同一 div 的多个实例