} break; case 'straight_stairs': switch(road){ case 'BL': case 'TR': case 'TL': case 'BR': var C = 0, R = 0; break; case 'LB': case 'RT': case 'LT': case 'RB': default: var C = cl, R = 0; break; } c = C; r = R; while(i < count){ if(road.indexOf('T') == 1 || road.indexOf('R') == 1) arr[c+','+r] = il - i++; else arr[c+','+r] = i++; switch(road){ case 'BL': case 'TR': c--; r++; break; case 'TL': case 'BR': c++; r--; break; case 'LB': case 'RT': c--; r--; break; case 'RB': case 'LT': default: c++; r++; break; } if(c < 0 || r < 0 || c > cl || r > rl){ switch(road){ case 'BL': case 'TR': C++; break; case 'LB': case 'RT': case 'TL': case 'BR': R++; break; case 'RB': case 'LT': default: C--; break; } if(C < 0 || R < 0 || C > cl || R > rl){ switch(road){ case 'BL': case 'TR': C = cl; R++; break; case 'TL': case 'BR': R = rl; C++; break; case 'LB': case 'RT': R = rl; C--; break; case 'RB': case 'LT': default: C = 0; R++; break; } if(R > rl) R = rl; else if(R < 0) R = 0; else if(C > cl) C = cl; else if(C < 0) C = 0; } r = R; c = C; } } break; } if(reverse) foreach(arr, function(i){arr[i] = il - arr[i];}); }else arr['0,0'] = 0; OrderArr[OrderOptStr] = arr; } if(order == 'random'){ map(function(){tmp.push(c+','+r)}); tmp.sort(function(a,b){return Math.random() > 0.5;}); for(var i = 0; i < cols*rows; i++) arr[tmp[i]] = i; OrderArr[OrderOptStr] = arr; } return OrderArr[OrderOptStr]; }//doOrder var _effectName = 0; function effectName(){ return 'Sliderman-nameless-effect-'+_effectName++; }//effectName var globalEffects = []; Sliderman.effect = function(e){ if(e){ var n = -1; if(e.name){ var globalEffectsId = array_search(globalEffects, 'name', e.name); if(globalEffectsId) n = globalEffectsId; }else e.name = effectName(); if(n >= 0) globalEffects[n] = e; else globalEffects.push(e); } }//Sliderman.effect Sliderman.effect({name: 'fade', fade: true, duration: 400}); Sliderman.effect({name: 'move', left: true, move: true, duration: 400}); Sliderman.effect({name: 'stairs', cols: 7, rows: 5, delay: 30, order: 'straight_stairs', road: 'BL', fade: true}); Sliderman.effect({name: 'blinds', cols: 10, delay: 100, duration: 400, order: 'straight', right: true, zoom: true, fade: true}); Sliderman.effect({name: 'rain', cols: 10, delay: 100, duration: 400, order: 'straight', top: true, fade: true}); Sliderman.slider = function(parameters){ setOpacityInit(); var Slider = {}, current, previous, prevImg, status = 'free', isHover = false, images = [], descriptions = [], links = [], ef = function(){}; //EVENTS var events = parameters.events, eventCall = events ? function(e){if(events[e] && typeof(events[e]) == 'function') events[e](Slider);} : ef; var contentmode = parameters.contentmode; //SLIDER EFECTS var effects = []; var previousEffect = -1; var addEffect = function(e){ if(typeof(e) == 'string'){ e = e.split(','); if(e.length == 1){ var globalEffectsId = array_search(globalEffects, 'name', e); if(globalEffectsId) addEffect(globalEffects[globalEffectsId]) }else for(var i = 0; i < e.length; i++) addEffect(e[i]); }else if(e){ if(!e.name) e.name = effectName(); var effectsId = array_search(effects, 'name', e.name); if(!effectsId) effectsId = effects.length; effects[effectsId] = array_copy(e); } }//addEffect var getEffect = function(){ var n = 0; if(effects.length > 1){ n = random(effects.length); if(previousEffect == n) n++; n %= effects.length; previousEffect = n; } return effects[n]; }//getEffect