Files
dnssash/theme/rd.laser/js/libs/jquery.cycle2.min.js
T
2026-06-11 18:47:38 +09:00

6 lines
5.8 KiB
JavaScript

/*!
* jQuery Cycle2; version: 2.1.6
* http://jquery.malsup.com/cycle2/
* Copyright (c) 2014 M. Alsup; Dual licensed: MIT/GPL
*/
!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){"use strict";function b(a){return a.toLowerCase().replace(/ \w/g,function(a){return a.toUpperCase()})}function c(b,c){b.timeoutId&&clearTimeout(b.timeoutId),b.API.stop(),c.API.opts().autoHeight&&c.API.autoHeight(!0),c.slides.not(b).css("visibility","hidden"),c.slides.not(b).css("zIndex",0),b.css({visibility:"visible",zIndex:c.API.opts().slideCount+1})}var d=console||{log:a.noop,warn:a.noop},e={version:"2.1.6",API:{opts:function(){return this.data("cycle.opts")},add:function(b,c){var d=this.data("cycle.opts");d.slideCount=d.slides.push(b)-1,d.slideNum=d.slideCount,c!==!1&&this.cycle("goto",d.slideCount),this.cycle("updateView")},addInitialSlides:function(){var b=this.data("cycle.opts"),c=b.slides;b.slideCount=0,b.slideNum=0,c=c.jquery?c:b.container.find(b.slides),c.each(function(c){b.API.add(this,c===b.startingSlide&&b.startingSlide>0)})},autoHeight:function(b){var c=this.data("cycle.opts"),d=this.height(),e=c.container.parent();b===!0?(e.height(d),c.autoHeight=b):c.autoHeight&&(d=c.API.getSlideHeight(c.currSlide),e.height(d))},destroy:function(){var b=this.data("cycle.opts");b&&(b.timeoutId&&clearTimeout(b.timeoutId),b.API.stop(),b.container.unbind(".cycle"),b.slides.removeData("cycle.opts"),b.container.removeData("cycle.opts"),b.API.trigger("cycle-destroyed",b),a(b.slides).each(function(){a(this).css(b.original.css)}),d.log("Cycle2: ",b,"destroyed"))},calcNextSlide:function(){var a,b=this.data("cycle.opts");return a=b.reverse?b.nextSlide-1:b.nextSlide+1,a>=b.slideCount?a=0:0>a&&(a=b.slideCount-1),a},calcPrevSlide:function(){var a,b=this.data("cycle.opts");return a=b.reverse?b.nextSlide+1:b.nextSlide-1,a>=b.slideCount?a=0:0>a&&(a=b.slideCount-1),a},getSlideIndex:function(b){var c=this.data("cycle.opts");return c.slides.index(b)},getSlideHeight:function(b){var c=this.data("cycle.opts"),d=a(b).height();return"auto"===c.autoHeight||"container"===c.autoHeight?d:c.container.height()},next:function(){var b=this.data("cycle.opts");if(!b.busy||b.manualTrump)b.API.calcNextSlide(),b.API.prepareTx(!1,b.reverse)},prev:function(){var b=this.data("cycle.opts");if(!b.busy||b.manualTrump)b.API.calcPrevSlide(),b.API.prepareTx(!1,b.reverse)},prepareTx:function(a,b){var c,e=this.data("cycle.opts");if(e.busy)return;e.API.stop(),e.busy=!0,e.API.trigger("cycle-before",e),e.reverse=b,e.nextSlide=e.API.calcNextSlide(),e.currSlide=e.API.calcPrevSlide(),c=e.slides[e.currSlide],e.API.getSlideHeight(c),e.API.opts().autoHeight&&e.API.autoHeight(),e.API.opts().sync?e.API.doTransition():e.API.queueTransition(e)},doTransition:function(){var b=this.data("cycle.opts"),e=b.fx;b.nextSlide,b.currSlide;var f=a(b.slides[b.nextSlide]),g=a(b.slides[b.currSlide]),h=function(){b.busy=!1,b.API.trigger("cycle-after",b),b.API.queue()},i=0,j=b.API.getSlideHeight(f);b.opts.autoHeight&&b.container.animate({height:j},b.autoHeightSpeed,b.autoHeightEase),d.log("transition","fx",e,"slides",g,f);var k=b.container.data("cycle.API");k||(k=b.container.data("cycle-API",b.API));var l=k.getTx(e,f,g,b);for(i=0;i<l.length;i++)l[i].opts=b;var m=function(){for(var a=0;a<l.length;a++)l[a].start();h()};b.API.opts().sync?m():setTimeout(m,b.delay)},queueTransition:function(b){var c=this.data("cycle.opts"),e=c.API.opts().sync,f=c.API.opts().delay||0;return this.cycle("stop"),e?c.API.doTransition():void(b.timeoutId=setTimeout(function(){c.API.doTransition()},f))},reinit:function(){var b=this.data("cycle.opts"),c=a.extend({},b);this.cycle("destroy"),this.cycle(c)},resume:function(){var a=this.data("cycle.opts");a.paused&&this.cycle("stop"),a.paused=!1,a.API.trigger("cycle-resumed",a),a.timeout&&a.API.queueTransition(a)},stop:function(){var a=this.data("cycle.opts");a.timeoutId&&clearTimeout(a.timeoutId),a.timeoutId=0,a.container.find("*:animated").stop(!0,!0),a.API.trigger("cycle-stopped",a)},trigger:function(b,c){var e=this.data("cycle.opts");d.log("trigger",b,c),e.container.trigger(b,c)},updateView:function(a,b){var c=this.data("cycle.opts");c.slideCount=c.slides.length,c.slideNum=c.currSlide,a||(c.API.trigger("cycle-update-view",c),c.API.autoHeight()),b&&c.API.opts().sync&&c.API.doTransition()}},f=a.fn.cycle=function(b){var c={init:function(b){this.data("cycle.opts")&&e.API.reinit.call(this);var c=a.extend({},a.fn.cycle.defaults,b||{}),f=c.slides;c.container=this,c.slides=f,c.original={css:a(f).css(["display","visibility","opacity","position","top","left","zIndex"])},e.API.addInitialSlides.call(this),c.API=a.extend({_container:this},e.API),c.API.opts=function(){return c},this.data("cycle.opts",c),c.API.trigger("cycle-initialized",c),c.API.updateView(!0),c.timeout&&c.API.queueTransition(c)},option:function(b,c){var e=this.data("cycle.opts");if(void 0===c)return e[b];e[b]=c,d.log("cycle.option",b,c,e)},"goto":function(b){var c=this.data("cycle.opts");c.nextSlide=b,c.API.prepareTx(!0,c.reverse)},reinit:e.API.reinit,destroy:e.API.destroy,next:e.API.next,prev:e.API.prev,stop:e.API.stop,resume:e.API.resume,pause:function(){var a=this.data("cycle.opts");a.paused=!0,a.API.trigger("cycle-paused",a)}};return c[b]?c[b].apply(this,Array.prototype.slice.call(arguments,1)):c.init.apply(this,arguments)},a.fn.cycle.defaults={allowWrap:!0,autoHeight:!1,autoHeightSpeed:250,autoHeightEase:"swing",delay:0,easing:"swing",fx:"fade",hideNonActive:!0,log:!1,loop:0,manualTrump:!0,next:null,paused:!1,prev:null,progressive:!1,reverse:!1,slideCount:0,slideNum:0,slides:"> div",speed:500,startingSlide:0,sync:!0,timeout:4e3,updateView:0},a(document).on("click.cycle",b("[data-cycle-cmd]"),function(b){b.preventDefault();var c=a(this),d=c.data("cycle-cmd"),e=c.data("cycle-context")||".cycle-slideshow";a(e).cycle(d,c.data("cycle-arg"))})});