https://www.hotelflandre.be/sites/default/files/js/js_bhoiWZ2pWbDpFnoJpUy1haplH_AHlnNUPb1U5kZNmVI.js
vendor: 5,779 bytes, lines 1-4
1/* Modernizr 2.5.3 (Custom Build) | MIT & BSD 2 * Build: http://www.modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-canvas-canvastext-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-geolocation-inlinesvg-smil-svg-svgclippaths-touch-webgl-shiv-mq-cssclasses-addtest-prefixed-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load 3 */ 4;window.Modernizr=function(a,b,c){function D(a){j.cssText=a}function E(a,b){return D(n.join(a+";")+(b||""))}function F(a,b){return typeof a===b}function G(a,b){return!!~(""+a).indexOf(b)}function H(a,b){for(var d in a)if(j[a[d]]!==c)return b=="pfx"?a[d]:!0;return!1}function I(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:F(f,"function")?f.bind(d||b):f}return!1}function J(a,b,c){var d=a.charAt(0).toUpperCase()+a.substr(1),e=(a+" "+p.join(d+" ")+d).split(" ");return F(b,"string")||F(b,"undefined")?H(e,b):(e=(a+" "+q.join(d+" ")+d).split(" "),I(e,b,c))}function L(){e.input=function(c){for(var d=0,e=c.length;d<e;d++)u[c[d]]=c[d]in k;return u.list&&(u.list=!!b.createElement("datalist")&&!!a.HTMLDataListElement),u}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")),e.inputtypes=function(a){for(var d=0,e,f,h,i=a.length;d<i;d++)k.setAttribute("type",f=a[d]),e=k.type!=="text",e&&(k.value=l,k.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(f)&&k.style.WebkitAppearance!==c?(g.appendChild(k),h=b.defaultView,e=h.getComputedStyle&&h.getComputedStyle(k,null).WebkitAppearance!=="textfield"&&k.offsetHeight!==0,g.removeChild(k)):/^(search|tel)$/.test(f)||(/^(url|email)$/.test(f)?e=k.checkValidity&&k.checkValidity()===!1:/^color$/.test(f)?(g.appendChild(k),g.offsetWidth,e=k.value!=l,g.removeChild(k)):e=k.value!=l)),t[a[d]]=!!e;return t}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var d="2.5.3",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k=b.createElement("input"),l=":)",m={}.toString,n=" -webkit- -moz- -o- -ms- ".split(" "),o="Webkit Moz O ms",p=o.split(" "),q=o.toLowerCase().split(" "),r={svg:"http://www.w3.org/2000/svg"},s={},t={},u={},v=[],w=v.slice,x,y=function(a,c,d,e){var f,i,j,k=b.createElement("div"),l=b.body,m=l?l:b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),k.appendChild(j);return f=["­","<style>",a,"</style>"].join(""),k.id=h,m.innerHTML+=f,m.appendChild(k),l||(m.style.background="",g.appendChild(m)),i=c(k,a),l?k.parentNode.removeChild(k):m.parentNode.removeChild(m),!!i},z=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b).matches;var d;return y("@media "+b+" { #"+h+" { position: absolute; } }",function(b){d=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle)["position"]=="absolute"}),d},A=function(){function d(d,e){e=e||b.createElement(a[d]||"div"),d="on"+d;var f=d in e;return f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=F(e[d],"function"),F(e[d],"undefined")||(e[d]=c),e.removeAttribute(d))),e=null,f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),B={}.hasOwnProperty,C;!F(B,"undefined")&&!F(B.call,"undefined")?C=function(a,b){return B.call(a,b)}:C=function(a,b){return b in a&&F(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=w.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(w.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(w.call(arguments)))};return e});var K=function(c,d){var f=c.join(""),g=d.length;y(f,function(c,d){var f=b.styleSheets[b.styleSheets.length-1],h=f?f.cssRules&&f.cssRules[0]?f.cssRules[0].cssText:f.cssText||"":"",i=c.childNodes,j={};while(g--)j[i[g].id]=i[g];e.touch="ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch||(j.touch&&j.touch.offsetTop)===9,e.csstransforms3d=(j.csstransforms3d&&j.csstransforms3d.offsetLeft)===9&&j.csstransforms3d.offsetHeight===3,e.generatedcontent=(j.generatedcontent&&j.generatedcontent.offsetHeight)>=1,e.fontface=/src/i.test(h)&&h.indexOf(d.split(" ")[0])===0},g,d)}(['@font-face {font-family:"font";src:url("https://")}',["@media (",n.join("touch-enabled),("),h,")","{#touch{top:9px;position:absolute}}"].join(""),["@media (",n.join("transform-3d),("),h,")","{#csstransforms3d{left:9px;position:absolute;height:3px;}}"].join(""),['#generatedcontent:after{content:"',l,'";visibility:hidden}'].join("")],["fontface","touch","csstransforms3d","generatedcontent"]);s.flexbox=function(){return J("flexOrder")},s.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")},s.canvastext=function(){return!!e.canvas&&!!F(b.createElement("canvas").getContext("2d").fillText,"function")},s.webgl=function(){try{var d=b.createElement("canvas"),e;e=!(!a.WebGLRenderingContext||!d.getContext("experimental-webgl")&&!d.getContext("webgl")),d=c}catch(f){e=!1}return e},s.touch=function(){return e.touch},s.geolocation=function(){return!!navigator.geolocation},s.postmessage=function(){return!!a.postMessage},s.websqldatabase=function(){return!!a.openDatabase},s.indexedDB=function(){return!!J("indexedDB",a)},s.hashchange=function(){return A("hashchange",a)&&(b.documentMode===c||b.documentMode>7)}
4,s.history=function(){return!!a.history&&!!history.pushState},s.draganddrop=function(){var a=b.createElement("div");return"draggable"in a||"ondragstart"in a&&"ondrop"in a},s.websockets=function(){for(var b=-1,c=p.length;++b<c;)if(a[p[b]+"WebSocket"])return!0;return"WebSocket"in a},s.rgba=function(){return D("background-color:rgba(150,255,150,.5)"),G(j.backgroundColor,"rgba")},s.hsla=function(){return D("background-color:hsla(120,40%,100%,.5)"),G(j.backgroundColor,"rgba")||G(j.backgroundColor,"hsla")},s.multiplebgs=function(){return D("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(j.background)},s.backgroundsize=function(){return J("backgroundSize")},s.borderimage=function(){return J("borderImage")},s.borderradius=function(){return J("borderRadius")},s.boxshadow=function(){return J("boxShadow")},s.textshadow=function(){return b.createElement("div").style.textShadow===""},s.opacity=function(){return E("opacity:.55"),/^0.55$/.test(j.opacity)},s.cssanimations=function(){return J("animationName")},s.csscolumns=function(){return J("columnCount")},s.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";return D((a+"-webkit- ".split(" ").join(b+a)+n.join(c+a)).slice(0,-a.length)),G(j.backgroundImage,"gradient")},s.cssreflections=function(){return J("boxReflect")},s.csstransforms=function(){return!!J("transform")},s.csstransforms3d=function(){var a=!!J("perspective");return a&&"webkitPerspective"in g.style&&(a=e.csstransforms3d),a},s.csstransitions=function(){return J("transition")},s.fontface=function(){return e.fontface},s.generatedcontent=function(){return e.generatedcontent},s.video=function(){var a=b.createElement("video"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),c.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")}catch(d){}return c},s.audio=function(){var a=b.createElement("audio"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),c.mp3=a.canPlayType("audio/mpeg;").replace(/^no$/,""),c.wav=a.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),c.m4a=(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")).replace(/^no$/,"")}catch(d){}return c},s.localstorage=function(){try{return localStorage.setItem(h,h),localStorage.removeItem(h),!0}catch(a){return!1}},s.sessionstorage=function(){try{return sessionStorage.setItem(h,h),sessionStorage.removeItem(h),!0}catch(a){return!1}},s.webworkers=function(){return!!a.Worker},s.applicationcache=function(){return!!a.applicationCache},s.svg=function(){return!!b.createElementNS&&!!b.createElementNS(r.svg,"svg").createSVGRect},s.inlinesvg=function(){var a=b.createElement("div");return a.innerHTML="<svg/>",(a.firstChild&&a.firstChild.namespaceURI)==r.svg},s.smil=function(){return!!b.createElementNS&&/SVGAnimate/.test(m.call(b.createElementNS(r.svg,"animate")))},s.svgclippaths=function(){return!!b.createElementNS&&/SVGClipPath/.test(m.call(b.createElementNS(r.svg,"clipPath")))};for(var M in s)C(s,M)&&(x=M.toLowerCase(),e[x]=s[M](),v.push((e[x]?"":"no-")+x));return e.input||L(),e.addTest=function(a,b){if(typeof a=="object")for(var d in a)C(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,g.className+=" "+(b?"":"no-")+a,e[a]=b}return e},D(""),i=k=null,function(a,b){function g(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function h(){var a=k.elements;return typeof a=="string"?a.split(" "):a}function i(a){var b={},c=a.createElement,e=a.createDocumentFragment,f=e();a.createElement=function(a){var e=(b[a]||(b[a]=c(a))).cloneNode();return k.shivMethods&&e.canHaveChildren&&!d.test(a)?f.appendChild(e):e},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+h().join().replace(/\w+/g,function(a){return b[a]=c(a),f.createElement(a),'c("'+a+'")'})+");return n}")(k,f)}function j(a){var b;return a.documentShived?a:(k.shivCSS&&!e&&(b=!!g(a,"article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{dis
4play:block}audio{display:none}canvas,video{display:inline-block;*display:inline;*zoom:1}[hidden]{display:none}audio[controls]{display:inline-block;*display:inline;*zoom:1}mark{background:#FF0;color:#000}")),f||(b=!i(a)),b&&(a.documentShived=b),a)}var c=a.html5||{},d=/^<|^(?:button|form|map|select|textarea)$/i,e,f;(function(){var a=b.createElement("a");a.innerHTML="<xyz></xyz>",e="hidden"in a,f=a.childNodes.length==1||function(){try{b.createElement("a")}catch(a){return!0}var c=b.createDocumentFragment();return typeof c.cloneNode=="undefined"||typeof c.createDocumentFragment=="undefined"||typeof c.createElement=="undefined"}()})();var k={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:j};a.html5=k,j(b)}(this,b),e._version=d,e._prefixes=n,e._domPrefixes=q,e._cssomPrefixes=p,e.mq=z,e.hasEvent=A,e.testProp=function(a){return H([a])},e.testAllProps=J,e.testStyles=y,e.prefixed=function(a,b,c){return b?J(a,b,c):J(a,"pfx")},g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+v.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return o.call(a)=="[object Function]"}function e(a){return typeof a=="string"}function f(){}function g(a){return!a||a=="loaded"||a=="complete"||a=="uninitialized"}function h(){var a=p.shift();q=1,a?a.t?m(function(){(a.t=="c"?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){a!="img"&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l={},o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};y[c]===1&&(r=1,y[c]=[],l=b.createElement(a)),a=="object"?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),a!="img"&&(r||y[c]===2?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i(b=="c"?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),p.length==1&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&o.call(a.opera)=="[object Opera]",l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return o.call(a)=="[object Array]"},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,i){var j=b(a),l=j.autoCallback;j.url.split(".").pop().split("?").shift(),j.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]||h),j.instead?j.instead(a,e,f,g,i):(y[j.url]?j.noexec=!0:y[j.url]=1,f.load(j.url,j.forceCSS||!j.forceJS&&"css"==j.url.split(".").pop().split("?").shift()?"c":c,j.noexec,j.attrs,j.timeout),(d(e)||d(l))&&f.load(function(){k(),e&&e(j.origUrl,i,g),l&&l(j.origUrl,i,g),y[j.url]=2})))}function i(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var j,l,m=this.yepnope.loader;if(e(a))g(a,0,m,0);else if(w(a))for(j=0;j<a.length;j++)l=a[j],e(l)?g(l,0,m,0):w(l)?B(l):Object(l)===l&&i(l,m);else Object(a)===a&&i(a,m)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,b.readyState==null&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",A=function(){b.removeEventListener("DOMContentLoaded",A,0),b.readyState="complete"},0)),a.yepnope=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var k=b.createElement("script"),l,o,e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h:c||f,k.onreadystatechange=k.onload=function(){!l&&g(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m(function(){l||(l=1,c(1))},e),i?k.onload():n.parentNode.insertBefore(k,n)},a.yepnope.injectCss=function(a,c,d,e,g,i){var e=b.createElement("link"),j,c=i?h:c||f;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(n.parentNode.insertBefore(e,n),m(c,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))}; 5; 6/*! 7 * jQuery Cycle Plugin (with Transition Definitions) 8 * Examples and documentation at: http://jquery.malsup.com/cycle/ 9 * Copyright (c) 2007-2010 M. Alsup 10 * Version: 2.9999.5 (10-APR-2012) 11 * Dual licensed under the MIT and GPL licenses. 12 * http://jquery.malsup.com/license.html 13 * Requires: jQuery v1.3.2 or later 14 */ 15;(function($, undefined) { 16"use strict"; 17 18var ver = '2.9999.5'; 19 20// if $.support is not defined (pre jQuery 1.3) add what I need
21if ($.support === undefined) { 22 $.support = { 23 opacity: !($.browser.msie) 24 }; 25} 26 27function debug(s) { 28 if ($.fn.cycle.debug) 29 log(s); 30} 31function log() { 32 if (window.console && console.log) 33 console.log('[cycle] ' + Array.prototype.join.call(arguments,' ')); 34} 35$.expr[':'].paused = function(el) { 36 return el.cyclePause; 37}; 38 39 40// the options arg can be... 41// a number - indicates an immediate transition should occur to the given slide index 42// a string - 'pause', 'resume', 'toggle', 'next', 'prev', 'stop', 'destroy' or the name of a transition effect (ie, 'fade', 'zoom', etc) 43// an object - properties to control the slideshow 44// 45// the arg2 arg can be... 46// the name of an fx (only used in conjunction with a numeric value for 'options') 47// the value true (only used in first arg == 'resume') and indicates 48// that the resume should occur immediately (not wait for next timeout) 49 50$.fn.cycle = function(options, arg2) { 51 var o = { s: this.selector, c: this.context }; 52 53 // in 1.3+ we can fix mistakes with the ready state 54 if (this.length === 0 && options != 'stop') { 55 if (!$.isReady && o.s) { 56 log('DOM not ready, queuing slideshow'); 57 $(function() { 58 $(o.s,o.c).cycle(options,arg2); 59 }); 60 return this; 61 } 62 // is your DOM ready? http://docs.jquery.com/Tutorials:Introducing_$(document).ready() 63 log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)')); 64 return this; 65 } 66 67 // iterate the matched nodeset 68 return this.each(function() { 69 var opts = handleArguments(this, options, arg2); 70 if (opts === false) 71 return; 72 73 opts.updateActivePagerLink = opts.updateActivePagerLink || $.fn.cycle.updateActivePagerLink; 74 75 // stop existing slideshow for this container (if there is one) 76 if (this.cycleTimeout) 77 clearTimeout(this.cycleTimeout); 78 this.cycleTimeout = this.cyclePause = 0; 79 this.cycleStop = 0; // issue #108 80 81 var $cont = $(this); 82 var $slides = opts.slideExpr ? $(opts.slideExpr, this) : $cont.children(); 83 var els = $slides.get(); 84 85 if (els.length < 2) { 86 log('terminating; too few slides: ' + els.length); 87 return; 88 } 89 90 var opts2 = buildOptions($cont, $slides, els, opts, o); 91 if (opts2 === false) 92 return; 93 94 var startTime = opts2.continuous ? 10 : getTimeout(els[opts2.currSlide], els[opts2.nextSlide], opts2, !opts2.backwards); 95 96 // if it's an auto slideshow, kick it off 97 if (startTime) { 98 startTime += (opts2.delay || 0); 99 if (startTime < 10) 100 startTime = 10; 101 debug('first timeout: ' + startTime); 102 this.cycleTimeout = setTimeout(function(){go(els,opts2,0,!opts.backwards);}, startTime); 103 } 104 }); 105}; 106 107function triggerPause(cont, byHover, onPager) { 108 var opts = $(cont).data('cycle.opts'); 109 var paused = !!cont.cyclePause; 110 if (paused && opts.paused) 111 opts.paused(cont, opts, byHover, onPager); 112 else if (!paused && opts.resumed) 113 opts.resumed(cont, opts, byHover, onPager); 114} 115 116// process the args that were passed to the plugin fn 117function handleArguments(cont, options, arg2) { 118 if (cont.cycleStop === undefined) 119 cont.cycleStop = 0; 120 if (options === undefined || options === null) 121 options = {}; 122 if (options.constructor == String) { 123 switch(options) { 124 case 'destroy': 125 case 'stop': 126 var opts = $(cont).data('cycle.opts'); 127 if (!opts) 128 return false; 129 cont.cycleStop++; // callbacks look for change 130 if (cont.cycleTimeout) 131 clearTimeout(cont.cycleTimeout); 132 cont.cycleTimeout = 0; 133 if (opts.elements) 134 $(opts.elements).stop(); 135 $(cont).removeData('cycle.opts'); 136 if (options == 'destroy') 137 destroy(cont, opts); 138 return false; 139 case 'toggle': 140 cont.cyclePause = (cont.cyclePause === 1) ? 0 : 1; 141 checkInstantResume(cont.cyclePause, arg2, cont); 142 triggerPause(cont); 143 return false; 144 case 'pause': 145 cont.cyclePause = 1; 146 triggerPause(cont); 147 return false; 148 case 'resume': 149 cont.cyclePause = 0; 150 checkInstantResume(false, arg2, cont); 151 triggerPause(cont); 152 return false; 153 case 'prev': 154 case 'next': 155 opts = $(cont).data('cycle.opts'); 156 if (!opts) { 157 log('options not found, "prev/next" ignored'); 158 return false;
159 } 160 $.fn.cycle[options](opts); 161 return false; 162 default: 163 options = { fx: options }; 164 } 165 return options; 166 } 167 else if (options.constructor == Number) { 168 // go to the requested slide 169 var num = options; 170 options = $(cont).data('cycle.opts'); 171 if (!options) { 172 log('options not found, can not advance slide'); 173 return false; 174 } 175 if (num < 0 || num >= options.elements.length) { 176 log('invalid slide index: ' + num); 177 return false; 178 } 179 options.nextSlide = num; 180 if (cont.cycleTimeout) { 181 clearTimeout(cont.cycleTimeout); 182 cont.cycleTimeout = 0; 183 } 184 if (typeof arg2 == 'string') 185 options.oneTimeFx = arg2; 186 go(options.elements, options, 1, num >= options.currSlide); 187 return false; 188 } 189 return options; 190 191 function checkInstantResume(isPaused, arg2, cont) { 192 if (!isPaused && arg2 === true) { // resume now! 193 var options = $(cont).data('cycle.opts'); 194 if (!options) { 195 log('options not found, can not resume'); 196 return false; 197 } 198 if (cont.cycleTimeout) { 199 clearTimeout(cont.cycleTimeout); 200 cont.cycleTimeout = 0; 201 } 202 go(options.elements, options, 1, !options.backwards); 203 } 204 } 205} 206 207function removeFilter(el, opts) { 208 if (!$.support.opacity && opts.cleartype && el.style.filter) { 209 try { el.style.removeAttribute('filter'); } 210 catch(smother) {} // handle old opera versions 211 } 212} 213 214// unbind event handlers 215function destroy(cont, opts) { 216 if (opts.next) 217 $(opts.next).unbind(opts.prevNextEvent); 218 if (opts.prev) 219 $(opts.prev).unbind(opts.prevNextEvent); 220 221 if (opts.pager || opts.pagerAnchorBuilder) 222 $.each(opts.pagerAnchors || [], function() { 223 this.unbind().remove(); 224 }); 225 opts.pagerAnchors = null; 226 $(cont).unbind('mouseenter.cycle mouseleave.cycle'); 227 if (opts.destroy) // callback 228 opts.destroy(opts); 229} 230 231// one-time initialization 232function buildOptions($cont, $slides, els, options, o) { 233 var startingSlideSpecified; 234 // support metadata plugin (v1.0 and v2.0) 235 var opts = $.extend({}, $.fn.cycle.defaults, options || {}, $.metadata ? $cont.metadata() : $.meta ? $cont.data() : {}); 236 var meta = $.isFunction($cont.data) ? $cont.data(opts.metaAttr) : null; 237 if (meta) 238 opts = $.extend(opts, meta); 239 if (opts.autostop) 240 opts.countdown = opts.autostopCount || els.length; 241 242 var cont = $cont[0]; 243 $cont.data('cycle.opts', opts); 244 opts.$cont = $cont; 245 opts.stopCount = cont.cycleStop; 246 opts.elements = els; 247 opts.before = opts.before ? [opts.before] : []; 248 opts.after = opts.after ? [opts.after] : []; 249 250 // push some after callbacks 251 if (!$.support.opacity && opts.cleartype) 252 opts.after.push(function() { removeFilter(this, opts); }); 253 if (opts.continuous) 254 opts.after.push(function() { go(els,opts,0,!opts.backwards); }); 255 256 saveOriginalOpts(opts); 257 258 // clearType corrections 259 if (!$.support.opacity && opts.cleartype && !opts.cleartypeNoBg) 260 clearTypeFix($slides); 261 262 // container requires non-static position so that slides can be position within 263 if ($cont.css('position') == 'static') 264 $cont.css('position', 'relative'); 265 if (opts.width) 266 $cont.width(opts.width); 267 if (opts.height && opts.height != 'auto') 268 $cont.height(opts.height); 269 270 if (opts.startingSlide !== undefined) { 271 opts.startingSlide = parseInt(opts.startingSlide,10); 272 if (opts.startingSlide >= els.length || opts.startSlide < 0) 273 opts.startingSlide = 0; // catch bogus input 274 else 275 startingSlideSpecified = true; 276 } 277 else if (opts.backwards) 278 opts.startingSlide = els.length - 1; 279 else 280 opts.startingSlide = 0; 281 282 // if random, mix up the slide array 283 if (opts.random) { 284 opts.randomMap = []; 285 for (var i = 0; i < els.length; i++) 286 opts.randomMap.push(i); 287 opts.randomMap.sort(function(a,b) {return Math.random() - 0.5;}); 288 if (startingSlideSpecified) { 289 // try to find the specified starting slide and if found set start slide index in the map accordingly 290 for ( var cnt = 0; cnt < els.length; cnt++ ) { 291 if ( opts.startingSlide == opts.randomMap[cnt] ) { 292 opts.randomIndex = cnt; 293 } 294 } 295 } 296 else { 297 opts.randomIndex = 1; 298 opts.startingSlide = opts.randomMap[1]; 299 } 300 } 301 else if (opts.startingSlide >= els.length) 302 opts.startingSlide = 0; // catch bogus input 303 opts.currSlide = opts.startingSlide || 0; 304 var first = opts.startingSlide; 305 306 // set position and zIndex on all the slides
307 $slides.css({position: 'absolute', top:0, left:0}).hide().each(function(i) { 308 var z; 309 if (opts.backwards) 310 z = first ? i <= first ? els.length + (i-first) : first-i : els.length-i; 311 else 312 z = first ? i >= first ? els.length - (i-first) : first-i : els.length-i; 313 $(this).css('z-index', z); 314 }); 315 316 // make sure first slide is visible 317 $(els[first]).css('opacity',1).show(); // opacity bit needed to handle restart use case 318 removeFilter(els[first], opts); 319 320 // stretch slides 321 if (opts.fit) { 322 if (!opts.aspect) { 323 if (opts.width) 324 $slides.width(opts.width); 325 if (opts.height && opts.height != 'auto') 326 $slides.height(opts.height); 327 } else { 328 $slides.each(function(){ 329 var $slide = $(this); 330 var ratio = (opts.aspect === true) ? $slide.width()/$slide.height() : opts.aspect; 331 if( opts.width && $slide.width() != opts.width ) { 332 $slide.width( opts.width ); 333 $slide.height( opts.width / ratio ); 334 } 335 336 if( opts.height && $slide.height() < opts.height ) { 337 $slide.height( opts.height ); 338 $slide.width( opts.height * ratio ); 339 } 340 }); 341 } 342 } 343 344 if (opts.center && ((!opts.fit) || opts.aspect)) { 345 $slides.each(function(){ 346 var $slide = $(this); 347 $slide.css({ 348 "margin-left": opts.width ? 349 ((opts.width - $slide.width()) / 2) + "px" : 350 0, 351 "margin-top": opts.height ? 352 ((opts.height - $slide.height()) / 2) + "px" : 353 0 354 }); 355 }); 356 } 357 358 if (opts.center && !opts.fit && !opts.slideResize) { 359 $slides.each(function(){ 360 var $slide = $(this); 361 $slide.css({ 362 "margin-left": opts.width ? ((opts.width - $slide.width()) / 2) + "px" : 0, 363 "margin-top": opts.height ? ((opts.height - $slide.height()) / 2) + "px" : 0 364 }); 365 }); 366 } 367 368 // stretch container 369 var reshape = opts.containerResize && !$cont.innerHeight(); 370 if (reshape) { // do this only if container has no size http://tinyurl.com/da2oa9 371 var maxw = 0, maxh = 0; 372 for(var j=0; j < els.length; j++) { 373 var $e = $(els[j]), e = $e[0], w = $e.outerWidth(), h = $e.outerHeight(); 374 if (!w) w = e.offsetWidth || e.width || $e.attr('width'); 375 if (!h) h = e.offsetHeight || e.height || $e.attr('height'); 376 maxw = w > maxw ? w : maxw; 377 maxh = h > maxh ? h : maxh; 378 } 379 if (maxw > 0 && maxh > 0) 380 $cont.css({width:maxw+'px',height:maxh+'px'}); 381 } 382 383 var pauseFlag = false; // https://github.com/malsup/cycle/issues/44 384 if (opts.pause) 385 $cont.bind('mouseenter.cycle', function(){ 386 pauseFlag = true; 387 this.cyclePause++; 388 triggerPause(cont, true); 389 }).bind('mouseleave.cycle', function(){ 390 if (pauseFlag) 391 this.cyclePause--; 392 triggerPause(cont, true); 393 }); 394 395 if (supportMultiTransitions(opts) === false) 396 return false; 397 398 // apparently a lot of people use image slideshows without height/width attributes on the images. 399 // Cycle 2.50+ requires the sizing info for every slide; this block tries to deal with that. 400 var requeue = false; 401 options.requeueAttempts = options.requeueAttempts || 0; 402 $slides.each(function() { 403 // try to get height/width of each slide 404 var $el = $(this); 405 this.cycleH = (opts.fit && opts.height) ? opts.height : ($el.height() || this.offsetHeight || this.height || $el.attr('height') || 0); 406 this.cycleW = (opts.fit && opts.width) ? opts.width : ($el.width() || this.offsetWidth || this.width || $el.attr('width') || 0); 407 408 if ( $el.is('img') ) { 409 // sigh.. sniffing, hacking, shrugging... this crappy hack tries to account for what browsers do when 410 // an image is being downloaded and the markup did not include sizing info (height/width attributes); 411 // there seems to be some "default" sizes used in this situation 412 var loadingIE = ($.browser.msie && this.cycleW == 28 && this.cycleH == 30 && !this.complete); 413 var loadingFF = ($.browser.mozilla && this.cycleW == 34 && this.cycleH == 19 && !this.complete); 414 var loadingOp = ($.browser.opera && ((this.cycleW == 42 && this.cycleH == 19) || (this.cycleW == 37 && this.cycleH == 17)) && !this.complete); 415 var loadingOther = (this.cycleH === 0 && this.cycleW === 0 && !this.complete); 416 // don't requeue for images that are still loading but have a valid size 417 if (loadingIE || loadingFF || loadingOp || loadingOther) { 418 if (o.s && opts.requeueOnImageNotLoaded && ++options.requeueAttempts < 100) { // track retry count so we don't loop forever 419 log(options.requeueAttempts,' - img slide not loaded, requeuing slideshow: ', this.src, this.cycleW, this.cycleH); 420 setTimeout(function() {$(o.s,o.c).cycle(options);}, opts.requeueTimeout); 421 requeue = true; 422 return false; // break each loop 423 } 424 else { 425 log('could not determine size of image: '+this.src, this.cycleW, this.cycleH); 426 } 427 } 428 } 429 return true; 430 }); 431 432 if (requeue) 433 return false;
434 435 opts.cssBefore = opts.cssBefore || {}; 436 opts.cssAfter = opts.cssAfter || {}; 437 opts.cssFirst = opts.cssFirst || {}; 438 opts.animIn = opts.animIn || {}; 439 opts.animOut = opts.animOut || {}; 440 441 $slides.not(':eq('+first+')').css(opts.cssBefore); 442 $($slides[first]).css(opts.cssFirst); 443 444 if (opts.timeout) { 445 opts.timeout = parseInt(opts.timeout,10); 446 // ensure that timeout and speed settings are sane 447 if (opts.speed.constructor == String) 448 opts.speed = $.fx.speeds[opts.speed] || parseInt(opts.speed,10); 449 if (!opts.sync) 450 opts.speed = opts.speed / 2; 451 452 var buffer = opts.fx == 'none' ? 0 : opts.fx == 'shuffle' ? 500 : 250; 453 while((opts.timeout - opts.speed) < buffer) // sanitize timeout 454 opts.timeout += opts.speed; 455 } 456 if (opts.easing) 457 opts.easeIn = opts.easeOut = opts.easing; 458 if (!opts.speedIn) 459 opts.speedIn = opts.speed; 460 if (!opts.speedOut) 461 opts.speedOut = opts.speed; 462 463 opts.slideCount = els.length; 464 opts.currSlide = opts.lastSlide = first; 465 if (opts.random) { 466 if (++opts.randomIndex == els.length) 467 opts.randomIndex = 0; 468 opts.nextSlide = opts.randomMap[opts.randomIndex]; 469 } 470 else if (opts.backwards) 471 opts.nextSlide = opts.startingSlide === 0 ? (els.length-1) : opts.startingSlide-1; 472 else 473 opts.nextSlide = opts.startingSlide >= (els.length-1) ? 0 : opts.startingSlide+1; 474 475 // run transition init fn 476 if (!opts.multiFx) { 477 var init = $.fn.cycle.transitions[opts.fx]; 478 if ($.isFunction(init)) 479 init($cont, $slides, opts); 480 else if (opts.fx != 'custom' && !opts.multiFx) { 481 log('unknown transition: ' + opts.fx,'; slideshow terminating'); 482 return false; 483 } 484 } 485 486 // fire artificial events 487 var e0 = $slides[first]; 488 if (!opts.skipInitializationCallbacks) { 489 if (opts.before.length) 490 opts.before[0].apply(e0, [e0, e0, opts, true]); 491 if (opts.after.length) 492 opts.after[0].apply(e0, [e0, e0, opts, true]); 493 } 494 if (opts.next) 495 $(opts.next).bind(opts.prevNextEvent,function(){return advance(opts,1);}); 496 if (opts.prev) 497 $(opts.prev).bind(opts.prevNextEvent,function(){return advance(opts,0);}); 498 if (opts.pager || opts.pagerAnchorBuilder) 499 buildPager(els,opts); 500 501 exposeAddSlide(opts, els); 502 503 return opts; 504} 505 506// save off original opts so we can restore after clearing state 507function saveOriginalOpts(opts) { 508 opts.original = { before: [], after: [] }; 509 opts.original.cssBefore = $.extend({}, opts.cssBefore); 510 opts.original.cssAfter = $.extend({}, opts.cssAfter); 511 opts.original.animIn = $.extend({}, opts.animIn); 512 opts.original.animOut = $.extend({}, opts.animOut); 513 $.each(opts.before, function() { opts.original.before.push(this); }); 514 $.each(opts.after, function() { opts.original.after.push(this); }); 515} 516 517function supportMultiTransitions(opts) { 518 var i, tx, txs = $.fn.cycle.transitions; 519 // look for multiple effects 520 if (opts.fx.indexOf(',') > 0) { 521 opts.multiFx = true; 522 opts.fxs = opts.fx.replace(/\s*/g,'').split(','); 523 // discard any bogus effect names 524 for (i=0; i < opts.fxs.length; i++) { 525 var fx = opts.fxs[i]; 526 tx = txs[fx]; 527 if (!tx || !txs.hasOwnProperty(fx) || !$.isFunction(tx)) { 528 log('discarding unknown transition: ',fx); 529 opts.fxs.splice(i,1); 530 i--; 531 } 532 } 533 // if we have an empty list then we threw everything away! 534 if (!opts.fxs.length) { 535 log('No valid transitions named; slideshow terminating.'); 536 return false; 537 } 538 } 539 else if (opts.fx == 'all') { // auto-gen the list of transitions 540 opts.multiFx = true; 541 opts.fxs = []; 542 for (var p in txs) { 543 if (txs.hasOwnProperty(p)) { 544 tx = txs[p]; 545 if (txs.hasOwnProperty(p) && $.isFunction(tx)) 546 opts.fxs.push(p); 547 } 548 } 549 } 550 if (opts.multiFx && opts.randomizeEffects) { 551 // munge the fxs array to make effect selection random 552 var r1 = Math.floor(Math.random() * 20) + 30; 553 for (i = 0; i < r1; i++) { 554 var r2 = Math.floor(Math.random() * opts.fxs.length); 555 opts.fxs.push(opts.fxs.splice(r2,1)[0]); 556 } 557 debug('randomized fx sequence: ',opts.fxs); 558 } 559 return true; 560} 561 562// provide a mechanism for adding slides after the slideshow has started 563function exposeAddSlide(opts, els) { 564 opts.addSlide = function(newSlide, prepend) {
565 var $s = $(newSlide), s = $s[0]; 566 if (!opts.autostopCount) 567 opts.countdown++; 568 els[prepend?'unshift':'push'](s); 569 if (opts.els) 570 opts.els[prepend?'unshift':'push'](s); // shuffle needs this 571 opts.slideCount = els.length; 572 573 // add the slide to the random map and resort 574 if (opts.random) { 575 opts.randomMap.push(opts.slideCount-1); 576 opts.randomMap.sort(function(a,b) {return Math.random() - 0.5;}); 577 } 578 579 $s.css('position','absolute'); 580 $s[prepend?'prependTo':'appendTo'](opts.$cont); 581 582 if (prepend) { 583 opts.currSlide++; 584 opts.nextSlide++; 585 } 586 587 if (!$.support.opacity && opts.cleartype && !opts.cleartypeNoBg) 588 clearTypeFix($s); 589 590 if (opts.fit && opts.width) 591 $s.width(opts.width); 592 if (opts.fit && opts.height && opts.height != 'auto') 593 $s.height(opts.height); 594 s.cycleH = (opts.fit && opts.height) ? opts.height : $s.height(); 595 s.cycleW = (opts.fit && opts.width) ? opts.width : $s.width(); 596 597 $s.css(opts.cssBefore); 598 599 if (opts.pager || opts.pagerAnchorBuilder) 600 $.fn.cycle.createPagerAnchor(els.length-1, s, $(opts.pager), els, opts); 601 602 if ($.isFunction(opts.onAddSlide)) 603 opts.onAddSlide($s); 604 else 605 $s.hide(); // default behavior 606 }; 607} 608 609// reset internal state; we do this on every pass in order to support multiple effects 610$.fn.cycle.resetState = function(opts, fx) { 611 fx = fx || opts.fx; 612 opts.before = []; opts.after = []; 613 opts.cssBefore = $.extend({}, opts.original.cssBefore); 614 opts.cssAfter = $.extend({}, opts.original.cssAfter); 615 opts.animIn = $.extend({}, opts.original.animIn); 616 opts.animOut = $.extend({}, opts.original.animOut); 617 opts.fxFn = null; 618 $.each(opts.original.before, function() { opts.before.push(this); }); 619 $.each(opts.original.after, function() { opts.after.push(this); }); 620 621 // re-init 622 var init = $.fn.cycle.transitions[fx]; 623 if ($.isFunction(init)) 624 init(opts.$cont, $(opts.elements), opts); 625}; 626 627// this is the main engine fn, it handles the timeouts, callbacks and slide index mgmt 628function go(els, opts, manual, fwd) { 629 var p = opts.$cont[0], curr = els[opts.currSlide], next = els[opts.nextSlide]; 630 631 // opts.busy is true if we're in the middle of an animation 632 if (manual && opts.busy && opts.manualTrump) { 633 // let manual transitions requests trump active ones 634 debug('manualTrump in go(), stopping active transition'); 635 $(els).stop(true,true); 636 opts.busy = 0; 637 clearTimeout(p.cycleTimeout); 638 } 639 640 // don't begin another timeout-based transition if there is one active 641 if (opts.busy) { 642 debug('transition active, ignoring new tx request'); 643 return; 644 } 645 646 647 // stop cycling if we have an outstanding stop request 648 if (p.cycleStop != opts.stopCount || p.cycleTimeout === 0 && !manual) 649 return; 650 651 // check to see if we should stop cycling based on autostop options 652 if (!manual && !p.cyclePause && !opts.bounce && 653 ((opts.autostop && (--opts.countdown <= 0)) || 654 (opts.nowrap && !opts.random && opts.nextSlide < opts.currSlide))) { 655 if (opts.end) 656 opts.end(opts); 657 return; 658 } 659 660 // if slideshow is paused, only transition on a manual trigger 661 var changed = false; 662 if ((manual || !p.cyclePause) && (opts.nextSlide != opts.currSlide)) { 663 changed = true; 664 var fx = opts.fx; 665 // keep trying to get the slide size if we don't have it yet 666 curr.cycleH = curr.cycleH || $(curr).height(); 667 curr.cycleW = curr.cycleW || $(curr).width(); 668 next.cycleH = next.cycleH || $(next).height(); 669 next.cycleW = next.cycleW || $(next).width(); 670 671 // support multiple transition types 672 if (opts.multiFx) { 673 if (fwd && (opts.lastFx === undefined || ++opts.lastFx >= opts.fxs.length)) 674 opts.lastFx = 0; 675 else if (!fwd && (opts.lastFx === undefined || --opts.lastFx < 0)) 676 opts.lastFx = opts.fxs.length - 1; 677 fx = opts.fxs[opts.lastFx]; 678 } 679 680 // one-time fx overrides apply to: $('div').cycle(3,'zoom'); 681 if (opts.oneTimeFx) { 682 fx = opts.oneTimeFx; 683 opts.oneTimeFx = null; 684 } 685 686 $.fn.cycle.resetState(opts, fx); 687 688 // run the before callbacks 689 if (opts.before.length) 690 $.each(opts.before, function(i,o) { 691 if (p.cycleStop != opts.stopCount) return; 692 o.apply(next, [curr, next, opts, fwd]); 693 }); 694 695 // stage the after callacks 696 var after = function() { 697 opts.busy = 0; 698 $.each(opts.after, function(i,o) { 699 if (p.cycleStop != opts.stopCount) return; 700 o.apply(next, [curr, next, opts, fwd]); 701 }); 702 if (!p.cycleStop) { 703 // queue next transition 704 queueNext(); 705 } 706 }; 707 708 debug('tx firing('+fx+'); currSlide: ' + opts.currSlide + '; nextSlide: ' + opts.nextSlide); 709 710 // get ready to perform the transition 711 opts.busy = 1; 712 if (opts.fxFn) // fx function provided? 713 opts.fxFn(curr, next, opts, after, fwd, manual && opts.fastOnEvent); 714 else if ($.isFunction($.fn.cycle[opts.fx])) // fx plugin ? 715 $.fn.cycle[opts.fx](curr, next, opts, after, fwd, manual && opts.fastOnEvent); 716 else 717 $.fn.cycle.custom(curr, next, opts, after, fwd, manual && opts.fastOnEvent); 718 } 719 else { 720 queueNext(); 721 } 722 723 if (changed || opts.nextSlide == opts.currSlide) { 724 // calculate the next slide 725 var roll; 726 opts.lastSlide = opts.currSlide; 727 if (opts.random) { 728 opts.currSlide = opts.nextSlide; 729 if (++opts.randomIndex == els.length) { 730 opts.randomIndex = 0; 731 opts.randomMap.sort(function(a,b) {return Math.random() - 0.5;}); 732 } 733 opts.nextSlide = opts.randomMap[opts.randomIndex]; 734 if (opts.nextSlide == opts.currSlide) 735 opts.nextSlide = (opts.currSlide == opts.slideCount - 1) ? 0 : opts.currSlide + 1; 736 } 737 else if (opts.backwards) { 738 roll = (opts.nextSlide - 1) < 0; 739 if (roll && opts.bounce) { 740 opts.backwards = !opts.backwards; 741 opts.nextSlide = 1; 742 opts.currSlide = 0; 743 } 744 else { 745 opts.nextSlide = roll ? (els.length-1) : opts.nextSlide-1; 746 opts.currSlide = roll ? 0 : opts.nextSlide+1; 747 } 748 } 749 else { // sequence 750 roll = (opts.nextSlide + 1) == els.length; 751 if (roll && opts.bounce) { 752 opts.backwards = !opts.backwards; 753 opts.nextSlide = els.length-2; 754 opts.currSlide = els.length-1; 755 } 756 else { 757 opts.nextSlide = roll ? 0 : opts.nextSlide+1; 758 opts.currSlide = roll ? els.length-1 : opts.nextSlide-1; 759 } 760 } 761 } 762 if (changed && opts.pager) 763 opts.updateActivePagerLink(opts.pager, opts.currSlide, opts.activePagerClass); 764 765 function queueNext() { 766 // stage the next transition 767 var ms = 0, timeout = opts.timeout; 768 if (opts.timeout && !opts.continuous) { 769 ms = getTimeout(els[opts.currSlide], els[opts.nextSlide], opts, fwd); 770 if (opts.fx == 'shuffle') 771 ms -= opts.speedOut; 772 } 773 else if (opts.continuous && p.cyclePause) // continuous shows work off an after callback, not this timer logic 774 ms = 10; 775 if (ms > 0) 776 p.cycleTimeout = setTimeout(function(){ go(els, opts, 0, !opts.backwards); }, ms); 777 } 778} 779 780// invoked after transition 781$.fn.cycle.updateActivePagerLink = function(pager, currSlide, clsName) { 782 $(pager).each(function() { 783 $(this).children().removeClass(clsName).eq(currSlide).addClass(clsName); 784 }); 785}; 786 787// calculate timeout value for current transition 788function getTimeout(curr, next, opts, fwd) { 789 if (opts.timeoutFn) { 790 // call user provided calc fn 791 var t = opts.timeoutFn.call(curr,curr,next,opts,fwd); 792 while (opts.fx != 'none' && (t - opts.speed) < 250) // sanitize timeout 793 t += opts.speed;
794 debug('calculated timeout: ' + t + '; speed: ' + opts.speed); 795 if (t !== false) 796 return t; 797 } 798 return opts.timeout; 799} 800 801// expose next/prev function, caller must pass in state 802$.fn.cycle.next = function(opts) { advance(opts,1); }; 803$.fn.cycle.prev = function(opts) { advance(opts,0);}; 804 805// advance slide forward or back 806function advance(opts, moveForward) { 807 var val = moveForward ? 1 : -1; 808 var els = opts.elements; 809 var p = opts.$cont[0], timeout = p.cycleTimeout; 810 if (timeout) { 811 clearTimeout(timeout); 812 p.cycleTimeout = 0; 813 } 814 if (opts.random && val < 0) { 815 // move back to the previously display slide 816 opts.randomIndex--; 817 if (--opts.randomIndex == -2) 818 opts.randomIndex = els.length-2; 819 else if (opts.randomIndex == -1) 820 opts.randomIndex = els.length-1; 821 opts.nextSlide = opts.randomMap[opts.randomIndex]; 822 } 823 else if (opts.random) { 824 opts.nextSlide = opts.randomMap[opts.randomIndex]; 825 } 826 else { 827 opts.nextSlide = opts.currSlide + val; 828 if (opts.nextSlide < 0) { 829 if (opts.nowrap) return false; 830 opts.nextSlide = els.length - 1; 831 } 832 else if (opts.nextSlide >= els.length) { 833 if (opts.nowrap) return false; 834 opts.nextSlide = 0; 835 } 836 } 837 838 var cb = opts.onPrevNextEvent || opts.prevNextClick; // prevNextClick is deprecated 839 if ($.isFunction(cb)) 840 cb(val > 0, opts.nextSlide, els[opts.nextSlide]); 841 go(els, opts, 1, moveForward); 842 return false; 843} 844 845function buildPager(els, opts) { 846 var $p = $(opts.pager); 847 $.each(els, function(i,o) { 848 $.fn.cycle.createPagerAnchor(i,o,$p,els,opts); 849 }); 850 opts.updateActivePagerLink(opts.pager, opts.startingSlide, opts.activePagerClass); 851} 852 853$.fn.cycle.createPagerAnchor = function(i, el, $p, els, opts) { 854 var a; 855 if ($.isFunction(opts.pagerAnchorBuilder)) { 856 a = opts.pagerAnchorBuilder(i,el); 857 debug('pagerAnchorBuilder('+i+', el) returned: ' + a); 858 } 859 else 860 a = '<a href="#">'+(i+1)+'</a>'; 861 862 if (!a) 863 return; 864 var $a = $(a); 865 // don't reparent if anchor is in the dom 866 if ($a.parents('body').length === 0) { 867 var arr = []; 868 if ($p.length > 1) { 869 $p.each(function() { 870 var $clone = $a.clone(true); 871 $(this).append($clone); 872 arr.push($clone[0]); 873 }); 874 $a = $(arr); 875 } 876 else { 877 $a.appendTo($p); 878 } 879 } 880 881 opts.pagerAnchors = opts.pagerAnchors || []; 882 opts.pagerAnchors.push($a); 883 884 var pagerFn = function(e) { 885 e.preventDefault(); 886 opts.nextSlide = i; 887 var p = opts.$cont[0], timeout = p.cycleTimeout; 888 if (timeout) { 889 clearTimeout(timeout); 890 p.cycleTimeout = 0; 891 } 892 var cb = opts.onPagerEvent || opts.pagerClick; // pagerClick is deprecated 893 if ($.isFunction(cb)) 894 cb(opts.nextSlide, els[opts.nextSlide]); 895 go(els,opts,1,opts.currSlide < i); // trigger the trans 896// return false; // <== allow bubble 897 }; 898 899 if ( /mouseenter|mouseover/i.test(opts.pagerEvent) ) { 900 $a.hover(pagerFn, function(){/* no-op */} ); 901 } 902 else { 903 $a.bind(opts.pagerEvent, pagerFn); 904 } 905 906 if ( ! /^click/.test(opts.pagerEvent) && !opts.allowPagerClickBubble) 907 $a.bind('click.cycle', function(){return false;}); // suppress click 908 909 var cont = opts.$cont[0]; 910 var pauseFlag = false; // https://github.com/malsup/cycle/issues/44 911 if (opts.pauseOnPagerHover) { 912 $a.hover( 913 function() { 914 pauseFlag = true; 915 cont.cyclePause++; 916 triggerPause(cont,true,true); 917 }, function() { 918 if (pauseFlag) 919 cont.cyclePause--; 920 triggerPause(cont,true,true); 921 } 922 ); 923 } 924}; 925 926// helper fn to calculate the number of slides between the current and the next 927$.fn.cycle.hopsFromLast = function(opts, fwd) { 928 var hops, l = opts.lastSlide, c = opts.currSlide; 929 if (fwd) 930 hops = c > l ? c - l : opts.slideCount - l; 931 else 932 hops = c < l ? l - c : l + opts.slideCount - c; 933 return hops; 934}; 935 936// fix clearType problems in ie6 by setting an explicit bg color 937// (otherwise text slides look horrible during a fade transition) 938function clearTypeFix($slides) { 939 debug('applying clearType background-color hack'); 940 function hex(s) { 941 s = parseInt(s,10).toString(16); 942 return s.length < 2 ? '0'+s : s; 943 } 944 function getBg(e) { 945 for ( ; e && e.nodeName.toLowerCase() != 'html'; e = e.parentNode) { 946 var v = $.css(e,'background-color'); 947 if (v && v.indexOf('rgb') >= 0 ) { 948 var rgb = v.match(/\d+/g); 949 return '#'+ hex(rgb[0]) + hex(rgb[1]) + hex(rgb[2]); 950 } 951 if (v && v != 'transparent') 952 return v; 953 } 954 return '#ffffff'; 955 } 956 $slides.each(function() { $(this).css('background-color', getBg(this)); }); 957} 958 959// reset common props before the next transition 960$.fn.cycle.commonReset = function(curr,next,opts,w,h,rev) { 961 $(opts.elements).not(curr).hide(); 962 if (typeof opts.cssBefore.opacity == 'undefined') 963 opts.cssBefore.opacity = 1; 964 opts.cssBefore.display = 'block'; 965 if (opts.slideResize && w !== false && next.cycleW > 0) 966 opts.cssBefore.width = next.cycleW; 967 if (opts.slideResize && h !== false && next.cycleH > 0) 968 opts.cssBefore.height = next.cycleH; 969 opts.cssAfter = opts.cssAfter || {}; 970 opts.cssAfter.display = 'none'; 971 $(curr).css('zIndex',opts.slideCount + (rev === true ? 1 : 0)); 972 $(next).css('zIndex',opts.slideCount + (rev === true ? 0 : 1)); 973}; 974 975// the actual fn for effecting a transition 976$.fn.cycle.custom = function(curr, next, opts, cb, fwd, speedOverride) { 977 var $l = $(curr), $n = $(next); 978 var speedIn = opts.speedIn, speedOut = opts.speedOut, easeIn = opts.easeIn, easeOut = opts.easeOut; 979 $n.css(opts.cssBefore); 980 if (speedOverride) { 981 if (typeof speedOverride == 'number') 982 speedIn = speedOut = speedOverride; 983 else 984 speedIn = speedOut = 1; 985 easeIn = easeOut = null; 986 } 987 var fn = function() { 988 $n.animate(opts.animIn, speedIn, easeIn, function() { 989 cb(); 990 }); 991 }; 992 $l.animate(opts.animOut, speedOut, easeOut, function() { 993 $l.css(opts.cssAfter); 994 if (!opts.sync) 995 fn(); 996 }); 997 if (opts.sync) fn(); 998}; 999 1000// transition definitions - only fade is defined here, transition pack defines the rest 1001$.fn.cycle.transitions = { 1002 fade: function($cont, $slides, opts) { 1003 $slides.not(':eq('+opts.currSlide+')').css('opacity',0); 1004 opts.before.push(function(curr,next,opts) { 1005 $.fn.cycle.commonReset(curr,next,opts); 1006 opts.cssBefore.opacity = 0; 1007 }); 1008 opts.animIn = { opacity: 1 }; 1009 opts.animOut = { opacity: 0 }; 1010 opts.cssBefore = { top: 0, left: 0 }; 1011 } 1012}; 1013 1014$.fn.cycle.ver = function() { return ver; }; 1015 1016// override these globally if you like (they are all optional) 1017$.fn.cycle.defaults = {
1018 activePagerClass: 'activeSlide', // class name used for the active pager link 1019 after: null, // transition callback (scope set to element that was shown): function(currSlideElement, nextSlideElement, options, forwardFlag) 1020 allowPagerClickBubble: false, // allows or prevents click event on pager anchors from bubbling 1021 animIn: null, // properties that define how the slide animates in 1022 animOut: null, // properties that define how the slide animates out 1023 aspect: false, // preserve aspect ratio during fit resizing, cropping if necessary (must be used with fit option) 1024 autostop: 0, // true to end slideshow after X transitions (where X == slide count) 1025 autostopCount: 0, // number of transitions (optionally used with autostop to define X) 1026 backwards: false, // true to start slideshow at last slide and move backwards through the stack 1027 before: null, // transition callback (scope set to element to be shown): function(currSlideElement, nextSlideElement, options, forwardFlag) 1028 center: null, // set to true to have cycle add top/left margin to each slide (use with width and height options) 1029 cleartype: !$.support.opacity, // true if clearType corrections should be applied (for IE) 1030 cleartypeNoBg: false, // set to true to disable extra cleartype fixing (leave false to force background color setting on slides) 1031 containerResize: 1, // resize container to fit largest slide 1032 continuous: 0, // true to start next transition immediately after current one completes 1033 cssAfter: null, // properties that defined the state of the slide after transitioning out 1034 cssBefore: null, // properties that define the initial state of the slide before transitioning in 1035 delay: 0, // additional delay (in ms) for first transition (hint: can be negative) 1036 easeIn: null, // easing for "in" transition 1037 easeOut: null, // easing for "out" transition 1038 easing: null, // easing method for both in and out transitions 1039 end: null, // callback invoked when the slideshow terminates (use with autostop or nowrap options): function(options) 1040 fastOnEvent: 0, // force fast transitions when triggered manually (via pager or prev/next); value == time in ms 1041 fit: 0, // force slides to fit container 1042 fx: 'fade', // name of transition effect (or comma separated names, ex: 'fade,scrollUp,shuffle') 1043 fxFn: null, // function used to control the transition: function(currSlideElement, nextSlideElement, options, afterCalback, forwardFlag) 1044 height: 'auto', // container height (if the 'fit' option is true, the slides will be set to this height as well) 1045 manualTrump: true, // causes manual transition to stop an active transition instead of being ignored 1046 metaAttr: 'cycle', // data- attribute that holds the option data for the slideshow 1047 next: null, // element, jQuery object, or jQuery selector string for the element to use as event trigger for next slide 1048 nowrap: 0, // true to prevent slideshow from wrapping 1049 onPagerEvent: null, // callback fn for pager events: function(zeroBasedSlideIndex, slideElement) 1050 onPrevNextEvent: null, // callback fn for prev/next events: function(isNext, zeroBasedSlideIndex, slideElement) 1051 pager: null, // element, jQuery object, or jQuery selector string for the element to use as pager container 1052 pagerAnchorBuilder: null, // callback fn for building anchor links: function(index, DOMelement) 1053 pagerEvent: 'click.cycle', // name of event which drives the pager navigation 1054 pause: 0, // true to enable "pause on hover" 1055 pauseOnPagerHover: 0, // true to pause when hovering over pager link 1056 prev: null, // element, jQuery object, or jQuery selector string for the element to use as event trigger for previous slide 1057 prevNextEvent: 'click.cycle',// event which drives the manual transition to the previous or next slide 1058 random: 0, // true for random, false for sequence (not applicable to shuffle fx) 1059 randomizeEffects: 1, // valid when multiple effects are used; true to make the effect sequence random 1060 requeueOnImageNotLoaded: true, // requeue the slideshow if any image slides are not yet loaded 1061 requeueTimeout: 250, // ms delay for requeue 1062 rev: 0, // causes animations to transition in reverse (for effects that support it such as scrollHorz/scrollVert/shuffle) 1063 shuffle: null, // coords for shuffle animation, ex: { top:15, left: 200 } 1064 skipInitializationCallbacks: false, // set to true to disable the first before/after callback that occurs prior to any transition 1065 slideExpr: null, // expression for selecting slides (if something other than all children is required) 1066 slideResize: 1, // force slide width/height to fixed size before every transition 1067 speed: 1000, // speed of the transition (any valid fx speed value) 1068 speedIn: null, // speed of the 'in' transition 1069 speedOut: null, // speed of the 'out' transition 1070 startingSlide: undefined,// zero-based index of the first slide to be displayed 1071 sync: 1, // true if in/out transitions should occur simultaneously 1072 timeout: 4000, // milliseconds between slide transitions (0 to disable auto advance) 1073 timeoutFn: null, // callback for determining per-slide timeout value: function(currSlideElement, nextSlideElement, options, forwardFlag) 1074 updateActivePagerLink: null,// callback fn invoked to update the active pager link (adds/removes activePagerClass style) 1075 width: null // container width (if the 'fit' option is true, the slides will be set to this width as well) 1076}; 1077 1078}
1078)(jQuery); 1079 1080 1081/*! 1082 * jQuery Cycle Plugin Transition Definitions 1083 * This script is a plugin for the jQuery Cycle Plugin 1084 * Examples and documentation at: http://malsup.com/jquery/cycle/ 1085 * Copyright (c) 2007-2010 M. Alsup 1086 * Version: 2.73 1087 * Dual licensed under the MIT and GPL licenses: 1088 * http://www.opensource.org/licenses/mit-license.php 1089 * http://www.gnu.org/licenses/gpl.html 1090 */ 1091(function($) { 1092"use strict"; 1093 1094// 1095// These functions define slide initialization and properties for the named 1096// transitions. To save file size feel free to remove any of these that you 1097// don't need. 1098// 1099$.fn.cycle.transitions.none = function($cont, $slides, opts) { 1100 opts.fxFn = function(curr,next,opts,after){ 1101 $(next).show(); 1102 $(curr).hide(); 1103 after(); 1104 }; 1105}; 1106 1107// not a cross-fade, fadeout only fades out the top slide 1108$.fn.cycle.transitions.fadeout = function($cont, $slides, opts) { 1109 $slides.not(':eq('+opts.currSlide+')').css({ display: 'block', 'opacity': 1 }); 1110 opts.before.push(function(curr,next,opts,w,h,rev) { 1111 $(curr).css('zIndex',opts.slideCount + (rev !== true ? 1 : 0)); 1112 $(next).css('zIndex',opts.slideCount + (rev !== true ? 0 : 1)); 1113 }); 1114 opts.animIn.opacity = 1; 1115 opts.animOut.opacity = 0; 1116 opts.cssBefore.opacity = 1; 1117 opts.cssBefore.display = 'block'; 1118 opts.cssAfter.zIndex = 0; 1119}; 1120 1121// scrollUp/Down/Left/Right 1122$.fn.cycle.transitions.scrollUp = function($cont, $slides, opts) { 1123 $cont.css('overflow','hidden'); 1124 opts.before.push($.fn.cycle.commonReset); 1125 var h = $cont.height(); 1126 opts.cssBefore.top = h; 1127 opts.cssBefore.left = 0; 1128 opts.cssFirst.top = 0; 1129 opts.animIn.top = 0; 1130 opts.animOut.top = -h; 1131}; 1132$.fn.cycle.transitions.scrollDown = function($cont, $slides, opts) { 1133 $cont.css('overflow','hidden'); 1134 opts.before.push($.fn.cycle.commonReset); 1135 var h = $cont.height(); 1136 opts.cssFirst.top = 0; 1137 opts.cssBefore.top = -h; 1138 opts.cssBefore.left = 0; 1139 opts.animIn.top = 0; 1140 opts.animOut.top = h; 1141}; 1142$.fn.cycle.transitions.scrollLeft = function($cont, $slides, opts) { 1143 $cont.css('overflow','hidden'); 1144 opts.before.push($.fn.cycle.commonReset); 1145 var w = $cont.width(); 1146 opts.cssFirst.left = 0; 1147 opts.cssBefore.left = w; 1148 opts.cssBefore.top = 0; 1149 opts.animIn.left = 0; 1150 opts.animOut.left = 0-w; 1151}; 1152$.fn.cycle.transitions.scrollRight = function($cont, $slides, opts) { 1153 $cont.css('overflow','hidden'); 1154 opts.before.push($.fn.cycle.commonReset); 1155 var w = $cont.width(); 1156 opts.cssFirst.left = 0; 1157 opts.cssBefore.left = -w; 1158 opts.cssBefore.top = 0; 1159 opts.animIn.left = 0; 1160 opts.animOut.left = w; 1161}; 1162$.fn.cycle.transitions.scrollHorz = function($cont, $slides, opts) { 1163 $cont.css('overflow','hidden').width(); 1164 opts.before.push(function(curr, next, opts, fwd) { 1165 if (opts.rev) 1166 fwd = !fwd; 1167 $.fn.cycle.commonReset(curr,next,opts); 1168 opts.cssBefore.left = fwd ? (next.cycleW-1) : (1-next.cycleW); 1169 opts.animOut.left = fwd ? -curr.cycleW : curr.cycleW; 1170 }); 1171 opts.cssFirst.left = 0; 1172 opts.cssBefore.top = 0; 1173 opts.animIn.left = 0; 1174 opts.animOut.top = 0; 1175}; 1176$.fn.cycle.transitions.scrollVert = function($cont, $slides, opts) { 1177 $cont.css('overflow','hidden'); 1178 opts.before.push(function(curr, next, opts, fwd) { 1179 if (opts.rev) 1180 fwd = !fwd; 1181 $.fn.cycle.commonReset(curr,next,opts); 1182 opts.cssBefore.top = fwd ? (1-next.cycleH) : (next.cycleH-1); 1183 opts.animOut.top = fwd ? curr.cycleH : -curr.cycleH; 1184 }); 1185 opts.cssFirst.top = 0; 1186 opts.cssBefore.left = 0; 1187 opts.animIn.top = 0; 1188 opts.animOut.left = 0; 1189}; 1190 1191// slideX/slideY 1192$.fn.cycle.transitions.slideX = function($cont, $slides, opts) { 1193 opts.before.push(function(curr, next, opts) { 1194 $(opts.elements).not(curr).hide(); 1195 $.fn.cycle.commonReset(curr,next,opts,false,true); 1196 opts.animIn.width = next.cycleW; 1197 }); 1198 opts.cssBefore.left = 0; 1199 opts.cssBefore.top = 0; 1200 opts.cssBefore.width = 0; 1201 opts.animIn.width = 'show'; 1202 opts.animOut.width = 0; 1203}; 1204$.fn.cycle.transitions.slideY = function($cont, $slides, opts) { 1205 opts.before.push(function(curr, next, opts) { 1206 $(opts.elements).not(curr).hide(); 1207 $.fn.cycle.commonReset(curr,next,opts,true,false); 1208 opts.animIn.height = next.cycleH; 1209 }); 1210 opts.cssBefore.left = 0; 1211 opts.cssBefore.top = 0; 1212 opts.cssBefore.height = 0; 1213 opts.animIn.height = 'show'; 1214 opts.animOut.height = 0; 1215}; 1216 1217// shuffle 1218$.fn.cycle.transitions.shuffle = function($cont, $slides, opts) { 1219 var i, w = $cont.css('overflow', 'visible').width(); 1220 $slides.css({left: 0, top: 0}); 1221 opts.before.push(function(curr,next,opts) { 1222 $.fn.cycle.commonReset(curr,next,opts,true,true,true); 1223 }); 1224 // only adjust speed once! 1225 if (!opts.speedAdjusted) { 1226 opts.speed = opts.speed / 2; // shuffle has 2 transitions 1227 opts.speedAdjusted = true; 1228 } 1229 opts.random = 0; 1230 opts.shuffle = opts.shuffle || {left:-w, top:15}; 1231 opts.els = []; 1232 for (i=0; i < $slides.length; i++) 1233 opts.els.push($slides[i]); 1234 1235 for (i=0; i < opts.currSlide; i++) 1236 opts.els.push(opts.els.shift()); 1237 1238 // custom transition fn (hat tip to Benjamin Sterling for this bit of sweetness!) 1239 opts.fxFn = function(curr, next, opts, cb, fwd) { 1240 if (opts.rev) 1241 fwd = !fwd; 1242 var $el = fwd ? $(curr) : $(next); 1243 $(next).css(opts.cssBefore); 1244 var count = opts.slideCount; 1245 $el.animate(opts.shuffle, opts.speedIn, opts.easeIn, function() { 1246 var hops = $.fn.cycle.hopsFromLast(opts, fwd); 1247 for (var k=0; k < hops; k++) { 1248 if (fwd) 1249 opts.els.push(opts.els.shift()); 1250 else 1251 opts.els.unshift(opts.els.pop()); 1252 } 1253 if (fwd) { 1254 for (var i=0, len=opts.els.length; i < len; i++) 1255 $(opts.els[i]).css('z-index', len-i+count); 1256 } 1257 else { 1258 var z = $(curr).css('z-index'); 1259 $el.css('z-index', parseInt(z,10)+1+count); 1260 } 1261 $el.animate({left:0, top:0}, opts.speedOut, opts.easeOut, function() {
1262 $(fwd ? this : curr).hide(); 1263 if (cb) cb(); 1264 }); 1265 }); 1266 }; 1267 $.extend(opts.cssBefore, { display: 'block', opacity: 1, top: 0, left: 0 }); 1268}; 1269 1270// turnUp/Down/Left/Right 1271$.fn.cycle.transitions.turnUp = function($cont, $slides, opts) { 1272 opts.before.push(function(curr, next, opts) { 1273 $.fn.cycle.commonReset(curr,next,opts,true,false); 1274 opts.cssBefore.top = next.cycleH; 1275 opts.animIn.height = next.cycleH; 1276 opts.animOut.width = next.cycleW; 1277 }); 1278 opts.cssFirst.top = 0; 1279 opts.cssBefore.left = 0; 1280 opts.cssBefore.height = 0; 1281 opts.animIn.top = 0; 1282 opts.animOut.height = 0; 1283}; 1284$.fn.cycle.transitions.turnDown = function($cont, $slides, opts) { 1285 opts.before.push(function(curr, next, opts) { 1286 $.fn.cycle.commonReset(curr,next,opts,true,false); 1287 opts.animIn.height = next.cycleH; 1288 opts.animOut.top = curr.cycleH; 1289 }); 1290 opts.cssFirst.top = 0; 1291 opts.cssBefore.left = 0; 1292 opts.cssBefore.top = 0; 1293 opts.cssBefore.height = 0; 1294 opts.animOut.height = 0; 1295}; 1296$.fn.cycle.transitions.turnLeft = function($cont, $slides, opts) { 1297 opts.before.push(function(curr, next, opts) { 1298 $.fn.cycle.commonReset(curr,next,opts,false,true); 1299 opts.cssBefore.left = next.cycleW; 1300 opts.animIn.width = next.cycleW; 1301 }); 1302 opts.cssBefore.top = 0; 1303 opts.cssBefore.width = 0; 1304 opts.animIn.left = 0; 1305 opts.animOut.width = 0; 1306}; 1307$.fn.cycle.transitions.turnRight = function($cont, $slides, opts) { 1308 opts.before.push(function(curr, next, opts) { 1309 $.fn.cycle.commonReset(curr,next,opts,false,true); 1310 opts.animIn.width = next.cycleW; 1311 opts.animOut.left = curr.cycleW; 1312 }); 1313 $.extend(opts.cssBefore, { top: 0, left: 0, width: 0 }); 1314 opts.animIn.left = 0; 1315 opts.animOut.width = 0; 1316}; 1317 1318// zoom 1319$.fn.cycle.transitions.zoom = function($cont, $slides, opts) { 1320 opts.before.push(function(curr, next, opts) { 1321 $.fn.cycle.commonReset(curr,next,opts,false,false,true); 1322 opts.cssBefore.top = next.cycleH/2; 1323 opts.cssBefore.left = next.cycleW/2; 1324 $.extend(opts.animIn, { top: 0, left: 0, width: next.cycleW, height: next.cycleH }); 1325 $.extend(opts.animOut, { width: 0, height: 0, top: curr.cycleH/2, left: curr.cycleW/2 }); 1326 }); 1327 opts.cssFirst.top = 0; 1328 opts.cssFirst.left = 0; 1329 opts.cssBefore.width = 0; 1330 opts.cssBefore.height = 0; 1331}; 1332 1333// fadeZoom 1334$.fn.cycle.transitions.fadeZoom = function($cont, $slides, opts) { 1335 opts.before.push(function(curr, next, opts) { 1336 $.fn.cycle.commonReset(curr,next,opts,false,false); 1337 opts.cssBefore.left = next.cycleW/2; 1338 opts.cssBefore.top = next.cycleH/2; 1339 $.extend(opts.animIn, { top: 0, left: 0, width: next.cycleW, height: next.cycleH }); 1340 }); 1341 opts.cssBefore.width = 0; 1342 opts.cssBefore.height = 0; 1343 opts.animOut.opacity = 0; 1344}; 1345 1346// blindX 1347$.fn.cycle.transitions.blindX = function($cont, $slides, opts) { 1348 var w = $cont.css('overflow','hidden').width(); 1349 opts.before.push(function(curr, next, opts) { 1350 $.fn.cycle.commonReset(curr,next,opts); 1351 opts.animIn.width = next.cycleW; 1352 opts.animOut.left = curr.cycleW; 1353 }); 1354 opts.cssBefore.left = w; 1355 opts.cssBefore.top = 0; 1356 opts.animIn.left = 0; 1357 opts.animOut.left = w; 1358}; 1359// blindY 1360$.fn.cycle.transitions.blindY = function($cont, $slides, opts) { 1361 var h = $cont.css('overflow','hidden').height(); 1362 opts.before.push(function(curr, next, opts) { 1363 $.fn.cycle.commonReset(curr,next,opts); 1364 opts.animIn.height = next.cycleH; 1365 opts.animOut.top = curr.cycleH; 1366 }); 1367 opts.cssBefore.top = h; 1368 opts.cssBefore.left = 0; 1369 opts.animIn.top = 0; 1370 opts.animOut.top = h; 1371}; 1372// blindZ 1373$.fn.cycle.transitions.blindZ = function($cont, $slides, opts) { 1374 var h = $cont.css('overflow','hidden').height(); 1375 var w = $cont.width(); 1376 opts.before.push(function(curr, next, opts) { 1377 $.fn.cycle.commonReset(curr,next,opts); 1378 opts.animIn.height = next.cycleH; 1379 opts.animOut.top = curr.cycleH; 1380 }); 1381 opts.cssBefore.top = h; 1382 opts.cssBefore.left = w; 1383 opts.animIn.top = 0; 1384 opts.animIn.left = 0; 1385 opts.animOut.top = h; 1386 opts.animOut.left = w; 1387}; 1388 1389// growX - grow horizontally from centered 0 width 1390$.fn.cycle.transitions.growX = function($cont, $slides, opts) { 1391 opts.before.push(function(curr, next, opts) { 1392 $.fn.cycle.commonReset(curr,next,opts,false,true); 1393 opts.cssBefore.left = this.cycleW/2; 1394 opts.animIn.left = 0; 1395 opts.animIn.width = this.cycleW; 1396 opts.animOut.left = 0; 1397 }); 1398 opts.cssBefore.top = 0; 1399 opts.cssBefore.width = 0; 1400}; 1401// growY - grow vertically from centered 0 height 1402$.fn.cycle.transitions.growY = function($cont, $slides, opts) { 1403 opts.before.push(function(curr, next, opts) { 1404 $.fn.cycle.commonReset(curr,next,opts,true,false); 1405 opts.cssBefore.top = this.cycleH/2; 1406 opts.animIn.top = 0; 1407 opts.animIn.height = this.cycleH; 1408 opts.animOut.top = 0; 1409 }); 1410 opts.cssBefore.height = 0; 1411 opts.cssBefore.left = 0; 1412}; 1413 1414// curtainX - squeeze in both edges horizontally 1415$.fn.cycle.transitions.curtainX = function($cont, $slides, opts) { 1416 opts.before.push(function(curr, next, opts) { 1417 $.fn.cycle.commonReset(curr,next,opts,false,true,true); 1418 opts.cssBefore.left = next.cycleW/2; 1419 opts.animIn.left = 0; 1420 opts.animIn.width = this.cycleW; 1421 opts.animOut.left = curr.cycleW/2; 1422 opts.animOut.width = 0; 1423 }); 1424 opts.cssBefore.top = 0; 1425 opts.cssBefore.width = 0; 1426}; 1427// curtainY - squeeze in both edges vertically 1428$.fn.cycle.transitions.curtainY = function($cont, $slides, opts) { 1429 opts.before.push(function(curr, next, opts) { 1430 $.fn.cycle.commonReset(curr,next,opts,true,false,true); 1431 opts.cssBefore.top = next.cycleH/2; 1432 opts.animIn.top = 0; 1433 opts.animIn.height = next.cycleH; 1434 opts.animOut.top = curr.cycleH/2; 1435 opts.animOut.height = 0; 1436 }); 1437 opts.cssBefore.height = 0; 1438 opts.cssBefore.left = 0; 1439}; 1440 1441// cover - curr slide covered by next slide
1442$.fn.cycle.transitions.cover = function($cont, $slides, opts) { 1443 var d = opts.direction || 'left'; 1444 var w = $cont.css('overflow','hidden').width(); 1445 var h = $cont.height(); 1446 opts.before.push(function(curr, next, opts) { 1447 $.fn.cycle.commonReset(curr,next,opts); 1448 if (d == 'right') 1449 opts.cssBefore.left = -w; 1450 else if (d == 'up') 1451 opts.cssBefore.top = h; 1452 else if (d == 'down') 1453 opts.cssBefore.top = -h; 1454 else 1455 opts.cssBefore.left = w; 1456 }); 1457 opts.animIn.left = 0; 1458 opts.animIn.top = 0; 1459 opts.cssBefore.top = 0; 1460 opts.cssBefore.left = 0; 1461}; 1462 1463// uncover - curr slide moves off next slide 1464$.fn.cycle.transitions.uncover = function($cont, $slides, opts) { 1465 var d = opts.direction || 'left'; 1466 var w = $cont.css('overflow','hidden').width(); 1467 var h = $cont.height(); 1468 opts.before.push(function(curr, next, opts) { 1469 $.fn.cycle.commonReset(curr,next,opts,true,true,true); 1470 if (d == 'right') 1471 opts.animOut.left = w; 1472 else if (d == 'up') 1473 opts.animOut.top = -h; 1474 else if (d == 'down') 1475 opts.animOut.top = h; 1476 else 1477 opts.animOut.left = -w; 1478 }); 1479 opts.animIn.left = 0; 1480 opts.animIn.top = 0; 1481 opts.cssBefore.top = 0; 1482 opts.cssBefore.left = 0; 1483}; 1484 1485// toss - move top slide and fade away 1486$.fn.cycle.transitions.toss = function($cont, $slides, opts) { 1487 var w = $cont.css('overflow','visible').width(); 1488 var h = $cont.height(); 1489 opts.before.push(function(curr, next, opts) { 1490 $.fn.cycle.commonReset(curr,next,opts,true,true,true); 1491 // provide default toss settings if animOut not provided 1492 if (!opts.animOut.left && !opts.animOut.top) 1493 $.extend(opts.animOut, { left: w*2, top: -h/2, opacity: 0 }); 1494 else 1495 opts.animOut.opacity = 0; 1496 }); 1497 opts.cssBefore.left = 0; 1498 opts.cssBefore.top = 0; 1499 opts.animIn.left = 0; 1500}; 1501 1502// wipe - clip animation 1503$.fn.cycle.transitions.wipe = function($cont, $slides, opts) { 1504 var w = $cont.css('overflow','hidden').width(); 1505 var h = $cont.height(); 1506 opts.cssBefore = opts.cssBefore || {}; 1507 var clip; 1508 if (opts.clip) { 1509 if (/l2r/.test(opts.clip)) 1510 clip = 'rect(0px 0px '+h+'px 0px)'; 1511 else if (/r2l/.test(opts.clip)) 1512 clip = 'rect(0px '+w+'px '+h+'px '+w+'px)'; 1513 else if (/t2b/.test(opts.clip)) 1514 clip = 'rect(0px '+w+'px 0px 0px)'; 1515 else if (/b2t/.test(opts.clip)) 1516 clip = 'rect('+h+'px '+w+'px '+h+'px 0px)'; 1517 else if (/zoom/.test(opts.clip)) { 1518 var top = parseInt(h/2,10); 1519 var left = parseInt(w/2,10); 1520 clip = 'rect('+top+'px '+left+'px '+top+'px '+left+'px)'; 1521 } 1522 } 1523 1524 opts.cssBefore.clip = opts.cssBefore.clip || clip || 'rect(0px 0px 0px 0px)'; 1525 1526 var d = opts.cssBefore.clip.match(/(\d+)/g); 1527 var t = parseInt(d[0],10), r = parseInt(d[1],10), b = parseInt(d[2],10), l = parseInt(d[3],10); 1528 1529 opts.before.push(function(curr, next, opts) { 1530 if (curr == next) return; 1531 var $curr = $(curr), $next = $(next); 1532 $.fn.cycle.commonReset(curr,next,opts,true,true,false); 1533 opts.cssAfter.display = 'block'; 1534 1535 var step = 1, count = parseInt((opts.speedIn / 13),10) - 1; 1536 (function f() { 1537 var tt = t ? t - parseInt(step * (t/count),10) : 0; 1538 var ll = l ? l - parseInt(step * (l/count),10) : 0; 1539 var bb = b < h ? b + parseInt(step * ((h-b)/count || 1),10) : h; 1540 var rr = r < w ? r + parseInt(step * ((w-r)/count || 1),10) : w; 1541 $next.css({ clip: 'rect('+tt+'px '+rr+'px '+bb+'px '+ll+'px)' }); 1542 (step++ <= count) ? setTimeout(f, 13) : $curr.css('display', 'none'); 1543 })(); 1544 }); 1545 $.extend(opts.cssBefore, { display: 'block', opacity: 1, top: 0, left: 0 }); 1546 opts.animIn = { left: 0 }; 1547 opts.animOut = { left: 0 }; 1548}; 1549 1550})(jQuery); 1551; 1552(function ($) { 1553 $(function(){ 1554 1555 1556 Site = { 1557 init: function(el) { 1558 1559 $site = this; 1560 $site.el = el; 1561 $site.$$ = $($site.el); 1562 1563 $site.ww = 0; 1564 $site.hh = 0; 1565 $site.menuWidth = 270; 1566 $site.subMenuWidth = 160; 1567 $site.isSubMenuOpen = false; 1568 $site.activePart = ""; 1569 $site.activeSubPart = ""; 1570 1571 $site.menu = $("#menu"); 1572 $site.subMenu = $("#submenu"); 1573 $site.menuLinks = $site.menu.find('nav .content a'); 1574 1575 1576 $site.cache = $("#cacheWebsite"); 1577 1578 $site.timer; 1579 $site.isTimerExists = false; 1580 1581 $site.build(); 1582 $site.onResize(); 1583 1584 }, 1585 build: function(){ 1586 1587 1588 $(window).bind("resize",function() { 1589 $site.onResize(); 1590 }); 1591 1592 1593 $site.menuLinks.on('mouseenter',function(e) { 1594 var el = $(this); 1595 1596 var $this = $(this), 1597 $id = $this.attr("id"); 1598 1599 if(el.parent().hasClass('has-children')){ 1600 1601 if(!$site.isSubMenuOpen){ 1602 1603 $site.subMenu.find('div.block').hide(); 1604 //alert(el.attr("id")); 1605 $('div#block-'+el.attr("id")).show(300); 1606 $site.subMenu.animate({"left":"270px"},500); 1607 $site.isSubMenuOpen = true; 1608 1609 $("body").bind("mousemove", $site.onMoveBody); 1610 1611 }else{ 1612 1613 $site.subMenu.find('div.block').hide(); 1614 $('div#block-'+el.attr("id")).show(); 1615 1616 } 1617 }else if($site.isSubMenuOpen){ 1618 //$site.closeSubMenu(); 1619 } 1620 1621 }); 1622 1623 1624 }, 1625 closeSubMenu: function() { 1626 1627 1628 $("body").unbind("mousemove", $site.onMoveBody); 1629 $("#submenu").stop(true,true).animate({"left":"0px"},400); 1630 $site.isSubMenuOpen = false;
1631 }, 1632 onMoveBody: function(e) { 1633 1634 if(e.pageX > $site.menuWidth + $site.subMenuWidth) { 1635 1636 if(!$site.isTimerExists) { 1637 $site.timer = setTimeout($site.onMoveOutSubMenu,500); 1638 $site.isTimerExists = true; 1639 } 1640 1641 } else { 1642 1643 clearTimeout($site.timer); 1644 $site.isTimerExists = false; 1645 1646 } 1647 1648 }, 1649 onMoveOutSubMenu: function() { 1650 $site.menuLinks.each(function() { 1651 $(this).removeClass("selected"); 1652 }); 1653 $site.closeSubMenu(); 1654 }, 1655 onResize: function() { 1656 1657 $site.ww = $(window).width(); 1658 $site.hh = $(window).height(); 1659 1660 $site.subMenu.find("div.block").each(function() { 1661 $(this).css({"top":(($site.hh-$(this).height()) * 0.5)+"px"}); 1662 }); 1663 1664 $('section.site').css({'width':($site.ww-270)+'px','min-height':$site.hh+'px'}); 1665 1666 } 1667 } 1668 1669 $.fn.site = function() { 1670 return this.each(function(){ 1671 Site.init(this); 1672 }); 1673 } 1674 1675 $('body').site(); 1676 1677 }); 1678})(jQuery);; 1679(function ($) { 1680 $(function() { 1681 1682 /* Menu */ 1683 $('nav ul.menu li').find("ul").hide(); 1684 //$('nav ul.menu li').find("ul").css('opacity', 0.9); 1685 $("nav ul.menu li").hover(function() { 1686 $(this).find("ul").show(); 1687 }, function() { 1688 $(this).find("ul").hide(); 1689 }); 1690 1691 $(".iframebooking").colorbox({iframe:true, width:"1200px", height:"640px"}); 1692 1693 /* 1694 $('#block-views-news-block_1 .view-content').each(function(){ 1695 1696 if( $(this).children().length > 1 ){ 1697 1698 $(this).parent().append('<div class="pager"><ul></ul></div>'); 1699 $(this).cycle({ 1700 fx: 'scrollHorz', 1701 speed: 600, 1702 timeout: 5000, 1703 pager: $(this).parent().find('ul'), 1704 activePagerClass: 'active', 1705 pagerAnchorBuilder: function (idx, slide) { 1706 return '<li><a href="#">'+(idx+1)+'</a></li>'; 1707 } 1708 }); 1709 } 1710 });*/ 1711 1712 /*$.fn.hasAnyClass = function() { 1713 for (var i = 0; i < arguments.length; i++) 1714 { 1715 if (this.hasClass(arguments[i])) 1716 { 1717 return arguments[i]; 1718 } 1719 } 1720 return false; 1721 } 1722 1723 $('body').addClass( $('nav.main-nav ul li.active-trail').hasAnyClass('green', 'red', 'orange', 'yellow') );*/ 1724 1725 1726 1727 $('#banner').each(function(){ 1728 1729 if( $(this).find('li').length > 1 ){ 1730 1731 //$(this).parent().append('<div class="pager"><a href="#" class="prev">Previous</a><a href="#" class="next">Next</a></div>'); 1732 $(this).find('ul').cycle({ 1733 fx: 'fade', 1734 speed: 500, 1735 timeout: 4500, 1736 //prev: $(this).parent().find('a.prev'), 1737 //next: $(this).parent().find('a.next'), 1738 activePagerClass: 'active', 1739 cleartypeNoBg: true 1740 }); 1741 } 1742 }); 1743 1744 1745 $('.field-name-field-rooms-photos .field-items').each(function(){ 1746 1747 if( $(this).children().length > 1 ){ 1748 1749 $(this).parent().append('<div class="pager"><a href="#" class="prev">Previous</a><div class="pager-items"></div><a href="#" class="next">Next</a></div>'); 1750 $(this).cycle({ 1751 fx: 'scrollHorz', 1752 speed: 500, 1753 timeout: 4500, 1754 prev: $(this).parent().find('a.prev'), 1755 next: $(this).parent().find('a.next'), 1756 pager: $(this).parent().find('div.pager-items'), 1757 pagerAnchorBuilder: function (idx, slide) { 1758 return '<a href="#">'+(idx+1)+'</a>'; 1759 }, 1760 activePagerClass: 'active', 1761 cleartypeNoBg: true 1762 }); 1763 } 1764 }); 1765 1766 }); 1767})(jQuery); 1768;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.