Professional Documents
Culture Documents
jqFancyTransitions 1 8 Min Js
jqFancyTransitions 1 8 Min Js
'});if(typeof(direction)=="undefined")
imgInc[el.id]++;else
if(direction=='prev')
imgInc[el.id]--;else
imgInc[el.id]=direction;if(imgInc[el.id]==img[el.id].length){imgInc[el.id]=0;}
if(imgInc[el.id]==-1){imgInc[el.id]=img[el.id].length-1;}
if(titles[el.id][imgInc[el.id]]!=''){$('#ft-title-'+el.id).animate({opacity:0},o
pts[el.id].titleSpeed,function(){$(this).html(titles[el.id][imgInc[el.id]]).anim
ate({opacity:opts[el.id].titleOpacity},opts[el.id].titleSpeed);});}else{$('#ft-t
itle-'+el.id).animate({opacity:0},opts[el.id].titleSpeed);}
inc[el.id]=0;buttons=$('#ft-buttons-'+el.id).children();buttons.each(function(in
dex){if(index==imgInc[el.id]){$(this).addClass('ft-button-'+el.id+'-active');}el
se{$(this).removeClass('ft-button-'+el.id+'-active');}});if(opts[el.id].directio
n=='random')
$.fisherYates(order[el.id]);if((opts[el.id].direction=='right'&&order[el.id][0]=
=1)||opts[el.id].direction=='alternate'||opts[el.id].direction=='fountainAlterna
te')
order[el.id].reverse();};$.strips=function(itemId,el){temp=opts[el.id].strips;if
(inc[el.id]==temp){clearInterval(stripInt[el.id]);return;}
$('.ft-'+el.id).attr('href',links[el.id][imgInc[el.id]]);if(opts[el.id].position
=='curtain'){currWidth=$('#ft-'+el.id+itemId).width();$('#ft-'+el.id+itemId).css
({width:0,opacity:0,'background-image':'url('+img[el.id][imgInc[el.id]]+')'});$(
'#ft-'+el.id+itemId).animate({width:currWidth,opacity:1},1000);}else{$('#ft-'+el
.id+itemId).css({height:0,opacity:0,'background-image':'url('+img[el.id][imgInc[
el.id]]+')'});$('#ft-'+el.id+itemId).animate({height:opts[el.id].height,opacity:
1},1000);}
inc[el.id]++;};$.navigation=function(el){$('#'+el.id).append("<a href='#' id='ft
-prev-"+el.id+"' class='ft-prev'>prev</a>");$('#'+el.id).append("<a href='#' id=
'ft-next-"+el.id+"' class='ft-next'>next</a>");$('#ft-prev-'+el.id).css({'positi
on':'absolute','top':params.height/2-15,'left':0,'z-index':1001,'line-height':'3
0px','opacity':0.7}).click(function(e){e.preventDefault();$.transition(el,'prev'
);clearInterval(imgInt[el.id]);imgInt[el.id]=setInterval(function(){$.transition
(el)},params.delay+params.stripDelay*params.strips);});$('#ft-next-'+el.id).css(
{'position':'absolute','top':params.height/2-15,'right':0,'z-index':1001,'line-h
eight':'30px','opacity':0.7}).click(function(e){e.preventDefault();$.transition(
el);clearInterval(imgInt[el.id]);imgInt[el.id]=setInterval(function(){$.transiti
on(el)},params.delay+params.stripDelay*params.strips);});$("<div id='ft-buttons"+el.id+"'></div>").insertAfter($('#'+el.id));$('#ft-buttons-'+el.id).css({'text
-align':'right','padding-top':5,'width':opts[el.id].width});for(k=1;k<img[el.id]
.length+1;k++){$('#ft-buttons-'+el.id).append("<a href='#' class='ft-button-"+el
.id+"'>"+k+"</a>");}
$('.ft-button-'+el.id).css({'padding':5});$.each($('.ft-button-'+el.id),function
(i,item){$(item).click(function(e){e.preventDefault();$.transition(el,i);clearIn
terval(imgInt[el.id]);imgInt[el.id]=setInterval(function(){$.transition(el)},par
ams.delay+params.stripDelay*params.strips);})});}
$.fisherYates=function(arr){var i=arr.length;if(i==0)return false;while(--i){var
j=Math.floor(Math.random()*(i+1));var tempi=arr[i];var tempj=arr[j];arr[i]=temp
j;arr[j]=tempi;}}
this.each(function(){init(this);});};$.fn.jqFancyTransitions.defaults={width:500
,height:332,strips:10,delay:5000,stripDelay:50,titleOpacity:0.7,titleSpeed:1000,
position:'alternate',direction:'fountainAlternate',effect:'',navigation:false,li
nks:false};})(jQuery);