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.4.1
 https://getbootstrap.com/docs/3.4/javascript/#carousel
 ========================================================================
 Copyright 2011-2019 Twitter, Inc.
 Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 ======================================================================== */
var process=process||{env:{NODE_ENV:"development"}};
+function(c){function k(a){return this.each(function(){var d=c(this),b=d.data("bs.carousel"),e=c.extend({},f.DEFAULTS,d.data(),"object"==typeof a&&a),g="string"==typeof a?a:e.slide;b||d.data("bs.carousel",b=new f(this,e));if("number"==typeof a)b.to(a);else if(g)b[g]();else e.interval&&b.pause().cycle()})}var f=function(a,d){this.$element=c(a);this.$indicators=this.$element.find(".carousel-indicators");this.options=d;this.$items=this.$active=this.interval=this.sliding=this.paused=null;this.options.keyboard&&
this.$element.on("keydown.bs.carousel",c.proxy(this.keydown,this));"hover"!=this.options.pause||"ontouchstart"in document.documentElement||this.$element.on("mouseenter.bs.carousel",c.proxy(this.pause,this)).on("mouseleave.bs.carousel",c.proxy(this.cycle,this))};f.VERSION="3.4.1";f.TRANSITION_DURATION=600;f.DEFAULTS={interval:5E3,pause:"hover",wrap:!0,keyboard:!0};f.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()}};f.prototype.cycle=function(a){a||(this.paused=!1);this.interval&&clearInterval(this.interval);this.options.interval&&!this.paused&&(this.interval=setInterval(c.proxy(this.next,this),this.options.interval));return this};f.prototype.getItemIndex=function(a){this.$items=a.parent().children(".item");return this.$items.index(a||this.$active)};f.prototype.getItemForDirection=function(a,d){var b=this.getItemIndex(d);return("prev"==a&&0===b||"next"==a&&b==this.$items.length-
1)&&!this.options.wrap?d:this.$items.eq((b+("prev"==a?-1:1))%this.$items.length)};f.prototype.to=function(a){var d=this,b=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(){d.to(a)}):b==a?this.pause().cycle():this.slide(a>b?"next":"prev",this.$items.eq(a))};f.prototype.pause=function(a){a||(this.paused=!0);this.$element.find(".next, .prev").length&&c.support.transition&&(this.$element.trigger(c.support.transition.end),
this.cycle(!0));this.interval=clearInterval(this.interval);return this};f.prototype.next=function(){if(!this.sliding)return this.slide("next")};f.prototype.prev=function(){if(!this.sliding)return this.slide("prev")};f.prototype.slide=function(a,d){var b=this.$element.find(".item.active"),e=d||this.getItemForDirection(a,b);d=this.interval;var g="next"==a?"left":"right",l=this;if(e.hasClass("active"))return this.sliding=!1;var m=e[0],h=c.Event("slide.bs.carousel",{relatedTarget:m,direction:g});this.$element.trigger(h);
if(!h.isDefaultPrevented()){this.sliding=!0;d&&this.pause();this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),(h=c(this.$indicators.children()[this.getItemIndex(e)]))&&h.addClass("active"));var n=c.Event("slid.bs.carousel",{relatedTarget:m,direction:g});c.support.transition&&this.$element.hasClass("slide")?(e.addClass(a),"object"===typeof e&&e.length&&e[0].offsetWidth,b.addClass(g),e.addClass(g),b.one("bsTransitionEnd",function(){e.removeClass([a,g].join(" ")).addClass("active");
b.removeClass(["active",g].join(" "));l.sliding=!1;setTimeout(function(){l.$element.trigger(n)},0)}).emulateTransitionEnd(f.TRANSITION_DURATION)):(b.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger(n));d&&this.cycle();return this}};var q=c.fn.carousel;c.fn.carousel=k;c.fn.carousel.Constructor=f;c.fn.carousel.noConflict=function(){c.fn.carousel=q;return this};var p=function(a){var d=c(this),b=d.attr("href");b&&(b=b.replace(/.*(?=#[^\s]+$)/,""));b=d.attr("data-target")||
b;b=c(document).find(b);if(b.hasClass("carousel")){var e=c.extend({},b.data(),d.data());if(d=d.attr("data-slide-to"))e.interval=!1;k.call(b,e);d&&b.data("bs.carousel").to(d);a.preventDefault()}};c(document).on("click.bs.carousel.data-api","[data-slide]",p).on("click.bs.carousel.data-api","[data-slide-to]",p);c(window).on("load",function(){c('[data-ride="carousel"]').each(function(){var a=c(this);k.call(a,a.data())})})}(jQuery);




© 2015 - 2024 Weber Informatics LLC | Privacy Policy