滑块(flexslider)在页面加载时加载速度不够快吗? [英] Slider (flexslider) NOT loading fast enough on page load?

查看:85
本文介绍了滑块(flexslider)在页面加载时加载速度不够快吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,一个巨大的问题是我的flexslider加载速度不够快.从Google chrome上的网络报告动态加载到滑块中的图像表明它们的加载速度不够快.

A massive problem at the moment is that my flexslider DOES NOT load fast enough. The images that are dynamically loaded into the slider from the network report on google chrome show that they aren't loading fast enough.

存在足够大的延迟,以至于我不太满意,并且理想情况下,它希望尽可能快地加载滑块及其图像,因此用户不必等待它加载.

Theres a big enough delay that im not very happy and ideally would like to make the slider and its images loaded as fast as possibly so the user will not have to wait for it to load.

与脚本相关或与DNS相关. IM非常困惑为什么需要这么长时间才能加载.

It is script related or DNS related. IM very confused as to why its taking so long to load.

推荐答案

此后,我已对此脚本进行了编辑.它似乎减少了时间,但是仍然有点慢.

I have since edited the script to this. It has seemed to cut the amount of time, but still loads a tad to slow.

   $(document).ready(function () {
        var urls = [
            'http://fantasyfootballpundits.com/football/?category=Captaincy+Analysis&format=json&callback=?',
            'http://fantasyfootballpundits.com/football/?category=The+Gameweek+Preview&format=json&callback=?',
            'http://fantasyfootballpundits.com/football/?category=In+The+News&format=json&callback=?',
            'http://fantasyfootballpundits.com/football/?category=Pundits+Team&format=json&callback=?',
            'http://fantasyfootballpundits.com/football/?category=Shrewd+Moves&format=json&callback=?',
            'http://fantasyfootballpundits.com/football/?category=Shrewd+Moves&format=json&callback=?',
            'http://fantasyfootballpundits.com/football/?category=Guest+Fantasy+Articles&format=json&callback=?'
        ];

        urls.forEach(function (u) {
            $.getJSON(u).done(function (data) {
                var current = data.items[0];
                if (current != null) {
                    var post = '<li><a href="http://fantasyfootballpundits.com' + current.fullUrl + '"><img src= "' + current.assetUrl + '" alt ="' + current.filename + '"></a></li>';
                    $('ul.slides').append(post);
                }
            });
        });

    });

这篇关于滑块(flexslider)在页面加载时加载速度不够快吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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