All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.bsf.js.carousel.js Maven / Gradle / Ivy

There is a newer version: 2.0.1
Show newest version
/*
 ========================================================================
 Bootstrap: carousel.js v3.3.7
 http://getbootstrap.com/javascript/#carousel
 ========================================================================
 Copyright 2011-2016 Twitter, Inc.
 Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 ======================================================================== */
+function(b){function h(a){return this.each(function(){var f=b(this),c=f.data("bs.carousel"),e=b.extend({},d.DEFAULTS,f.data(),"object"==typeof a&&a),g="string"==typeof a?a:e.slide;c||f.data("bs.carousel",c=new d(this,e));if("number"==typeof a)c.to(a);else if(g)c[g]();else e.interval&&c.pause().cycle()})}var d=function(a,f){this.$element=b(a);this.$indicators=this.$element.find(".carousel-indicators");this.options=f;this.$items=this.$active=this.interval=this.sliding=this.paused=null;this.options.keyboard&&
this.$element.on("keydown.bs.carousel",b.proxy(this.keydown,this));"hover"!=this.options.pause||"ontouchstart"in document.documentElement||this.$element.on("mouseenter.bs.carousel",b.proxy(this.pause,this)).on("mouseleave.bs.carousel",b.proxy(this.cycle,this))};d.VERSION="3.3.7";d.TRANSITION_DURATION=600;d.DEFAULTS={interval:5E3,pause:"hover",wrap:!0,keyboard:!0};d.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();
break;default:return}a.preventDefault()}};d.prototype.cycle=function(a){a||(this.paused=!1);this.interval&&clearInterval(this.interval);this.options.interval&&!this.paused&&(this.interval=setInterval(b.proxy(this.next,this),this.options.interval));return this};d.prototype.getItemIndex=function(a){this.$items=a.parent().children(".item");return this.$items.index(a||this.$active)};d.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b);return("prev"==a&&0===c||"next"==a&&c==this.$items.length-
1)&&!this.options.wrap?b:this.$items.eq((c+("prev"==a?-1:1))%this.$items.length)};d.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(a>this.$items.length-1||0>a))return this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))};d.prototype.pause=function(a){a||(this.paused=!0);this.$element.find(".next, .prev").length&&b.support.transition&&(this.$element.trigger(b.support.transition.end),
this.cycle(!0));this.interval=clearInterval(this.interval);return this};d.prototype.next=function(){if(!this.sliding)return this.slide("next")};d.prototype.prev=function(){if(!this.sliding)return this.slide("prev")};d.prototype.slide=function(a,f){var c=this.$element.find(".item.active"),e=f||this.getItemForDirection(a,c);f=this.interval;var g="next"==a?"left":"right",h=this;if(e.hasClass("active"))return this.sliding=!1;var k=e[0],l=b.Event("slide.bs.carousel",{relatedTarget:k,direction:g});this.$element.trigger(l);
if(!l.isDefaultPrevented()){this.sliding=!0;f&&this.pause();this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),(l=b(this.$indicators.children()[this.getItemIndex(e)]))&&l.addClass("active"));var m=b.Event("slid.bs.carousel",{relatedTarget:k,direction:g});b.support.transition&&this.$element.hasClass("slide")?(e.addClass(a),e[0].offsetWidth,c.addClass(g),e.addClass(g),c.one("bsTransitionEnd",function(){e.removeClass([a,g].join(" ")).addClass("active");c.removeClass(["active",
g].join(" "));h.sliding=!1;setTimeout(function(){h.$element.trigger(m)},0)}).emulateTransitionEnd(d.TRANSITION_DURATION)):(c.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger(m));f&&this.cycle();return this}};var n=b.fn.carousel;b.fn.carousel=h;b.fn.carousel.Constructor=d;b.fn.carousel.noConflict=function(){b.fn.carousel=n;return this};var k=function(a){var d,c=b(this),e=b(c.attr("data-target")||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(e.hasClass("carousel")){d=
b.extend({},e.data(),c.data());if(c=c.attr("data-slide-to"))d.interval=!1;h.call(e,d);c&&e.data("bs.carousel").to(c);a.preventDefault()}};b(document).on("click.bs.carousel.data-api","[data-slide]",k).on("click.bs.carousel.data-api","[data-slide-to]",k);b(window).on("load",function(){b('[data-ride="carousel"]').each(function(){var a=b(this);h.call(a,a.data())})})}(jQuery);




© 2015 - 2024 Weber Informatics LLC | Privacy Policy