滑块未与$(window).load一起运行 [英] slider not running with $(window).load

查看:150
本文介绍了滑块未与$(window).load一起运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,从上一个问题出发,我没有正确解释的新角度

OK, new angle from previous question which I didn't explain properly here:

我们的开发人员站点的滑块在这里可以完美运行:

Our dev site has the slider working perfectly here:

http://allblacks.01dev.co.nz/index.cfm ?layout = dnaHome

但是,我们只是将该站点上线了,它在这里不起作用:

However, we've just put the site live and it's not working here:

http://www .allblacks.com/index.cfm?layout = dnaHome

我已将问题隔离到以下代码中.该警报在01dev站点上触发,但不在实时站点上触发.

I have isolated the problem to the following piece of code. The alert fires on the 01dev site, but not on the live site.

$(window).load(function () {
            $('.wraplines a, .wraplines .wrapspan').wraplines().addClass('wrapped clearfix');
            alert('here');

            $('.carousel').each(function () {
                $(this).Waterfall({
                    autoStart: $(this).data('autostart'),
                    startAt: $(this).data('startat'),
                    infiniteScroll: $(this).data('infinitescroll'),
                    hasPager: $(this).data('haspager')
                });
            });
        });

有人可以帮助我理解这一点吗?

Can someone help me understand this?

早先已经有一个$(document).ready ...,如下所示:

There's already a $(document).ready... earlier on, as below:

(function ($) {
    "use strict";

    $(document).ready(function () {
        var html = $('html'),
            body = $('body'),
            header = $('.header'),
            searchTrigger = $('.search'),
            searchPane = $('.search-pane');

        html.removeClass('no-js');

        $(window).load(function () {
            $('.wraplines a, .wraplines .wrapspan').wraplines().addClass('wrapped clearfix');
            alert('here');

            $('.carousel').each(function () {

                $(this).Waterfall({
                    autoStart: $(this).data('autostart'),
                    startAt: $(this).data('startat'),
                    infiniteScroll: $(this).data('infinitescroll'),
                    hasPager: $(this).data('haspager')
                });
            });
        });

推荐答案

我们确定问题与未正确调用thickbox javascript或某种类型的冲突有关.我们将thickbox js调用移到了js调用列表的顶部(在jQuery.js调用之前),这似乎可以解决问题.

We determined the problem was related to thickbox javascript not being called properly or some type of conflict. We moved the thickbox js call to the top of the list of js calls (ahead of the jQuery.js call) and this seemed to solve the problem.

这篇关于滑块未与$(window).load一起运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆