(function($) {
    $.fn.fadeslider = function(options) {

        var defaults = {
            time: 6000,
            displayCount: 3
        };

        var options = $.extend(defaults, options);

        return this.each(function() {
            var show = 3;
            var current = 0;
            var length;

            var slider = $(this);
            var sliderItems = slider.children("li");
            length = sliderItems.length;
            slider.children("li:gt(2)", this).hide();


            setInterval(function() {

                sliderItems.eq(current).fadeOut(1000, function() {
                    sliderItems.eq(current + (show - 1)).show();

                });
                current++;
                if (current == length) {
                    slider.children("li:gt(2)", this).hide();
                    for (i = 0; i <= (show - 1); i++) {
                        slider.children("li:nth-child(" + i + ")", this).show();
                    }
                    current = 0;
                }
            }, options.time);

        });
    };
})(jQuery);  
