Вход Регистрация
Файл: CloudBox-main/doc/js/jquery.jcarousel.min.js
Строк: 727
<?php
/*!
 * jCarousel - Riding carousels with jQuery
 *   http://sorgalla.com/jcarousel/
 *
 * Copyright (c) 2006 Jan Sorgalla (http://sorgalla.com)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * Built on top of the jQuery library
 *   http://jquery.com
 *
 * Inspired by the "Carousel Component" by Bill Scott
 *   http://billwscott.com/carousel/
 */
(function (a) {
    var 
= {
        
vertical: !1,
        
rtl: !1,
        
start1,
        
offset1,
        
sizenull,
        
scroll1,
        
visible1,
        
animation2000,
        
easing"swing",
        
auto3,
        
wrapnull,
        
initCallbacknull,
        
setupCallbacknull,
        
reloadCallbacknull,
        
itemLoadCallbacknull,
        
itemFirstInCallbacknull,
        
itemFirstOutCallbacknull,
        
itemLastInCallbacknull,
        
itemLastOutCallbacknull,
        
itemVisibleInCallbacknull,
        
itemVisibleOutCallbacknull,
        
animationStepCallbacknull,
        
buttonNextHTML"<div></div>",
        
buttonPrevHTML"<div></div>",
        
buttonNextEvent"click",
        
buttonPrevEvent"click",
        
buttonNextCallbacknull,
        
buttonPrevCallbacknull,
        
itemFallbackDimensionnull
    
}, = !1;
    
a(window).bind("load.jcarousel", function () {
        
= !0
    
}), a.jcarousel = function (ef) {
        
this.options a.extend({}, b|| {}), this.locked = !1this.autoStopped = !1this.container nullthis.clip nullthis.list = nullthis.buttonNext nullthis.buttonPrev nullthis.buttonNextState nullthis.buttonPrevState null&& void 0 !== f.rtl || (this.options.rtl "rtl" == (a(e).attr("dir") || a("html").attr("dir") || "").toLowerCase()), this.wh this.options.vertical "height" "width"this.lt this.options.vertical "top" this.options.rtl "right" "left";
        for (var 
""e.className.split(" "), 0h.length ii++)
            if (-
!= h[i].indexOf("jcarousel-skin")) {
                
a(e).removeClass(h[i]), h[i];
                break
            }
            
"UL" == e.nodeName.toUpperCase() || "OL" == e.nodeName.toUpperCase() ? (this.list = a(e), this.clip this.list.parents(".jcarousel-clip"), this.container this.list.parents(".jcarousel-container")) : (this.container a(e), this.list = this.container.find("ul,ol").eq(0), this.clip this.container.find(".jcarousel-clip")), === this.clip.size() && (this.clip this.list.wrap("<div></div>").parent()), === this.container.size() && (this.container this.clip.wrap("<div></div>").parent()), "" !== && -== this.container.parent()[0].className.indexOf("jcarousel-skin") && this.container.wrap('<div class=" ' '"></div>'), this.buttonPrev a(".jcarousel-prev"this.container), === this.buttonPrev.size() && null !== this.options.buttonPrevHTML && (this.buttonPrev a(this.options.buttonPrevHTML).appendTo(this.container)), this.buttonPrev.addClass(this.className("jcarousel-prev")), this.buttonNext a(".jcarousel-next"this.container), === this.buttonNext.size() && null !== this.options.buttonNextHTML && (this.buttonNext a(this.options.buttonNextHTML).appendTo(this.container)), this.buttonNext.addClass(this.className("jcarousel-next")), this.clip.addClass(this.className("jcarousel-clip")).css({
            
position"relative"
        
}), this.list.addClass(this.className("jcarousel-list")).css({
            
overflow"hidden",
            
position"relative",
            
top0,
            
margin0,
            
padding0
        
}).css(this.options.rtl "right" "left"0), this.container.addClass(this.className("jcarousel-container")).css({
            
position"relative"
        
}), !this.options.vertical && this.options.rtl && this.container.addClass("jcarousel-direction-rtl").attr("dir""rtl");
        var 
null !== this.options.visible Math.ceil(this.clipping() / this.options.visible) : null,
            
this.list.children("li"),
            
this;
        if (
k.size() > 0) {
            var 
0,
                
this.options.offset;
            
k.each(function () {
                
l.format(thisn++), += l.dimension(thisj)
            }), 
this.list.css(this.wh100 "px"), && void 0 !== f.size || (this.options.size k.size())
        }
        
this.container.css("display""block"), this.buttonNext.css("display""block"), this.buttonPrev.css("display""block"), this.funcNext = function () {
            return 
l.next(), !1
        
}, this.funcPrev = function () {
            return 
l.prev(), !1
        
}, this.funcResize = function () {
            
l.resizeTimer && clearTimeout(l.resizeTimer), l.resizeTimer setTimeout(function () {
                
l.reload()
            }, 
100)
        }, 
null !== this.options.initCallback && this.options.initCallback(this"init"), !&& d.isSafari() ? (this.buttons(!1, !1), a(window).bind("load.jcarousel", function () {
            
l.setup()
        })) : 
this.setup()
    };
    var 
a.jcarousel;
    
d.fn d.prototype = {
        
jcarousel"0.2.9"
    
}, d.fn.extend d.extend a.extendd.fn.extend({
        
setup: function () {
            if (
this.first nullthis.last nullthis.prevFirst nullthis.prevLast nullthis.animating = !1this.timer nullthis.resizeTimer nullthis.tail nullthis.inTail = !1, !this.locked) {
                
this.list.css(this.ltthis.pos(this.options.offset) + "px");
                var 
this.pos(this.options.start, !0);
                
this.prevFirst this.prevLast nullthis.animate(b, !1), a(window).unbind("resize.jcarousel"this.funcResize).bind("resize.jcarousel"this.funcResize), null !== this.options.setupCallback && this.options.setupCallback(this)
            }
        },
        
reset: function () {
            
this.list.empty(), this.list.css(this.lt"0px"), this.list.css(this.wh"10px"), null !== this.options.initCallback && this.options.initCallback(this"reset"), this.setup()
        },
        
reload: function () {
            if (
null !== this.tail && this.inTail && this.list.css(this.ltd.intval(this.list.css(this.lt)) + this.tail), this.tail nullthis.inTail = !1null !== this.options.reloadCallback && this.options.reloadCallback(this), null !== this.options.visible) {
                var 
this,
                    
Math.ceil(this.clipping() / this.options.visible),
                    
0,
                    
0;
                
this.list.children("li").each(function (d) {
                    
+= a.dimension(thisb), a.first && (c)
                }), 
this.list.css(this.wh"px"), this.list.css(this.lt, -"px")
            }
            
this.scroll(this.first, !1)
        },
        
lock: function () {
            
this.locked = !0this.buttons()
        },
        
unlock: function () {
            
this.locked = !1this.buttons()
        },
        
size: function (a) {
            return 
void 0 !== && (this.options.size athis.locked || this.buttons()), this.options.size
        
},
        
has: function (ab) {
            
void 0 !== && || (a), null !== this.options.size && this.options.size && (this.options.size);
            for (var 
a>= cc++) {
                var 
this.get(c);
                if (!
d.length || d.hasClass("jcarousel-item-placeholder")) return !1
            
}
            return !
0
        
},
        
get: function (b) {
            return 
a(">.jcarousel-item-" bthis.list)
        },
        
add: function (bc) {
            var 
this.get(b),
                
0,
                
a(c);
            if (
=== e.length) {
                var 
hd.intval(b);
                for (
this.create(b);;)
                    if (
this.get(--i), >= || h.length) {
                        
>= this.list.prepend(e) : h.after(e);
                        break
                    }
            } else 
this.dimension(e);
            
"LI" == g.get(0).nodeName.toUpperCase() ? (e.replaceWith(g), g) : e.empty().append(c), this.format(e.removeClass(this.className("jcarousel-item-placeholder")), b);
            var 
null !== this.options.visible Math.ceil(this.clipping() / this.options.visible) : null,
                
this.dimension(ej) - f;
            return 
&& this.first && this.list.css(this.ltd.intval(this.list.css(this.lt)) - "px"), this.list.css(this.whd.intval(this.list.css(this.wh)) + "px"), e
        
},
        
remove: function (a) {
            var 
this.get(a);
            if (
b.length && !(>= this.first && this.last >= a)) {
                var 
this.dimension(b);
                
this.first && this.list.css(this.ltd.intval(this.list.css(this.lt)) + "px"), b.remove(), this.list.css(this.whd.intval(this.list.css(this.wh)) - "px")
            }
        },
        
next: function () {
            
null === this.tail || this.inTail this.scroll("both" != this.options.wrap && "last" != this.options.wrap || null === this.options.size || this.last != this.options.size this.first this.options.scroll 1) : this.scrollTail(!1)
        },
        
prev: function () {
            
null !== this.tail && this.inTail this.scrollTail(!0) : this.scroll("both" != this.options.wrap && "first" != this.options.wrap || null === this.options.size || != this.first this.first this.options.scroll this.options.size)
        },
        
scrollTail: function (a) {
            if (!
this.locked && !this.animating && this.tail) {
                
this.pauseAuto();
                var 
d.intval(this.list.css(this.lt));
                
this.tail this.tailthis.inTail = !athis.prevFirst this.firstthis.prevLast this.lastthis.animate(b)
            }
        },
        
scroll: function (ab) {
            
this.locked || this.animating || (this.pauseAuto(), this.animate(this.pos(a), b))
        },
        
pos: function (ab) {
            var 
d.intval(this.list.css(this.lt));
            if (
this.locked || this.animating) return c;
            
"circular" != this.options.wrap && (this.options.size && this.options.size this.options.size a);
            for (var 
mthis.first a"circular" != this.options.wrap && >= this.first this.firstthis.get(f) : this.get(this.last), 1null0= !10? -->= > ++h;) this.get(h), = !i.length=== i.length && (this.create(h).addClass(this.className("jcarousel-item-placeholder")), g["before" "after"](i), null !== this.first && "circular" == this.options.wrap && null !== this.options.size && (>= || this.options.size) && (this.get(this.index(h)), m.length && (this.add(hm.clone(!0))))), ithis.dimension(i), && (+= l), null !== this.first && ("circular" == this.options.wrap || >= && (null === this.options.size || this.options.size >= h)) && (l);
            var 
this.clipping(),
                
= [],
                
0,
                
0;
            for (
this.get(1), a; ++p;) {
                if (
this.get(h), = !i.length=== i.length && (this.create(h).addClass(this.className("jcarousel-item-placeholder")), === g.length this.list.prepend(i) : g["before" "after"](i), null !== this.first && "circular" == this.options.wrap && null !== this.options.size && (>= || this.options.size) && (this.get(this.index(h)), m.length && (this.add(hm.clone(!0))))), ithis.dimension(i), === l) throw Error("jCarousel: No width/height set for items. This will cause an infinite loop. Aborting...");
                if (
"circular" != this.options.wrap && null !== this.options.size && this.options.size o.push(i) : && (+= l), += l>= n) break;
                
h++
            }
            for (var 
0o.length rr++) o[r].remove();
            
&& (this.list.css(this.whthis.dimension(this.list) + "px"), && (-= jthis.list.css(this.ltd.intval(this.list.css(this.lt)) - "px")));
            var 
1;
            if (
"circular" != this.options.wrap && this.options.size && this.options.size && (this.options.size), s)
                for (
0s0; ++&& (this.get(h--), i.length) && (+= this.dimension(i), !(>= n)););
            var 
1;
            if (
"circular" != this.options.wrap && && (1), this.inTail && && (+= this.tailthis.inTail = !1), this.tail null"circular" != this.options.wrap && == this.options.size && >= 1) {
                var 
d.intval(this.get(s).css(this.options.vertical "marginBottom" "marginRight"));
                
&& (this.tail u)
            }
            for (
&& === this.options.size && this.tail && (-= this.tailthis.inTail = !0); a-- > t;) += this.dimension(this.get(a));
            return 
this.prevFirst this.firstthis.prevLast this.lastthis.first tthis.last sc
        
},
        
animate: function (bc) {
            if (!
this.locked && !this.animating) {
                
this.animating = !0;
                var 
this,
                    
= function () {
                        if (
d.animating = !1=== && d.list.css(d.lt0), !d.autoStopped && ("circular" == d.options.wrap || "both" == d.options.wrap || "last" == d.options.wrap || null === d.options.size || d.last d.options.size || d.last == d.options.size && null !== d.tail && !d.inTail) && d.startAuto(), d.buttons(), d.notify("onAfterAnimation"), "circular" == d.options.wrap && null !== d.options.size)
                            for (var 
d.prevFirstd.prevLast >= aa++) null === || >= d.first && d.last >= || !(|| d.options.size) || d.remove(a)
                    };
                if (
this.notify("onBeforeAnimation"), this.options.animation && !== !1) {
                    var 
this.options.vertical ? {
                        
topb
                    
} : this.options.rtl ? {
                        
rightb
                    
} : {
                        
leftb
                    
}, = {
                            
durationthis.options.animation,
                            
easingthis.options.easing,
                            
completee
                        
};
                    
a.isFunction(this.options.animationStepCallback) && (g.step this.options.animationStepCallback), this.list.animate(fg)
                } else 
this.list.css(this.lt"px"), e()
            }
        },
        
startAuto: function (a) {
            if (
void 0 !== && (this.options.auto a), === this.options.auto) return this.stopAuto();
            if (
null === this.timer) {
                
this.autoStopped = !1;
                var 
this;
                
this.timer window.setTimeout(function () {
                    
b.next()
                }, 
1e3 this.options.auto)
            }
        },
        
stopAuto: function () {
            
this.pauseAuto(), this.autoStopped = !0
        
},
        
pauseAuto: function () {
            
null !== this.timer && (window.clearTimeout(this.timer), this.timer null)
        },
        
buttons: function (ab) {
            
null == && (= !this.locked && !== this.options.size && (this.options.wrap && "first" != this.options.wrap || null === this.options.size || this.last this.options.size), this.locked || this.options.wrap && "first" != this.options.wrap || null === this.options.size || !(this.last >= this.options.size) || (null !== this.tail && !this.inTail)), null == && (= !this.locked && !== this.options.size && (this.options.wrap && "last" != this.options.wrap || this.first 1), this.locked || this.options.wrap && "last" != this.options.wrap || null === this.options.size || != this.first || (null !== this.tail && this.inTail));
            var 
this;
            
this.buttonNext.size() > ? (this.buttonNext.unbind(this.options.buttonNextEvent ".jcarousel"this.funcNext), && this.buttonNext.bind(this.options.buttonNextEvent ".jcarousel"this.funcNext), this.buttonNext["removeClass" "addClass"](this.className("jcarousel-next-disabled")).attr("disabled"? !: !0), null !== this.options.buttonNextCallback && this.buttonNext.data("jcarouselstate") != && this.buttonNext.each(function () {
                
c.options.buttonNextCallback(cthisa)
            }).
data("jcarouselstate"a)) : null !== this.options.buttonNextCallback && this.buttonNextState != && this.options.buttonNextCallback(cnulla), this.buttonPrev.size() > ? (this.buttonPrev.unbind(this.options.buttonPrevEvent ".jcarousel"this.funcPrev), && this.buttonPrev.bind(this.options.buttonPrevEvent ".jcarousel"this.funcPrev), this.buttonPrev["removeClass" "addClass"](this.className("jcarousel-prev-disabled")).attr("disabled"? !: !0), null !== this.options.buttonPrevCallback && this.buttonPrev.data("jcarouselstate") != && this.buttonPrev.each(function () {
                
c.options.buttonPrevCallback(cthisb)
            }).
data("jcarouselstate"b)) : null !== this.options.buttonPrevCallback && this.buttonPrevState != && this.options.buttonPrevCallback(cnullb), this.buttonNextState athis.buttonPrevState b
        
},
        
notify: function (a) {
            var 
null === this.prevFirst "init" this.prevFirst this.first "next" "prev";
            
this.callback("itemLoadCallback"ab), this.prevFirst !== this.first && (this.callback("itemFirstInCallback"abthis.first), this.callback("itemFirstOutCallback"abthis.prevFirst)), this.prevLast !== this.last && (this.callback("itemLastInCallback"abthis.last), this.callback("itemLastOutCallback"abthis.prevLast)), this.callback("itemVisibleInCallback"abthis.firstthis.lastthis.prevFirstthis.prevLast), this.callback("itemVisibleOutCallback"abthis.prevFirstthis.prevLastthis.firstthis.last)
        },
        
callback: function (bcdefgh) {
            if (
null != this.options[b] && ("object" == typeof this.options[b] || "onAfterAnimation" == c)) {
                var 
"object" == typeof this.options[b] ? this.options[b][c] : this.options[b];
                if (
a.isFunction(i)) {
                    var 
this;
                    if (
void 0 === ei(jdc);
                    else if (
void 0 === fthis.get(e).each(function () {
                        
i(jthisedc)
                    });
                    else
                        for (var 
= function (a) {
                            
j.get(a).each(function () {
                                
i(jthisadc)
                            })
                        }, 
e>= ll++) null === || >= && >= || k(l)
                }
            }
        },
        
create: function (a) {
            return 
this.format("<li></li>"a)
        },
        
format: function (bc) {
            
a(b);
            for (var 
b.get(0).className.split(" "), 0d.length ee++) - != d[e].indexOf("jcarousel-") && b.removeClass(d[e]);
            return 
b.addClass(this.className("jcarousel-item")).addClass(this.className("jcarousel-item-" c)).css({
                
"float"this.options.rtl "right" "left",
                
"list-style""none"
            
}).attr("jcarouselindex"c), b
        
},
        
className: function (a) {
            return 
" " + (this.options.vertical "-vertical" "-horizontal")
        },
        
dimension: function (bc) {
            var 
a(b);
            if (
null == c) return this.options.vertical e.innerHeight() + d.intval(e.css("margin-top")) + d.intval(e.css("margin-bottom")) + d.intval(e.css("border-top-width")) + d.intval(e.css("border-bottom-width")) || d.intval(this.options.itemFallbackDimension) : e.innerWidth() + d.intval(e.css("margin-left")) + d.intval(e.css("margin-right")) + d.intval(e.css("border-left-width")) + d.intval(e.css("border-right-width")) || d.intval(this.options.itemFallbackDimension);
            var 
this.options.vertical d.intval(e.css("marginTop")) - d.intval(e.css("marginBottom")) : d.intval(e.css("marginLeft")) - d.intval(e.css("marginRight"));
            return 
a(e).css(this.wh"px"), this.dimension(e)
        },
        
clipping: function () {
            return 
this.options.vertical this.clip[0].offsetHeight d.intval(this.clip.css("borderTopWidth")) - d.intval(this.clip.css("borderBottomWidth")) : this.clip[0].offsetWidth d.intval(this.clip.css("borderLeftWidth")) - d.intval(this.clip.css("borderRightWidth"))
        },
        
index: function (ab) {
            return 
null == && (this.options.size), Math.round(((1) / Math.floor((1) / b)) * b) + 1
        
}
    }), 
d.extend({
        
defaults: function (c) {
            return 
a.extend(b|| {})
        },
        
intval: function (a) {
            return 
parseInt(a10), isNaN(a) ? a
        
},
        
windowLoaded: function () {
            
= !0
        
},
        
isSafari: function () {
            var 
navigator.userAgent.toLowerCase(),
                
= /(chrome)[ /]([w.]+)/.exec(a) || /(webkit)[ /]([w.]+)/.exec(a) || [],
                
b[1] || "";
            return 
"webkit" === c
        
}
    }), 
a.fn.jcarousel = function (b) {
        if (
"string" == typeof b) {
            var 
a(this).data("jcarousel"),
                
= Array.prototype.slice.call(arguments1);
            return 
c[b].apply(ce)
        }
        return 
this.each(function () {
            var 
a(this).data("jcarousel");
            
? (&& a.extend(c.optionsb), c.reload()) : a(this).data("jcarousel", new d(thisb))
        })
    }
})(
jQuery);
?>
Онлайн: 4
Реклама