/*! * jQuery ChainFade; version: 1.0 * 2014 - Gonzalo Castillo */(function($){$.fn.chainFade=function(options,callback){var defaults={startAt:0,interval:300,speed:700,fx:'fade',distance:50,direction:'forward',toThe:'top',fixedHeight:false,messages:false,queue:true,ease:'swing',after:function(){}},settings=$.extend(defaults,options);if(settings.messages===true){console.log('--- Chain fade start ---');console.log('Selected options:');for(var opt in settings){console.log('>'+opt+': '+settings[opt]);}} if(settings.fixedHeight===true){var max_h=0;this.each(function(){if($(this).height()>max_h){max_h=$(this).height();}});$(this).height(max_h);} var getCss=function($elem,prop){var wasVisible=$elem.css('display')!=='none';try{return $elem.hide().css(prop);}finally{if(wasVisible)$elem.show();}};var arr_pos=['top','bottom','left','right'],pos={toThe:null,value:0};switch(settings.fx){case 'fade':var items=this.length,count=0;return this.each(function(i,el){for(var i=0;i