/** * AsyncSlider * JQuery plugin * * Created by: Arlind Nushi * Author email: arlindd@gmail.com * * Last Update: August 16, 2011 */ (function($){var ct;var p=this;var rotations_count=0;var callback=function(){};var bg_mask;var bg_mask_2;var slides=[];var min_time=500;var max_time=1000;var direction='horizontal';var easing='easeInOutSine';var easing_in='';var easing_out='';var keyboard_navigate=false;var prev_next_nav=true;var center_prev_next_nav=true;var prev_next_nav_margin=5;var slides_nav=true;var random=true;var autoswitch=false;var autoswitch_interval=5000;var autoswitch_interval_func=null;var current_index=0;var total_slides=0;var timeout;var horizontal_direction='';var vertical_direction='';var base_zindex=1000;var busy=false;var _next_a,_prev_a;var slides_nav_el;function sliderPrepare(el,options) {if(typeof ct=='undefined') {ct=$(el);ct.css({position:'relative'});if(typeof options=='object') {if(typeof options.direction=='string') {if(options.direction.toLowerCase()=='vertical') {direction='vertical';} else {direction='horizontal';}} if(typeof options.random!='undefined') {random=options.random;} if(typeof options.minTime!='undefined') {min_time=options.minTime;} if(typeof options.maxTime!='undefined') {max_time=options.maxTime;} if(typeof options.easing=='string') {easing=options.easing;} if(typeof options.easingIn=='string') {easing_in=options.easingIn;} if(typeof options.easingOut=='string') {easing_out=options.easingOut;} if(typeof options.keyboardNavigate!='undefined') {keyboard_navigate=options.keyboardNavigate?true:false;} if(typeof options.prevNextNav!='undefined') {prev_next_nav=options.prevNextNav;} if(typeof options.centerPrevNextNav!='undefined') {center_prev_next_nav=true;prev_next_nav_margin=parseInt(options.centerPrevNextNav,10);} if(typeof options.slidesNav!='undefined') {slides_nav=options.slidesNav;} if(typeof options.autoswitch=='number'&&options.autoswitch>0) {autoswitch=true;autoswitch_interval=options.autoswitch;_autoSwitch("on");}} else {options={};} ct.children().each(function(i) {var slide=$(this);var slide_elements=slide.find('*');slide.hide().css({zIndex:base_zindex+10,position:'relative'});slide.height=slide.outerHeight()>slide.height()?slide.outerHeight():slide.height();slide.width=slide.outerWidth();slide.background=false;var sbg="";var _bg_color=slide.css("background-color");var _bg_image=slide.css("background-image");var _bg_repeat=slide.css("background-repeat");var _bg_position=slide.css("background-position");var _bg_property=_bg_color+' '+(_bg_image=='none'?'':_bg_image)+' '+_bg_position+' '+_bg_repeat;if(_bg_image!='none'||_bg_color) {sbg=_bg_property;slide.css("background","none");} if(sbg||slide.attr("data-background")) {slide.background=sbg;if(slide.attr("data-background")) {slide.background=slide.attr("data-background");} var img_url=[];img_url=slide.background.match(/url\((.*?)\)/);if(img_url&&img_url.length>0) {var img=new Image();img.src=img_url[1];}} slide.elements=[];slide_elements.each(function() {var $this=$(this);var def_left=parseInt($this.css("left"),10);var def_top=parseInt($this.css("top"),10);$this.def_left=0;$this.def_top=0;if(def_left) {$this.def_left=def_left;} if(def_top) {$this.def_top=def_top;} if($this.css('position')!='absolute') {$this.css({position:'relative'});} $this.css({zIndex:base_zindex+10});if($this.get(0).tagName!="BR") {slide.elements.push($this);}});slide.index=parseInt(i,10);slides.push(slide);if(i===0) {slide.show();ct.height(slide.height).css({overflow:'hidden'});bg_mask=$('
');bg_mask_2=$('
');slide.before(bg_mask);slide.before(bg_mask_2);bg_mask.css({position:'absolute',top:0,left:0,zIndex:base_zindex+1,padding:0,margin:0,width:ct.outerWidth(),height:ct.outerHeight()});bg_mask_2.css({position:'absolute',top:0,left:0,zIndex:base_zindex+2,padding:0,margin:0,width:ct.outerWidth(),height:ct.outerHeight()});$(window).resize(function() {bg_mask.width(ct.outerWidth());bg_mask_2.width(ct.outerWidth());});if(slide.background) {bg_mask.css("background",slide.background);}}});total_slides=slides.length;if(typeof options!='undefined'&&typeof options.firstSlide!='undefined') {var fs_index=options.firstSlide-1;if(fs_index>=0&&fs_index1) {var next_prev_nav_el=$('