【问题标题】:Jquery preloader & wow.jsJquery 预加载器和 wow.js
【发布时间】:2015-06-03 18:46:20
【问题描述】:

我正在使用wow.js plugin & a jquery preload tutorial

预加载器工作正常,但是当它预加载页面上的元素时,wow.js 动画已经结束。我想编辑我的代码,以便在预加载所有内容之后动画将开始。

我已阅读此question & answer,但它不适用于我的代码。

我的代码:

// makes sure the whole site is loaded
jQuery(window).load(function() {
    // will first fade out the loading animation
    jQuery("#status").fadeOut();

    // will fade out the whole DIV that covers the website.
    jQuery("#preloader").delay(500).fadeOut("slow");          
})

如果有人能帮助我,那就太好了, 谢谢!

【问题讨论】:

  • 如果您使用预加载器而不是使用 PaceJs 库,它会自动处理页面加载和 Ajax 请求的加载,并且非常容易,因此两者不会发生冲突。

标签: javascript jquery wow.js


【解决方案1】:

使用以下代码通过您的自定义预加载代码实现 wow js。

// makes sure the whole site is loaded
jQuery(window).load(function() {
// will first fade out the loading animation
jQuery("#status").fadeOut();

// will fade out the whole DIV that covers the website.
jQuery("#preloader").delay(500).fadeOut("slow");

// Here will be the WoW Js implementation.   
setTimeout(function(){new WOW().init();}, 1000);          
})

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-01-28
    • 1970-01-01
    • 2016-02-14
    • 1970-01-01
    • 2011-05-20
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多