【问题标题】:jQuery on link click to enable a loading graphicjQuery 上的链接单击以启用加载图形
【发布时间】:2013-01-22 03:29:34
【问题描述】:

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

    $(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.
    })

这会在页面加载时立即显示。知道如何在页面退出时进行此显示吗?那么对于用户来说,从点击到加载是一致的吗?

【问题讨论】:

  • 也许$(document).ready(function(){}) ?
  • 什么是`$(window).unload(function()`

标签: jquery css html page-loading-message


【解决方案1】:

使用unload

$(window).unload(function() {
        $("#status").fadeOut(); 
        $("#preloader").delay(100).fadeOut("fast"); 
});

【讨论】:

    猜你喜欢
    • 2019-07-06
    • 1970-01-01
    • 2019-08-25
    • 1970-01-01
    • 2011-04-21
    • 1970-01-01
    • 1970-01-01
    • 2021-06-11
    • 1970-01-01
    相关资源
    最近更新 更多