PATH:
home
/
letacommog
/
letaweb
/
scripts
/
libraries
(function($) { var Carousel = function(e, options) { this.setOptions = function(op) { this.o = $.extend({ btnPrev: null, btnNext: null, btnGo: null, mouseWheel: false, pause: 3000, autoRun:false, speed: 200, easing: null, hover:false, vertical: false, circular: true, visible: 4, start: 0, scroll: 1, beforeStart: null, afterEnd: null }, op || {}); this.o.start = 0; }; this.getOptions = function() { return this.o; }; this.resize = function() { this.initSize(); }; this.initSize = function() { this.width = this.div.parent().width(); var size = this.calculateSize(this.width, this.o.visible); this.images = $("img", this.ul); // this.images.css({width: size.width, height:size.height}); //this.images.attr('width', size.width); //this.images.attr('height', size.height); this.li = $("li", this.ul), this.itemLength = this.li.size(), this.curr = this.o.start; this.li.css({width: '', height: ''}); !this.o.vertical ? this.li.css({ width: size.width }) : ''; this.div.css("visibility", "visible"); this.li.css({overflow: "hidden", float: this.o.vertical ? "none" : "left"}); this.ul.css({margin: "0", padding: "0", position: "relative", "list-style-type": "none", "z-index": "1"}); this.div.css({overflow: "hidden", position: "relative", "z-index": "2", left: "0px"}); this.liSize = this.o.vertical ? height(this.li) : width(this.li); // Full li size(incl margin)-Used for animation var ulSize = this.liSize * this.itemLength; // size of full ul(total length, not just for the visible items) var divSize = this.liSize * this.v; // size of entire div(total length for just the visible items) this.ul.css(this.sizeCss, ulSize+"px").css(this.animCss, -(this.curr*this.liSize)); this.div.css(this.sizeCss, divSize+"px"); // Width of the DIV. length of visible images }; this.calculateSize = function(width, visible) { var iw = Math.round(width / visible); var image = $("img:first", this.ul); var e = image.outerWidth(true) - image.width(); //iw = iw - e; var ih = iw * 9 / 16; return {width:iw, height:ih}; }; this.initImages = function() { this.ul = $("ul", this.div), this.tLi = $("li", this.ul), this.tl = this.tLi.size(), this.v = this.o.visible; if(this.o.circular) { var that = this; this.ul.prepend(this.tLi.slice(this.tl-this.v-1+1).clone().attr('clone', 'true')) .append(this.tLi.slice(0,this.v).clone().attr('clone', 'true')); this.o.start += this.v; } }; this.setup = function() { this.setOptions(options); var s = e; this.running = false, this.animCss=this.o.vertical?"top":"left", this.sizeCss=this.o.vertical?"height":"width"; this.div = $(s); this.initImages(); this.initSize(); this.evt(); }; this.vis = function() { return this.li.slice(this.curr).slice(0,this.v); }; this.go = function(to) { var that = this; if(!this.running) { if(this.o.beforeStart) this.o.beforeStart.call(this, vis()); if(this.o.circular) { // If circular we are in first or last, then goto the other end if(to<=this.o.start-this.v-1) { // If first, then goto last this.ul.css(this.animCss, -((this.itemLength-(this.v*2))*this.liSize)+"px"); // If "scroll" > 1, then the "to" might not be equal to the condition; it can be lesser depending on the number of elements. this.curr = to==this.o.start-this.v-1 ? this.itemLength-(this.v*2)-1 : this.itemLength-(this.v*2)-this.o.scroll; } else if(to>=this.itemLength-this.v+1) { // If last, then goto first this.ul.css(this.animCss, -( (this.v) * this.liSize ) + "px" ); // If "scroll" > 1, then the "to" might not be equal to the condition; it can be greater depending on the number of elements. this.curr = to==this.itemLength-this.v+1 ? this.v+1 : this.v+this.o.scroll; } else this.curr = to; } else { // If non-circular and to points to first or last, we just return. if(to<0 || to>this.itemLength-this.v) return; else this.curr = to; } // If neither overrides it, the curr will still be "to" and we can proceed. this.running = true; this.ul.animate( this.animCss == "left" ? { left: -(this.curr*this.liSize) } : { top: -(this.curr*this.liSize) } , this.o.speed, this.o.easing, function() { if(that.o.afterEnd) that.o.afterEnd.call(this, vis()); that.running = false; } ); // Disable buttons when the carousel reaches the last/first, and enable when not if(!this.o.circular) { $(this.o.btnPrev + "," + this.o.btnNext).removeClass("disabled"); $( (this.curr-this.o.scroll<0 && this.o.btnPrev) || (this.curr+this.o.scroll > this.itemLength-this.v && this.o.btnNext) || [] ).addClass("disabled"); } } return false; }; this.evt = function() { var that = this; var p = this.div.parent(); $(this.o.btnPrev,p).unbind('click'); if(this.o.btnPrev) $(this.o.btnPrev,p).click(function() { return that.go(that.curr-that.o.scroll); }); $(this.o.btnNex,p).unbind('click'); if(this.o.btnNext) $(this.o.btnNext,p).click(function() { return that.go(that.curr+that.o.scroll); }); if(this.o.btnGo) $.each(this.o.btnGo, function(i, val) { $(val,p).click(function() { return that.go(that.o.circular ? that.o.visible+i : i); }); }); this.div.unbind('mouseWheel'); if(this.o.mouseWheel && div.mousewheel) this.div.mousewheel(function(e, d) { return d>0 ? that.go(curr-o.scroll) : that.go(that.curr+that.o.scroll); }); this.div.unbind('hover'); if(this.o.hover) { this.div.hover( function() { clearInterval(that.inv); that.inv = ''; }, function() { clearInterval(that.inv); that.inv = ''; if(that.o.autoRun) that.inv = setInterval(function() { that.go(that.curr+that.o.scroll); }, that.o.pause); } ); } clearInterval(this.inv); this.inv = ''; if(this.o.autoRun) this.inv = setInterval(function() { that.go(that.curr+that.o.scroll); }, that.o.pause); }; }; $.fn.jCarouselLite = function(o) { return this.each(function() { // Returns the element collection. Chainable. var c = new Carousel(this,o); c.setup(); $(this).data('Carousel', c); }); }; function css(el, prop) { return parseInt($.css(el[0], prop)) || 0; }; function width(el) { return el[0].offsetWidth + css(el, 'marginLeft') + css(el, 'marginRight'); }; function height(el) { return el[0].offsetHeight + css(el, 'marginTop') + css(el, 'marginBottom'); }; })(jQuery);
[+]
..
[+]
jQuery-Tags-Input
[-] countdown.js
[edit]
[-] owl.carousel.js
[edit]
[-] base.js
[edit]
[-] jquery.ui.core.js
[edit]
[+]
select2
[-] jquery.matchHeight-min.js
[edit]
[+]
master-slider
[-] jquery.metadata.js
[edit]
[+]
owl-carousel
[-] dataTables.columnFilter.js
[edit]
[-] codemirror.js
[edit]
[+]
jqvmap
[-] css.js
[edit]
[-] jquery.ui.button.js
[edit]
[-] jquery.vticker.min.js
[edit]
[-] jwplayer.js
[edit]
[-] masonry.pkgd.js
[edit]
[-] jquery.smartmenus.min - Copy.js
[edit]
[-] jquery.ui.widget.js
[edit]
[-] jquery.ba-resize.min.js
[edit]
[-] jquery-ui-timepicker.js
[edit]
[-] jquery-migrate.js
[edit]
[-] jquery.nearest.min.js
[edit]
[-] swfobject.js
[edit]
[-] javascript.js
[edit]
[-] jquery.validate.password.js
[edit]
[-] jquery.colorbox.js
[edit]
[-] flexigrid.js
[edit]
[-] jquery.smartmenus.min.js
[edit]
[-] jcarousellite.js
[edit]
[+]
ckeditor_standard
[-] twig.min.js
[edit]
[-] superfish.js
[edit]
[-] bootstrap.min - Copy.js
[edit]
[-] jquery.dataTables.min.js
[edit]
[-] mustache.js
[edit]
[-] spectrum.js
[edit]
[-] jquery.ui.droppable.js
[edit]
[-] jquery.isotope.js
[edit]
[-] jquery.ui.slider.js
[edit]
[-] htmlmixed.js
[edit]
[-] jquery.tinycarousel.min.js
[edit]
[-] jquery.ui.sortable.js
[edit]
[-] jquery.hover.js
[edit]
[-] wow.min.js
[edit]
[-] jquery.fittext.js
[edit]
[+]
jquery.validate
[-] jquery.ui.draggable.js
[edit]
[-] jquery.ui.resizable.js
[edit]
[-] audio.min.js
[edit]
[+]
angular
[+]
less
[-] masonry.pkgd.min.js
[edit]
[+]
plupload
[-] jquery.rd-parallax.js
[edit]
[-] tabs.js
[edit]
[-] responsive.js
[edit]
[-] xml.js
[edit]
[-] expressInstall.swf
[edit]
[-] camera.js
[edit]
[-] pace.min.js
[edit]
[-] typed.js
[edit]
[-] jquery.nivo.slider.js
[edit]
[+]
bootstrap
[-] qtip.js
[edit]
[+]
mediaelement
[-] jquery.ui.mouse.js
[edit]
[+]
slick
[-] countUp.js
[edit]
[-] jquery.prettyPhoto.js
[edit]
[+]
ckeditor_full
[-] jquery.ui.spinner.js
[edit]
[-] portfolio-layout-plugin.js
[edit]
[-] require.js
[edit]
[-] nicEdit.js
[edit]
[-] jquery.json-2.4.min.js
[edit]
[-] jquery.ba-resize.js
[edit]
[-] jquery.mobilemenu.js
[edit]
[+]
nivo_slider
[+]
ui-iconpicker
[-] cloud-zoom.js
[edit]
[-] jquery.ui.datepicker.js
[edit]
[-] jquery.cycle.all.js
[edit]
[-] jquery.validate.js
[edit]
[+]
flot
[+]
jquery-ui
[-] jquery.cleditor.min.js
[edit]
[-] jquery.easing.js
[edit]
[-] jquery.elevateZoom.min.js
[edit]
[-] bootstrap.min.js
[edit]
[-] jquery.bxslider.js
[edit]
[-] mediaelement-and-player.min.js
[edit]
[-] jquery.zoom-min.js
[edit]
[-] jquery.nearest.js
[edit]
[-] jquery.autosize.js
[edit]