开发者

Adding JQuery Pre-Loader gif to a script/function

How do I add a pre-loder to this script? I already have the animated gif. When I say preloader, I mean the spinning gif.

$(function(){
            // Set starting slide to 1
            var startSlide = 1;
            // Get slide number if it exists
            if (window.location.hash) {
                startSlide = window.location.hash.replace('#','');
            }
            // Initializ开发者_运维问答e Slides
            $('#slides').slides({
                preload: true,
                crossfade: true,
                effect: 'fade',
                fadeEasing: "easeOutQuad",
                fadeSpeed: 400,
                play: 5000,
                pause: 2500,
                hoverPause: true,
                // Get the starting slide
                start: startSlide,
                animationComplete: function(current){
                    // Set the slide number as a hash
                    window.location.hash = '#' + current;
                }
            });
        });

Thanks for the knowledge!

Overmars


I don't what have you altered in your plugin. For an unchanged slidejs plugin to set the spinning gif you have to just specify the preloadImage.

preloadImage (string)
Name and location of loading image for preloader.
Default path is "/img/loading.gif".

An example is

$('#slides').slides({
    preload: true,
    preloadImage: '/img/loading.gif',
    play: 5000,
    pause: 2500,
    hoverPause: true
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜