/** * jQuery.ScrollTo - Easy element scrolling using jQuery. * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com * Dual licensed under MIT and GPL. * Date: 5/25/2009 * @author Ariel Flesler * @version 1.4.2 * * http://flesler.blogspot.com/2007/10/jqueryscrollto.html */ ;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery); /** * jQuery.LocalScroll - Animated scrolling navigation, using anchors. * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com * Dual licensed under MIT and GPL. * Date: 3/11/2009 * @author Ariel Flesler * @version 1.2.7 **/ ;(function($){var l=location.href.replace(/#.*/,'');var g=$.localScroll=function(a){$('body').localScroll(a)};g.defaults={duration:1e3,axis:'y',event:'click',stop:true,target:window,reset:true};g.hash=function(a){if(location.hash){a=$.extend({},g.defaults,a);a.hash=false;if(a.reset){var e=a.duration;delete a.duration;$(a.target).scrollTo(0,a);a.duration=e}i(0,location,a)}};$.fn.localScroll=function(b){b=$.extend({},g.defaults,b);return b.lazy?this.bind(b.event,function(a){var e=$([a.target,a.target.parentNode]).filter(d)[0];if(e)i(a,e,b)}):this.find('a,area').filter(d).bind(b.event,function(a){i(a,this,b)}).end().end();function d(){return!!this.href&&!!this.hash&&this.href.replace(this.hash,'')==l&&(!b.filter||$(this).is(b.filter))}};function i(a,e,b){var d=e.hash.slice(1),f=document.getElementById(d)||document.getElementsByName(d)[0];if(!f)return;if(a)a.preventDefault();var h=$(b.target);if(b.lock&&h.is(':animated')||b.onBefore&&b.onBefore.call(b,a,f,h)===false)return;if(b.stop)h.stop(true);if(b.hash){var j=f.id==d?'id':'name',k=$(' ').attr(j,d).css({position:'absolute',top:$(window).scrollTop(),left:$(window).scrollLeft()});f[j]='';$('body').prepend(k);location=e.hash;k.remove();f[j]=d}h.scrollTo(f,b).trigger('notify.serialScroll',[f])}})(jQuery); /* * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ * * Uses the built in easing capabilities added In jQuery 1.1 * to offer multiple easing options * * TERMS OF USE - jQuery Easing * * Open source under the BSD License. * * Copyright © 2008 George McGinley Smith * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * Neither the name of the author nor the names of contributors may be used to endorse * or promote products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * */ // t: current time, b: begInnIng value, c: change In value, d: duration jQuery.easing['jswing'] = jQuery.easing['swing']; jQuery.extend( jQuery.easing, { def: 'easeOutQuad', swing: function (x, t, b, c, d) { //alert(jQuery.easing.default); return jQuery.easing[jQuery.easing.def](x, t, b, c, d); }, easeInQuad: function (x, t, b, c, d) { return c*(t/=d)*t + b; }, easeOutQuad: function (x, t, b, c, d) { return -c *(t/=d)*(t-2) + b; }, easeInOutQuad: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t + b; return -c/2 * ((--t)*(t-2) - 1) + b; }, easeInCubic: function (x, t, b, c, d) { return c*(t/=d)*t*t + b; }, easeOutCubic: function (x, t, b, c, d) { return c*((t=t/d-1)*t*t + 1) + b; }, easeInOutCubic: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t*t + b; return c/2*((t-=2)*t*t + 2) + b; }, easeInQuart: function (x, t, b, c, d) { return c*(t/=d)*t*t*t + b; }, easeOutQuart: function (x, t, b, c, d) { return -c * ((t=t/d-1)*t*t*t - 1) + b; }, easeInOutQuart: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t*t*t + b; return -c/2 * ((t-=2)*t*t*t - 2) + b; }, easeInQuint: function (x, t, b, c, d) { return c*(t/=d)*t*t*t*t + b; }, easeOutQuint: function (x, t, b, c, d) { return c*((t=t/d-1)*t*t*t*t + 1) + b; }, easeInOutQuint: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; return c/2*((t-=2)*t*t*t*t + 2) + b; }, easeInSine: function (x, t, b, c, d) { return -c * Math.cos(t/d * (Math.PI/2)) + c + b; }, easeOutSine: function (x, t, b, c, d) { return c * Math.sin(t/d * (Math.PI/2)) + b; }, easeInOutSine: function (x, t, b, c, d) { return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; }, easeInExpo: function (x, t, b, c, d) { return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b; }, easeOutExpo: function (x, t, b, c, d) { return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; }, easeInOutExpo: function (x, t, b, c, d) { if (t==0) return b; if (t==d) return b+c; if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; }, easeInCirc: function (x, t, b, c, d) { return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; }, easeOutCirc: function (x, t, b, c, d) { return c * Math.sqrt(1 - (t=t/d-1)*t) + b; }, easeInOutCirc: function (x, t, b, c, d) { if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; }, easeInElastic: function (x, t, b, c, d) { var s=1.70158;var p=0;var a=c; if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; if (a < Math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*Math.PI) * Math.asin (c/a); return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; }, easeOutElastic: function (x, t, b, c, d) { var s=1.70158;var p=0;var a=c; if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; if (a < Math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*Math.PI) * Math.asin (c/a); return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; }, easeInOutElastic: function (x, t, b, c, d) { var s=1.70158;var p=0;var a=c; if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); if (a < Math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*Math.PI) * Math.asin (c/a); if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; }, easeInBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; return c*(t/=d)*t*((s+1)*t - s) + b; }, easeOutBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; }, easeInOutBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; }, easeInBounce: function (x, t, b, c, d) { return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b; }, easeOutBounce: function (x, t, b, c, d) { if ((t/=d) < (1/2.75)) { return c*(7.5625*t*t) + b; } else if (t < (2/2.75)) { return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; } else if (t < (2.5/2.75)) { return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; } else { return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; } }, easeInOutBounce: function (x, t, b, c, d) { if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; } }); /* * * TERMS OF USE - EASING EQUATIONS * * Open source under the BSD License. * * Copyright © 2001 Robert Penner * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * Neither the name of the author nor the names of contributors may be used to endorse * or promote products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * */ // ---------------------------------------------------------------------------- // Vegas - jQuery plugin // Add awesome fullscreen backgrounds to your webpages. // v 1.2 // Dual licensed under the MIT and GPL licenses. // http://vegas.jaysalvat.com/ // ---------------------------------------------------------------------------- // Copyright (C) 2011 Jay Salvat // http://jaysalvat.com/ // ---------------------------------------------------------------------------- // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files ( the "Software" ), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // ---------------------------------------------------------------------------- ( function( $ ){ var $background = $( '' ).addClass( 'vegas-background' ), $overlay = $( '
' ).addClass( 'vegas-overlay' ), $loading = $( '' ).addClass( 'vegas-loading' ), $current = $(), paused = null, backgrounds = [], step = 0, delay = 5000, timer, methods = { // Init plugin init : function( settings ) { var options = { src: getBackground(), align: 'center', valign: 'center', fade: 0, loading: true, load: function() {}, complete: function() {} } $.extend( options, $.vegas.defaults.background, settings ); if ( options.loading ) { loading(); } var $new = $background.clone(); $new.css( { 'position': 'fixed', 'left': '0px', 'top': '0px' }) .imagesLoadedForVegas( function() { if ( $new == $current ) { return; } $( window ).bind( 'resize.vegas', function( e ) { resize( $new, options ); }); if ( $current.is( 'img' ) ) { $current.stop(); $new.hide() .insertAfter( $current ) .fadeIn( options.fade, function() { $('.vegas-background') .not(this) .remove(); $( 'body' ).trigger( 'vegascomplete', [ this, step - 1 ] ); options.complete.apply( $new, [ step - 1 ] ); }); } else { $new.hide() .prependTo( 'body' ) .fadeIn( options.fade, function() { $( 'body' ).trigger( 'vegascomplete', [ this, step - 1 ] ); options.complete.apply( this, [ step - 1 ] ); }); } $current = $new; resize( $current, options ); if ( options.loading ) { loaded(); } $( 'body' ).trigger( 'vegasload', [ $current.get(0), step - 1 ] ); options.load.apply( $current.get(0), [ step - 1 ] ); if ( step ) { $( 'body' ).trigger( 'vegaswalk', [ $current.get(0), step - 1 ] ); options.walk.apply( $current.get(0), [ step - 1 ] ); } }) .attr( 'src', options.src ); return $.vegas; }, // Destroy background and/or overlay destroy: function( what ) { if ( !what || what == 'background') { $( '.vegas-background, .vegas-loading' ).remove(); $( window ).unbind( 'resize.vegas' ); $current = null; } if ( what == 'overlay') { $( '.vegas-overlay' ).remove(); } return $.vegas; }, // Display the pattern overlay overlay: function( settings ) { var options = { src: null, opacity: null }; $.extend( options, $.vegas.defaults.overlay, settings ); $overlay.remove(); $overlay .css( { 'margin': '0', 'padding': '0', 'position': 'fixed', 'left': '0px', 'top': '0px', 'width': '100%', 'height': '100%' }); if ( options.src ) { $overlay.css( 'backgroundImage', 'url(' + options.src + ')' ); } if ( options.opacity ) { $overlay.css( 'opacity', options.opacity ); } $overlay.prependTo( 'body' ); return $.vegas; }, // Start/restart slideshow slideshow: function( settings, keepPause ) { var options = { step: step, delay: delay, preload: false, backgrounds: backgrounds, walk: function() {} }; $.extend( options, $.vegas.defaults.slideshow, settings ); if ( options.backgrounds != backgrounds ) { if ( !settings.step ) { options.step = 0; } if ( options.preload ) { $.vegas( 'preload', options.backgrounds ); } } backgrounds = options.backgrounds; delay = options.delay; step = options.step; clearInterval( timer ); if ( !backgrounds.length ) { return $.vegas; } var doSlideshow = function() { if ( step < 0 ) { step = backgrounds.length - 1; } if ( step >= backgrounds.length || !backgrounds[ step - 1 ] ) { step = 0; } var settings = backgrounds[ step++ ]; settings.walk = options.walk; if ( settings.fade > options.delay ) { settings.fade = options.delay; } $.vegas( settings ); } doSlideshow(); if ( !keepPause ) { paused = false; $( 'body' ).trigger( 'vegasstart', [ $current.get(0), step - 1 ] ); } if ( !paused ) { timer = setInterval( doSlideshow, options.delay ); } return $.vegas; }, // Jump to the next background in the current slideshow next: function() { var from = step; if ( step ) { $.vegas( 'slideshow', { step: step }, true ); $( 'body' ).trigger( 'vegasnext', [ $current.get(0), step - 1, from - 1 ] ); } return $.vegas; }, // Jump to the previous background in the current slideshow previous: function() { var from = step; if ( step ) { $.vegas( 'slideshow', { step: step - 2 }, true ); $( 'body' ).trigger( 'vegasprevious', [ $current.get(0), step - 1, from - 1 ] ); } return $.vegas; }, // Jump to a specific background in the current slideshow jump: function( s ) { var from = step; if ( step ) { $.vegas( 'slideshow', { step: s }, true ); $( 'body' ).trigger( 'vegasjump', [ $current.get(0), step - 1, from - 1 ] ); } return $.vegas; }, // Stop slideshow stop: function() { var from = step; step = 0; paused = null; clearInterval( timer ); $( 'body' ).trigger( 'vegasstop', [ $current.get(0), from - 1 ] ); return $.vegas; }, // Pause slideShow pause: function() { paused = true; clearInterval( timer ); $( 'body' ).trigger( 'vegaspause', [ $current.get(0), step - 1 ] ); return $.vegas; }, // Get some useful values or objects get: function( what ) { if ( what == null || what == 'background' ) { return $current.get(0); } if ( what == 'overlay' ) { return $overlay.get(0); } if ( what == 'step' ) { return step - 1; } if ( what == 'paused' ) { return paused; } }, // Preload an array of backgrounds preload: function( backgrounds ) { for( var i in backgrounds ) { if ( backgrounds[ i ].src ) { $(''); } } return $.vegas; } } // Resize the background function resize( $img, settings ) { var options = { align: 'center', valign: 'center' } $.extend( options, settings ); var ww = $( window ).width(), wh = $( window ).height(), iw = $img.width(), ih = $img.height(), rw = wh / ww, ri = ih / iw, newWidth, newHeight, newLeft, newTop, properties; if ( rw > ri ) { newWidth = wh / ri; newHeight = wh; } else { newWidth = ww; newHeight = ww * ri; } properties = { 'width': newWidth + 'px', 'height': newHeight + 'px', 'top': 'auto', 'bottom': 'auto', 'left': 'auto', 'right': 'auto' } if ( !isNaN( parseInt( options.valign ) ) ) { properties[ 'top' ] = ( 0 - ( newHeight - wh ) / 100 * parseInt( options.valign ) ) + 'px'; } else if ( options.valign == 'top' ) { properties[ 'top' ] = 0; } else if ( options.valign == 'bottom' ) { properties[ 'bottom' ] = 0; } else { properties[ 'top' ] = ( wh - newHeight ) / 2; } if ( !isNaN( parseInt( options.align ) ) ) { properties[ 'left' ] = ( 0 - ( newWidth - ww ) / 100 * parseInt( options.align ) ) + 'px'; } else if ( options.align == 'left' ) { properties[ 'left' ] = 0; } else if ( options.align == 'right' ) { properties[ 'right' ] = 0; } else { properties[ 'left' ] = ( ww - newWidth ) / 2 ; } $img.css( properties ); } // Display the loading indicator function loading() { $loading.prependTo( 'body' ).fadeIn(); } // Hide the loading indicator function loaded() { $loading.fadeOut( 'fast', function() { $( this ).remove(); }); } // Get the background image from the body function getBackground() { if ( $( 'body' ).css( 'backgroundImage' ) ) { return $( 'body' ).css( 'backgroundImage' ).replace( /url\("?(.*?)"?\)/i, '$1' ); } } // The plugin $.vegas = function( method ) { if ( methods[ method ] ) { return methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 ) ); } else if ( typeof method === 'object' || !method ) { return methods.init.apply( this, arguments ); } else { $.error( 'Method ' + method + ' does not exist' ); } }; // Global parameters $.vegas.defaults = { background: { // src: string // align: string/int // valign: string/int // fade: int // loading bool // load: function // complete: function }, slideshow: { // step: int // delay: int // backgrounds: array // preload: bool // walk: function }, overlay: { // src: string // opacity: float } } /*! * jQuery imagesLoaded plugin v1.0.3 * http://github.com/desandro/imagesloaded * * MIT License. by Paul Irish et al. */ $.fn.imagesLoadedForVegas = function( callback ) { var $this = this, $images = $this.find('img').add( $this.filter('img') ), len = $images.length, blank = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw=='; function triggerCallback() { callback.call( $this, $images ); } function imgLoaded() { if ( --len <= 0 && this.src !== blank ){ setTimeout( triggerCallback ); $images.unbind( 'load error', imgLoaded ); } } if ( !len ) { triggerCallback(); } $images.bind( 'load error', imgLoaded ).each( function() { // cached images don't fire load sometimes, so we reset src. if (this.complete || this.complete === undefined){ var src = this.src; // webkit hack from http://groups.google.com/group/jquery-dev/browse_thread/thread/eee6ab7b2da50e1f // data uri bypasses webkit log warning (thx doug jones) this.src = blank; this.src = src; } }); return $this; }; })( jQuery ); /* * CrossSlide jQuery plugin v0.6.2 * * Copyright 2007-2010 by Tobia Conforto