ok

Mini Shell

Direktori : /home/pequenacapitolio/www/js/libs/
Upload File :
Current File : /home/pequenacapitolio/www/js/libs/jquery.thim-content-slider.min.js

!function(t){t.thimContentSlider=function(e,i){this.$el=t(e).addClass("thim-content-slider"),this.$items=[],this.options=t.extend({},t.fn.thimContentSlider.defaults,i);var s,n,o=this,l=t(window),a=(t(document),t(document.body),0),r=null,m=null,d=0,c=0,h=0,f=!1,p=0,u=0,v=this.options.activeItemRatio||2.5,$=this.options.activeItemPadding,g=0,b=0,w=this.options.itemsVisible||7,C=0,I="ontouchstart"in window||window.navigator.msMaxTouchPoints,P={start:I?"touchstart":"mousedown",move:I?"touchmove":"mousemove",end:I?"touchend":"mouseup"},x="",y=!0;function q(){var e,i,s=t(' \t\t\t\t\t<div class="slides-content"></div>\t\t\t\t\t<div class="slides-wrapper"> \t\t\t\t\t\t<ul class="scrollable"></ul> \t\t\t\t\t\t<a href="prev" class="control-nav prev"></a> \t\t\t\t\t\t<a href="next" class="control-nav next"></a> \t\t\t\t\t</div> \t\t\t\t'),n=o.options.items;o.$el.html(s),o.$slidesWrapper=o.$el.find(".slides-wrapper"),o.$scrollable=o.$el.find(".scrollable").css({marginTop:-D("itemPadding"),marginBottom:-D("itemPadding")}),o.$slideContent=o.$el.find(".slides-content");for(var l=0,a=n.length;l<a;l++){var r=(e={image:n[l].image},t(' \t\t\t\t<li> \t\t\t\t\t<div class="slide-content" style="margin: '+D("itemPadding")+'px;"> \t\t\t\t\t\t<img src="'+e.image+'" /> \t\t\t\t\t</div> \t\t\t\t</li> \t\t\t')),m=t('<div class="slide-content" />').append(n[l].content);o.$scrollable.append(r),o.$slideContent.append(m)}o.$items=o.$scrollable.children(),w=D("itemsVisible")<=D("items").length?D("itemsVisible"):D("items").length,d=Math.floor(w/2),c=d,u=o.$items.length,p=c,o.$el.on("click",".control-nav",S).on("click",".scrollable > li",S),o.options.mouseWheel&&o.$el.on("mousewheel",function(t,e,i,s){t.preventDefault(),-1!=e?j():z()}),o.options.autoPlay&&F(),o.options.pauseOnHover&&o.$el.hover(function(){H()},function(){N()}),o.$scrollable.bind(P.start,M).bind(P.move,V).bind(P.end,W),i=o.$el.find(".control-nav"),o.$el.hover(function(){o.$el.addClass("hover")},function(){o.$el.removeClass("hover")}),o.$nav=i,o.$slideContent.children().eq(c).css({opacity:1}).addClass("current").siblings().removeClass("current")}function M(){}function V(){}function W(){}function S(e){var i;switch(e.preventDefault(),t(this).attr("href")){case"prev":j();break;case"next":z();break;default:var s=t(e.target);s.is("li")||(s=s.closest("li")),k((i=s).hasClass("mid-item")?0:o.$items.index(i)-o.$items.index(o.$items.filter(".mid-item")))}}function T(e,i){"prev"==e?o.$items.last().remove():o.$items.first().remove(),B(),o.$items.eq(d).addClass("mid-item").siblings().removeClass("mid-item"),y&&o.$slideContent.children().eq(p).stop().show().animate({opacity:1}).siblings().hide(),f=!1,N(),o.$el.hasClass("hover"),t.isFunction(i)&&i.apply(o)}function k(t){if(0==t)return x="",void(y=!0);y=1==Math.abs(t),x=250,(t<0?j:z).call(this,function(){k(t<0?t+1:t-1)})}function j(t){if(!f){H(),f=!0,o.$slideContent.children().eq(p).stop().animate({opacity:0}),--p<0&&(p=u-1);D("itemPadding");var e=parseInt((b-g)/2),i=o.$items.length,s=0,n=function(){++s==i&&T("prev",t)};o.$items.last().clone().insertBefore(o.$items.first()).css({left:parseInt(o.$items.first().css("left"))-g}),B(),o.$el.find(".mid-item").removeClass("mid-item"),o.$items.eq(c+1).addClass("mid-item");for(var l=0;l<=i;l++){var a={left:C-(c-l)*g,width:g,top:e};l<c?a.left-=$:l==c?(a.left=C,a.top=0,a.width=b):l==c+1?(a.left=C+b+$,a.top=e,a.width=g):a.left+=b-g+$,o.$items.eq(l).stop().show().animate(a,x,n)}}}function z(t){if(!f){H(),f=!0,o.$slideContent.children().eq(p).stop().animate({opacity:0}),++p>=u&&(p=0);D("itemPadding");var e=parseInt((b-g)/2),i=o.$items.length,s=0,n=function(){++s==i&&T("next",t)};o.$items.first().clone().insertAfter(o.$items.last()).css({left:parseInt(o.$items.last().css("left"))+g}),B(),o.$el.find(".mid-item").removeClass("mid-item"),o.$items.eq(c+1).addClass("mid-item");for(var l=0;l<=i;l++){var a={left:C-(c-l)*g,width:g,top:e};l<c?a.left-=g+$:l==c?(a.left-=g+$,a.top=e,a.width=g):l==c+1?(a.left=C,a.top=0,a.width=b):a.left=C+b+(l-c-2)*g+$,o.$items.eq(l).stop().show().animate(a,x,n)}}}function B(){o.$items=o.$scrollable.children()}function D(t){return o.options[t]}function F(){m&&clearTimeout(m),m=setTimeout(function(){F(),z()},D("pauseTime"))}function H(){m&&clearTimeout(m)}function N(){D("autoPlay")&&F()}function O(){var e,i;!function e(i){if(o.$scrollable.css("width",""),i=t.extend({itemPadding:D("itemPadding"),itemMaxWidth:D("itemMaxWidth"),itemsVisible:w,itemMinWidth:D("itemMinWidth")},i||{}),a=o.$el.width(),b=parseInt(i.itemMaxWidth+2*i.itemPadding),g=parseInt(b/v),(h=g*(i.itemsVisible-1)+b+2*$)>a){var s=(h-a)/(i.itemsVisible+v-1);if(b-s*v<i.itemMinWidth){if(i.itemsVisible-2>=1)return i.itemsVisible-=2,void e({itemsVisible:i.itemsVisible})}else b-=s*v,g-=s;h=a}else o.$scrollable.width(h);C=parseInt((h-b)/2)}(),e=o.$nav.height(),i={top:(b-2*D("itemPadding"))/2,marginTop:-e/2},D("controlNav"),o.$nav.css(i);var s=D("itemPadding");o.$scrollable.height(b);var n=0,l=parseInt((b-g)/2),r=o.$items.length-1;o.$items.hide();for(var m=0;m<=r;m++)o.$items.eq(m).show(),m==c?o.$items.eq(m).css({left:parseInt(C),width:parseInt(b)}).addClass("mid-item").find(".slide-content").css({margin:s}):(n=C-(c-m)*g,m>c?n+=b-g+$:n-=$,o.$items.eq(m).css({width:parseInt(g),left:parseInt(n),top:parseInt(l)}).removeClass("mid-item"))}this.pause=H,this.restart=N,this.prev=j,this.next=z,this.update=O,this.move=k,s=typeof o.options.items,n=null,"string"==s?n=t(o.options.items):"object"==s&&(n=t(o.options.items).children()),n&&(o.options.items=[],n.each(function(){var e=t(this),i=e.find("img"+o.options.imageSelector+":first"),s=i.parent();o.options.items.push({image:i.attr("src"),url:s.is("a")?s.attr("href"):"",content:e.find(o.options.contentSelector)})})),q(),l.on("resize.thim-content-slider",function(){var t;t?O():(r&&clearTimeout(r),r=setTimeout(function(){O()},350))}).trigger("resize.thim-content-slider"),O()},t.fn.thimContentSlider=function(e){var i=!1,s=[];if(arguments.length>0&&"string"==typeof arguments[0]){i=arguments[0];for(var n=1;n<arguments.length;n++)s[n-1]=arguments[n]}return t.each(this,function(){var n=t(this),o=n.data("thim-content-slider");if(o||(o=new t.thimContentSlider(this,e),n.data("thim-content-slider",o)),i){if(t.isFunction(o[i]))return o[i].apply(o,s);throw"Method thimContentSlider."+i+"() does not exists"}return n})},t.fn.thimContentSlider.defaults={items:[{image:"",url:"",html:""}],itemMaxWidth:200,itemMinWidth:150,itemsVisible:7,itemPadding:10,activeItemRatio:2,activeItemPadding:0,mouseWheel:!0,autoPlay:!0,pauseTime:3e3,pauseOnHover:!0,imageSelector:"",contentSelector:".content",controlNav:"behind"}}(jQuery);

Zerion Mini Shell 1.0