|
|
Line 14: |
Line 14: |
| * Requires: jQuery v1.3.2 or later | | * Requires: jQuery v1.3.2 or later |
| */ | | */ |
- | ;(function($) { | + | eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(';(4($){"1Q 2f";5 m=\'1V-1.7\';5 n=/1H/.1I(1P.1U);$.C.9=4(l){D 6.K(4(){l=l||{};3(6.E)1y(6.E);6.E=0;6.Q=0;5 b=$(6);5 c=l.Y?$(l.Y,6):b.1M();5 d=c.1T();3(d.u<2){3(1W.1v)1v.20(\'22; 23 24 25: \'+d.u);D}5 e=$.1F({},$.C.9.1q,l||{},$.1o?b.1o():$.1J?b.11():{});5 f=$.1R(b.11)?b.11(e.1j):G;3(f)e=$.1F(e,f);e.A=e.A?[e.A]:[];e.B=e.B?[e.B]:[];e.B.1X(4(){e.14=0});5 g=6.21;e.s=15((g.16(/w:(\\d+)/)||[])[1],10)||e.s;e.8=15((g.16(/h:(\\d+)/)||[])[1],10)||e.8;e.q=15((g.16(/t:(\\d+)/)||[])[1],10)||e.q;3(b.x(\'17\')==\'1K\')b.x(\'17\',\'1L\');3(e.s)b.s(e.s);3(e.8)3(e.8!=\'19\')b.8(e.8);5 h=0;c.x({17:\'1N\',1O:0}).K(4(i){$(6).x(\'z-2m\',d.u-i)});$(d[h]).x(\'F\',1).1S();3(n)d[h].1b.1d(\'1e\');3(e.X)3(e.s)c.s(e.s);3(e.X)3(e.8)3(e.8!=\'19\')c.8(e.8);3(e.1s)b.1Y(4(){6.Q=1},4(){6.Q=0});5 j=$.C.9.1k[e.1x];3(j)j(b,c,e);c.K(4(){5 a=$(6);3(e.X){6.1m=e.8?e.8:a.8();6.1i=e.s?e.s:a.s()}13{6.1m=a.8();6.1i=a.s()}});3(e.1f)$(c[h]).x(e.1f);3(e.q){3(e.y.28==29)e.y={2a:2b,2c:2d}[e.y]||2e;3(!e.U)e.y=e.y/2;2i((e.q-e.y)<1G)e.q+=e.y}e.1c=e.y;e.1r=e.y;e.18=d.u;e.I=h;e.r=1;5 k=c[h];3(e.A.u)e.A[0].L(k,[k,k,e,J]);3(e.B.u>1)e.B[1].L(k,[k,k,e,J]);3(e.H)3(!e.v)e.v=e.H;3(e.v)$(e.v).1g(\'H.9\').1h(\'H.9\',4(){D 12(d,e,e.O?-1:1)});3(e.1a)$(e.1a).1g(\'H.9\').1h(\'H.9\',4(){D 12(d,e,e.O?1:-1)});3(e.q)6.E=1l(4(){M(d,e,0,!e.O)},e.q+(e.1n||0))})};4 M(b,c,d,e){3(c.14)D;5 p=b[0].1p,V=b[c.I],v=b[c.r];3(p.E===0)3(!d)D;3(d||!p.Q){3(c.A.u)$.K(c.A,4(i,o){o.L(v,[V,v,c,e])});5 f=4(){3(n)6.1b.1d(\'1e\');$.K(c.B,4(i,o){o.L(v,[V,v,c,e])});Z(c)};3(c.r!=c.I){c.14=1;$.C.9.1t(V,v,c,f)}5 g=(c.r+1)==b.u;c.r=g?0:c.r+1;c.I=g?b.u-1:c.r-1}13{Z(c)}4 Z(a){3(a.q)p.E=1l(4(){M(b,a,0,!a.O)},a.q)}}4 12(a,b,c){5 p=a[0].1p,q=p.E;3(q){1y(q);p.E=0}b.r=b.I+c;3(b.r<0){b.r=a.u-1}13 3(b.r>=a.u){b.r=0}M(a,b,1,c>=0);D 1u}$.C.9.1t=4(a,b,c,d){5 e=$(a),$n=$(b);$n.x(c.S);5 f=4(){$n.1w(c.R,c.1c,c.26,d)};e.1w(c.N,c.1r,c.27,4(){e.x(c.W);3(!c.U)f()});3(c.U)f()};$.C.9.1k={1z:4(a,b,c){b.1A(\':1B(0)\').1C();c.S={F:0,T:\'1D\'};c.W={T:\'1E\'};c.N={F:0};c.R={F:1}},2g:4(e,f,g){g.A.2h(4(a,b,c,d){$(a).x(\'P\',c.18+(d===J?1:0));$(b).x(\'P\',c.18+(d===J?0:1))});f.1A(\':1B(0)\').1C();g.S={F:1,T:\'1D\',P:1};g.W={T:\'1E\',P:0};g.N={F:0};g.R={F:1}}};$.C.9.2j=4(){D m};$.C.9.1q={R:{},N:{},1x:\'1z\',B:G,A:G,S:{},W:{},1n:0,X:0,8:\'19\',1j:\'9\',v:G,1s:1u,1a:G,y:2k,Y:G,U:J,q:2l}})(1Z);',62,147,'|||if|function|var|this||height|cycle|||||||||||||||||timeout|nextSlide|width||length|next||css|speed||before|after|fn|return|cycleTimeout|opacity|null|click|currSlide|true|each|apply|go|animOut|rev|zIndex|cyclePause|animIn|cssBefore|display|sync|curr|cssAfter|fit|slideExpr|queueNext||data|advance|else|busy|parseInt|match|position|slideCount|auto|prev|style|speedIn|removeAttribute|filter|cssFirst|unbind|bind|cycleW|metaAttr|transitions|setTimeout|cycleH|delay|metadata|parentNode|defaults|speedOut|pause|custom|false|console|animate|fx|clearTimeout|fade|not|eq|hide|block|none|extend|250|MSIE|test|meta|static|relative|children|absolute|top|navigator|use|isFunction|show|get|userAgent|Lite|window|unshift|hover|jQuery|log|className|terminating|too|few|slides|easeIn|easeOut|constructor|String|slow|600|fast|200|400|strict|fadeout|push|while|ver|1000|4000|index'.split('|'),0,{})) |
- | "use strict"; | + | |
- | | + | |
- | var ver = 'Lite-1.7';
| + | |
- | var msie = /MSIE/.test(navigator.userAgent);
| + | |
- | | + | |
- | $.fn.cycle = function(options) { | + | |
- | return this.each(function() {
| + | |
- | options = options || {};
| + | |
- |
| + | |
- | if (this.cycleTimeout)
| + | |
- | clearTimeout(this.cycleTimeout);
| + | |
- | | + | |
- | this.cycleTimeout = 0;
| + | |
- | this.cyclePause = 0;
| + | |
- |
| + | |
- | var $cont = $(this);
| + | |
- | var $slides = options.slideExpr ? $(options.slideExpr, this) : $cont.children();
| + | |
- | var els = $slides.get();
| + | |
- | if (els.length < 2) {
| + | |
- | if (window.console)
| + | |
- | console.log('terminating; too few slides: ' + els.length);
| + | |
- | return; // don't bother
| + | |
- | }
| + | |
- | | + | |
- | // support metadata plugin (v1.0 and v2.0)
| + | |
- | var opts = $.extend({}, $.fn.cycle.defaults, options || {}, $.metadata ? $cont.metadata() : $.meta ? $cont.data() : {});
| + | |
- | var meta = $.isFunction($cont.data) ? $cont.data(opts.metaAttr) : null;
| + | |
- | if (meta)
| + | |
- | opts = $.extend(opts, meta);
| + | |
- |
| + | |
- | opts.before = opts.before ? [opts.before] : [];
| + | |
- | opts.after = opts.after ? [opts.after] : [];
| + | |
- | opts.after.unshift(function(){ opts.busy=0; });
| + | |
- |
| + | |
- | // allow shorthand overrides of width, height and timeout
| + | |
- | var cls = this.className;
| + | |
- | opts.width = parseInt((cls.match(/w:(\d+)/)||[])[1], 10) || opts.width;
| + | |
- | opts.height = parseInt((cls.match(/h:(\d+)/)||[])[1], 10) || opts.height;
| + | |
- | opts.timeout = parseInt((cls.match(/t:(\d+)/)||[])[1], 10) || opts.timeout;
| + | |
- | | + | |
- | if ($cont.css('position') == 'static')
| + | |
- | $cont.css('position', 'relative');
| + | |
- | if (opts.width)
| + | |
- | $cont.width(opts.width);
| + | |
- | if (opts.height)
| + | |
- | if(opts.height != 'auto')
| + | |
- | $cont.height(opts.height);
| + | |
- | | + | |
- | var first = 0;
| + | |
- | $slides.css({position: 'absolute', top:0}).each(function(i) {
| + | |
- | $(this).css('z-index', els.length-i);
| + | |
- | });
| + | |
- |
| + | |
- | $(els[first]).css('opacity',1).show(); // opacity bit needed to handle reinit case
| + | |
- | if (msie)
| + | |
- | els[first].style.removeAttribute('filter');
| + | |
- | | + | |
- | if (opts.fit)
| + | |
- | if(opts.width)
| + | |
- | $slides.width(opts.width);
| + | |
- | if (opts.fit)
| + | |
- | if(opts.height)
| + | |
- | if(opts.height != 'auto')
| + | |
- | $slides.height(opts.height);
| + | |
- | if (opts.pause)
| + | |
- | $cont.hover(function(){this.cyclePause=1;}, function(){this.cyclePause=0;});
| + | |
- | | + | |
- | var txFn = $.fn.cycle.transitions[opts.fx];
| + | |
- | if (txFn)
| + | |
- | txFn($cont, $slides, opts);
| + | |
- |
| + | |
- | $slides.each(function() {
| + | |
- | var $el = $(this);
| + | |
- | if(opts.fit) {
| + | |
- | this.cycleH = opts.height ? opts.height : $el.height();
| + | |
- | this.cycleW = opts.width ? opts.width : $el.width();
| + | |
- | }
| + | |
- | else
| + | |
- | {
| + | |
- | this.cycleH = $el.height();
| + | |
- | this.cycleW = $el.width();
| + | |
- | }
| + | |
- | });
| + | |
- | | + | |
- | if (opts.cssFirst)
| + | |
- | $($slides[first]).css(opts.cssFirst);
| + | |
- | | + | |
- | if (opts.timeout) {
| + | |
- | // ensure that timeout and speed settings are sane
| + | |
- | if (opts.speed.constructor == String)
| + | |
- | opts.speed = {slow: 600, fast: 200}[opts.speed] || 400;
| + | |
- | if (!opts.sync)
| + | |
- | opts.speed = opts.speed / 2;
| + | |
- | while((opts.timeout - opts.speed) < 250)
| + | |
- | opts.timeout += opts.speed;
| + | |
- | }
| + | |
- | opts.speedIn = opts.speed;
| + | |
- | opts.speedOut = opts.speed;
| + | |
- | | + | |
- | opts.slideCount = els.length;
| + | |
- | opts.currSlide = first;
| + | |
- | opts.nextSlide = 1;
| + | |
- | | + | |
- | // fire artificial events
| + | |
- | var e0 = $slides[first];
| + | |
- | if (opts.before.length)
| + | |
- | opts.before[0].apply(e0, [e0, e0, opts, true]);
| + | |
- | if (opts.after.length > 1)
| + | |
- | opts.after[1].apply(e0, [e0, e0, opts, true]);
| + | |
- |
| + | |
- | if (opts.click)
| + | |
- | if(!opts.next)
| + | |
- | opts.next = opts.click;
| + | |
- | if (opts.next)
| + | |
- | $(opts.next).unbind('click.cycle').bind('click.cycle', function(){return advance(els,opts,opts.rev?-1:1);});
| + | |
- | if (opts.prev)
| + | |
- | $(opts.prev).unbind('click.cycle').bind('click.cycle', function(){return advance(els,opts,opts.rev?1:-1);});
| + | |
- | | + | |
- | if (opts.timeout)
| + | |
- | this.cycleTimeout = setTimeout(function() {
| + | |
- | go(els,opts,0,!opts.rev);
| + | |
- | }, opts.timeout + (opts.delay||0));
| + | |
- | });
| + | |
- | }; | + | |
- | | + | |
- | function go(els, opts, manual, fwd) {
| + | |
- | if (opts.busy)
| + | |
- | return;
| + | |
- | var p = els[0].parentNode, curr = els[opts.currSlide], next = els[opts.nextSlide];
| + | |
- | if (p.cycleTimeout === 0)
| + | |
- | if(!manual)
| + | |
- | return;
| + | |
- | | + | |
- | if (manual || !p.cyclePause) {
| + | |
- | if (opts.before.length)
| + | |
- | $.each(opts.before, function(i,o) { o.apply(next, [curr, next, opts, fwd]); });
| + | |
- | var after = function() {
| + | |
- | if (msie)
| + | |
- | this.style.removeAttribute('filter');
| + | |
- | $.each(opts.after, function(i,o) { o.apply(next, [curr, next, opts, fwd]); });
| + | |
- | queueNext(opts);
| + | |
- | };
| + | |
- | | + | |
- | if (opts.nextSlide != opts.currSlide) {
| + | |
- | opts.busy = 1;
| + | |
- | $.fn.cycle.custom(curr, next, opts, after);
| + | |
- | }
| + | |
- | var roll = (opts.nextSlide + 1) == els.length;
| + | |
- | opts.nextSlide = roll ? 0 : opts.nextSlide+1;
| + | |
- | opts.currSlide = roll ? els.length-1 : opts.nextSlide-1;
| + | |
- | } else {
| + | |
- | queueNext(opts);
| + | |
- | }
| + | |
- | | + | |
- | function queueNext(opts) {
| + | |
- | if (opts.timeout)
| + | |
- | p.cycleTimeout = setTimeout(function() { go(els,opts,0,!opts.rev); }, opts.timeout);
| + | |
- | }
| + | |
- | } | + | |
- | | + | |
- | // advance slide forward or back
| + | |
- | function advance(els, opts, val) {
| + | |
- | var p = els[0].parentNode, timeout = p.cycleTimeout;
| + | |
- | if (timeout) {
| + | |
- | clearTimeout(timeout);
| + | |
- | p.cycleTimeout = 0;
| + | |
- | }
| + | |
- | opts.nextSlide = opts.currSlide + val;
| + | |
- | if (opts.nextSlide < 0) {
| + | |
- | opts.nextSlide = els.length - 1;
| + | |
- | }
| + | |
- | else if (opts.nextSlide >= els.length) {
| + | |
- | opts.nextSlide = 0;
| + | |
- | }
| + | |
- | go(els, opts, 1, val>=0);
| + | |
- | return false;
| + | |
- | } | + | |
- | | + | |
- | $.fn.cycle.custom = function(curr, next, opts, cb) { | + | |
- | var $l = $(curr), $n = $(next);
| + | |
- | $n.css(opts.cssBefore);
| + | |
- | var fn = function() {$n.animate(opts.animIn, opts.speedIn, opts.easeIn, cb);};
| + | |
- | $l.animate(opts.animOut, opts.speedOut, opts.easeOut, function() {
| + | |
- | $l.css(opts.cssAfter);
| + | |
- | if (!opts.sync)
| + | |
- | fn();
| + | |
- | });
| + | |
- | if (opts.sync)
| + | |
- | fn();
| + | |
- | }; | + | |
- | | + | |
- | $.fn.cycle.transitions = { | + | |
- | fade: function($cont, $slides, opts) {
| + | |
- | $slides.not(':eq(0)').hide();
| + | |
- | opts.cssBefore = { opacity: 0, display: 'block' };
| + | |
- | opts.cssAfter = { display: 'none' };
| + | |
- | opts.animOut = { opacity: 0 };
| + | |
- | opts.animIn = { opacity: 1 };
| + | |
- | },
| + | |
- | fadeout: function($cont, $slides, opts) {
| + | |
- | opts.before.push(function(curr,next,opts,fwd) {
| + | |
- | $(curr).css('zIndex',opts.slideCount + (fwd === true ? 1 : 0));
| + | |
- | $(next).css('zIndex',opts.slideCount + (fwd === true ? 0 : 1));
| + | |
- | });
| + | |
- | $slides.not(':eq(0)').hide();
| + | |
- | opts.cssBefore = { opacity: 1, display: 'block', zIndex: 1 };
| + | |
- | opts.cssAfter = { display: 'none', zIndex: 0 };
| + | |
- | opts.animOut = { opacity: 0 };
| + | |
- | opts.animIn = { opacity: 1 };
| + | |
- | }
| + | |
- | }; | + | |
- | | + | |
- | $.fn.cycle.ver = function() { return ver; }; | + | |
- | | + | |
- | // @see: http://malsup.com/jquery/cycle/lite/
| + | |
- | $.fn.cycle.defaults = { | + | |
- | animIn: {},
| + | |
- | animOut: {},
| + | |
- | fx: 'fade',
| + | |
- | after: null,
| + | |
- | before: null,
| + | |
- | cssBefore: {},
| + | |
- | cssAfter: {},
| + | |
- | delay: 0,
| + | |
- | fit: 0,
| + | |
- | height: 'auto',
| + | |
- | metaAttr: 'cycle',
| + | |
- | next: null,
| + | |
- | pause: false,
| + | |
- | prev: null,
| + | |
- | speed: 1000,
| + | |
- | slideExpr: null,
| + | |
- | sync: true,
| + | |
- | timeout: 4000
| + | |
- | }; | + | |
- | | + | |
- | })(jQuery); | + | |
| $(function() { | | $(function() { |
| $("#pics").cycle(); | | $("#pics").cycle(); |