');
actli.find('.tp-half-one').clone(true).appendto(actli).addclass("tp-half-two");
actli.find('.tp-half-two').removeclass('tp-half-one');
actli.find('.tp-half-two').wrapinner('');
// animate the cuts
var img=actli.find('.defaultimg');
if (img.length>0 && img.data("fullwidthcentering")=="on") {
var imgh=img.height()/2;
var to=img.position().top;
} else {
var imgh=opt.height/2;
var to=0;
}
actli.find('.tp-half-one').css({'width':opt.width+"px",'height':(to+imgh)+"px",'overflow':'hidden','position':'absolute','top':'0px','left':'0px'});
actli.find('.tp-half-two').css({'width':opt.width+"px",'height':(to+imgh)+"px",'overflow':'hidden','position':'absolute','top':(to+imgh)+'px','left':'0px'});
actli.find('.tp-half-two .tp-offset').css({'position':'absolute','top':(0-imgh-to)+'px','left':'0px'});
// delegate .transition() calls to .animate()
// if the browser can't do css transitions.
if (!$.support.transition) {
actli.find('.tp-half-one').animate({'opacity':0,'top':(0-opt.height/2)+"px"},{duration: 500,queue:false});
actli.find('.tp-half-two').animate({'opacity':0,'top':(opt.height)+"px"},{duration: 500,queue:false});
} else {
var ro1=math.round(math.random()*40-20);
var ro2=math.round(math.random()*40-20);
var sc1=math.random()*1+1;
var sc2=math.random()*1+1;
actli.find('.tp-half-one').transition({opacity:1, scale:sc1, rotate:ro1,y:(0-opt.height/1.4)+"px"},800,'in');
actli.find('.tp-half-two').transition({opacity:1, scale:sc2, rotate:ro2,y:(0+opt.height/1.4)+"px"},800,'in');
if (actli.html()!=null) nextli.transition({scale:0.8,x:opt.width*0.1, y:opt.height*0.1, rotate:ro1},0).transition({rotate:0, scale:1,x:0,y:0},600,'snap');
}
nextsh.find('.defaultimg').css({'opacity':1});
settimeout(function() {
// clean up before we start
actli.css({'position':'absolute','z-index':18});
nextli.css({'position':'absolute','z-index':20});
nextsh.find('.defaultimg').css({'opacity':1});
actsh.find('.defaultimg').css({'opacity':0});
if (actli.find('.tp-half-one').length>0) {
actli.find('.tp-half-one >img, .tp-half-one >div').unwrap();
}
actli.find('.tp-half-two').remove();
opt.transition = 0;
opt.act = opt.next;
},800);
nextli.css({'opacity':1});
}
////////////////////////////////////////
// the slotslide - transition xvii. //
///////////////////////////////////////
if (nexttrans==17) { // 3d curtain horizontal
masterspeed = masterspeed + 100;
if (opt.slots>10) opt.slots=10;
nextli.css({'opacity':1});
// prepare the slots here
prepareoneslidev(actsh,opt,true);
prepareoneslidev(nextsh,opt,false);
//set default img unvisible
nextsh.find('.defaultimg').css({'opacity':0});
//actsh.find('.defaultimg').css({'opacity':0});
// all new slots should be slided from the left to the right
nextsh.find('.slotslide').each(function(j) {
var ss=$(this);
ss.transition({ opacity:0, rotatey:350 ,rotatex:40, perspective:'1400px'},0);
settimeout(function() {
ss.transition({opacity:1, top:0, left:0, scale:1, perspective:'150px', rotate:0,rotatey:0, rotatex:0},masterspeed*2,function() {
if (j==opt.slots-1) {
removeslots(container,opt);
nextsh.find('.defaultimg').css({'opacity':1});
if (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0});
opt.act=opt.next;
moveselectedthumb(container);
}
});
},j*100);
});
}
////////////////////////////////////////
// the slotslide - transition xviii. //
///////////////////////////////////////
if (nexttrans==18) { // 3d curtain vertical
masterspeed = masterspeed + 100;
if (opt.slots>10) opt.slots=10;
nextli.css({'opacity':1});
// prepare the slots here
prepareoneslide(actsh,opt,true);
prepareoneslide(nextsh,opt,false);
//set default img unvisible
nextsh.find('.defaultimg').css({'opacity':0});
//actsh.find('.defaultimg').css({'opacity':0});
// all new slots should be slided from the left to the right
nextsh.find('.slotslide').each(function(j) {
var ss=$(this);
ss.transition({ rotatex:10 ,rotatey:310, perspective:'1400px', rotate:0,opacity:0},0);
settimeout(function() {
ss.transition({top:0, left:0, scale:1, perspective:'150px', rotate:0,rotatey:0, rotatex:0,opacity:1},masterspeed*2,function() {
if (j==opt.slots-1) {
removeslots(container,opt);
nextsh.find('.defaultimg').css({'opacity':1});
if (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0});
opt.act=opt.next;
moveselectedthumb(container);
}
});
},j*100);
});
}
////////////////////////////////////////
// the slotslide - transition xix. //
///////////////////////////////////////
if (nexttrans==19) { // cubic vertical
masterspeed = masterspeed + 100;
if (opt.slots>10) opt.slots=10;
nextli.css({'opacity':1});
// prepare the slots here
prepareoneslide(actsh,opt,true);
prepareoneslide(nextsh,opt,false);
//set default img unvisible
nextsh.find('.defaultimg').css({'opacity':0});
//actsh.find('.defaultimg').css({'opacity':0});
var chix=nextli.css('z-index');
var chix2=actli.css('z-index');
//actli.css({'z-index':22});
// all new slots should be slided from the left to the right
nextsh.find('.slotslide').each(function(j) {
var ss=$(this);
//ss.css({'overflow':'visible'});
ss.parent().css({'overflow':'visible'});
ss.css({'background':'#333'});
if (direction==1)
ss.transition({ opacity:0,left:0,top:opt.height/2,perspective:opt.height*100,rotate3d:'1, 0, 0, -90deg '},0);
else
ss.transition({ opacity:0,left:0,top:0-opt.height/2,perspective:opt.height*100,rotate3d:'1, 0, 0, 90deg '},0);
settimeout(function() {
ss.transition({opacity:1,top:0,rotate3d:' 1, 0, 0, 0deg '},masterspeed*2,function() {
if (j==opt.slots-1) {
removeslots(container,opt);
nextsh.find('.defaultimg').css({'opacity':1});
if (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0});
opt.act=opt.next;
moveselectedthumb(container);
}
});
},j*150);
});
actsh.find('.slotslide').each(function(j) {
var ss=$(this);
ss.parent().css({'overflow':'visible'});
ss.css({'background':'#333'});
ss.transition({ top:0,perspective: opt.height*100,rotate3d: '1, 0, 0, 0deg'},0);
actsh.find('.defaultimg').css({'opacity':0});
settimeout(function() {
if (direction==1)
ss.transition({opacity:0.6,left:0,top:0-opt.height/2,rotate3d: '1, 0, 0, 90deg'},masterspeed*2,function() {});
else
ss.transition({opacity:0.6,left:0,top:(0+opt.height/2),rotate3d: '1, 0, 0, -90deg'},masterspeed*2,function() {});
},j*150);
});
}
////////////////////////////////////////
// the slotslide - transition xx. //
///////////////////////////////////////
if (nexttrans==20) { // flyin
masterspeed = masterspeed + 100;
if (opt.slots>10) opt.slots=10;
nextli.css({'opacity':1});
// prepare the slots here
prepareoneslidev(actsh,opt,true);
prepareoneslidev(nextsh,opt,false);
//set default img unvisible
nextsh.find('.defaultimg').css({'opacity':0});
//actsh.find('.defaultimg').css({'opacity':0});
// all new slots should be slided from the left to the right
nextsh.find('.slotslide').each(function(j) {
var ss=$(this);
ss.parent().css({'overflow':'visible'});
if (direction==1)
ss.transition({ scale:0.8,top:0,left:0-opt.width,perspective:opt.width,rotate3d: '2, 5, 0, 110deg'},0);
else
ss.transition({ scale:0.8,top:0,left:0+opt.width,perspective:opt.width,rotate3d: '2, 5, 0, -110deg'},0);
settimeout(function() {
ss.transition({ scale:0.8,left:0,perspective: opt.width,rotate3d: '1, 5, 0, 0deg'},masterspeed*2,'ease').transition({scale:1},200,'out',function() {
if (j==opt.slots-1) {
removeslots(container,opt);
nextsh.find('.defaultimg').css({'opacity':1});
if (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0});
opt.act=opt.next;
moveselectedthumb(container);
}
});
},j*100);
});
actsh.find('.slotslide').each(function(j) {
var ss=$(this);
ss.transition({ scale:0.5,left:0,perspective: 500,rotate3d: '1, 5, 0, 5deg'},300,'in-out');
actsh.find('.defaultimg').css({'opacity':0});
settimeout(function() {
if (direction==1)
ss.transition({top:0,left:opt.width/2,perspective: opt.width,rotate3d: '0, -3, 0, 70deg',opacity:0},masterspeed*2,'out',function() {});
else
ss.transition({top:0,left:0-opt.width/2,perspective: opt.width,rotate3d: '0, -3, 0, -70deg',opacity:0},masterspeed*2,'out',function() {});
},j*100);
});
}
////////////////////////////////////////
// the slotslide - transition xx. //
///////////////////////////////////////
if (nexttrans==21) { // turnoff
masterspeed = masterspeed + 100;
if (opt.slots>10) opt.slots=10;
nextli.css({'opacity':1});
// prepare the slots here
prepareoneslidev(actsh,opt,true);
prepareoneslidev(nextsh,opt,false);
//set default img unvisible
nextsh.find('.defaultimg').css({'opacity':0});
//actsh.find('.defaultimg').css({'opacity':0});
// all new slots should be slided from the left to the right
nextsh.find('.slotslide').each(function(j) {
var ss=$(this);
if (direction==1)
ss.transition({ top:0,left:0-(opt.width/2),perspective: opt.width*2,rotate3d: '0, 100, 0, 90deg'},0);
else
ss.transition({ top:0,left:0+(opt.width/2),perspective: opt.width*2,rotate3d: '0, 100, 0, -90deg'},0);
settimeout(function() {
ss.transition({left:0,perspective: opt.width*2,rotate3d: '0, 0, 0, 0deg'},masterspeed*2,function() {
if (j==opt.slots-1) {
removeslots(container,opt);
nextsh.find('.defaultimg').css({'opacity':1});
if (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0});
opt.act=opt.next;
moveselectedthumb(container);
}
});
},j*100);
});
actsh.find('.slotslide').each(function(j) {
var ss=$(this);
ss.transition({ left:0,perspective: opt.width*2,rotate3d: '0, 0, 0, 0deg'},0);
actsh.find('.defaultimg').css({'opacity':0});
settimeout(function() {
if (direction==1)
ss.transition({top:0,left:(opt.width/2),perspective: opt.width,rotate3d: '0, 1000, 0, -90deg'},masterspeed*1.5,function() {});
else
ss.transition({top:0,left:(0-opt.width/2),perspective: opt.width,rotate3d: '0, 1000, 0, +90deg'},masterspeed*1.5,function() {});
},j*100);
});
}
var data={};
data.slideindex=opt.next+1;
container.trigger('revolution.slide.onchange',data);
container.trigger('revolution.slide.onvideostop');
}
function onyoutubeplayerapiready() {
}
//////////////////////////////////////////
// chang the youtube player state here //
////////////////////////////////////////
function onplayerstatechange(event) {
if (event.data == yt.playerstate.playing) {
var bt = $('body').find('.tp-bannertimer');
var opt = bt.data('opt');
bt.stop();
opt.videoplaying=true;
opt.videostartednow=1;
} else {
var bt = $('body').find('.tp-bannertimer');
var opt = bt.data('opt');
if (opt.conthover==0)
bt.animate({'width':"100%"},{duration:((opt.delay-opt.cd)-100),queue:false, easing:"linear"});
opt.videoplaying=false;
opt.videostoppednow=1;
}
}
///////////////////////////////
// youtube video autoplay //
///////////////////////////////
function onplayerready(event) {
event.target.playvideo();
}
////////////////////////
// vimeo add event /////
////////////////////////
function addevent(element, eventname, callback) {
if (element.addeventlistener) {
element.addeventlistener(eventname, callback, false);
}
else {
element.attachevent(eventname, callback, false);
}
}
//////////////////////////////////////////
// chang the youtube player state here //
////////////////////////////////////////
function vimeoready(player_id) {
var froogaloop = $f(player_id);
//$('#debug').html($('#debug').html()+"
frooga func"+math.round(math.random()*100));
froogaloop.addevent('ready', function(data) {
//$('#debug').html($('#debug').html()+"
ready"+math.round(math.random()*100));
froogaloop.addevent('play', function(data) {
//$('#debug').html($('#debug').html()+"
play"+math.round(math.random()*100));
var bt = $('body').find('.tp-bannertimer');
var opt = bt.data('opt');
bt.stop();
opt.videoplaying=true;
});
froogaloop.addevent('finish', function(data) {
var bt = $('body').find('.tp-bannertimer');
var opt = bt.data('opt');
if (opt.conthover==0)
bt.animate({'width':"100%"},{duration:((opt.delay-opt.cd)-100),queue:false, easing:"linear"});
opt.videoplaying=false;
opt.videostartednow=1;
});
froogaloop.addevent('pause', function(data) {
var bt = $('body').find('.tp-bannertimer');
var opt = bt.data('opt');
if (opt.conthover==0)
bt.animate({'width':"100%"},{duration:((opt.delay-opt.cd)-100),queue:false, easing:"linear"});
opt.videoplaying=false;
opt.videostoppednow=1;
});
});
}
function vimeoready_auto(player_id) {
var froogaloop = $f(player_id);
froogaloop.addevent('ready', function(data) {
froogaloop.api('play');
});
froogaloop.addevent('play', function(data) {
var bt = $('body').find('.tp-bannertimer');
var opt = bt.data('opt');
bt.stop();
opt.videoplaying=true;
});
froogaloop.addevent('finish', function(data) {
var bt = $('body').find('.tp-bannertimer');
var opt = bt.data('opt');
if (opt.conthover==0)
bt.animate({'width':"100%"},{duration:((opt.delay-opt.cd)-100),queue:false, easing:"linear"});
opt.videoplaying=false;
opt.videostartednow=1;
});
froogaloop.addevent('pause', function(data) {
var bt = $('body').find('.tp-bannertimer');
var opt = bt.data('opt');
if (opt.conthover==0)
bt.animate({'width':"100%"},{duration:((opt.delay-opt.cd)-100),queue:false, easing:"linear"});
opt.videoplaying=false;
opt.videostoppednow=1;
});
}
////////////////////////
// show the caption //
///////////////////////
function animatethecaptions(nextli, opt,actli) {
//if ($("body").find('#debug').length==0)
// $("body").append('');
nextli.find('.tp-caption').each(function(i) {
offsetx = opt.width/2 - opt.startwidth/2;
if (opt.bh>1) {
opt.bw=1;
opt.bh=1;
}
if (opt.bw>1) {
opt.bw=1;
opt.bh=1;
}
var xbw = opt.bw;
var xbh = opt.bh;
var nextcaption=nextli.find('.tp-caption:eq('+i+')');
var handlecaption=0;
// hide caption if resolution is too low
if (opt.width0) {
nextcaption.find('iframe').each(function() {
var ifr=$(this);
if (ifr.attr('src').tolowercase().indexof('youtube')>=0) {
if (!ifr.hasclass("haslistener")) {
try {
ifr.attr('id',frameid);
var player;
if (nextcaption.data('autoplay')==true)
player = new yt.player(frameid, {
events: {
"onstatechange": onplayerstatechange,
'onready': onplayerready,
}
});
else
player = new yt.player(frameid, {
events: {
"onstatechange": onplayerstatechange,
}
});
ifr.addclass("haslistener");
nextcaption.data('player',player);
} catch(e) {}
}
} else {
if (ifr.attr('src').tolowercase().indexof('vimeo')>=0) {
if (!ifr.hasclass("haslistener")) {
ifr.addclass("haslistener");
ifr.attr('id',frameid);
var isrc = ifr.attr('src');
var queryparameters = {}, querystring = isrc,
re = /([^&=]+)=([^&]*)/g, m;
// creates a map with the query string parameters
while (m = re.exec(querystring)) {
queryparameters[decodeuricomponent(m[1])] = decodeuricomponent(m[2]);
}
if (queryparameters['player_id']!=undefined) {
isrc = isrc.replace(queryparameters['player_id'],frameid);
} else {
isrc=isrc+"&player_id="+frameid;
}
try{
isrc = isrc.replace('api=0','api=1');
} catch(e) {}
isrc=isrc+"&api=1";
ifr.attr('src',isrc);
var player = nextcaption.find('iframe')[0];
if (nextcaption.data('autoplay')==true)
$f(player).addevent('ready', vimeoready_auto);
else
$f(player).addevent('ready', vimeoready);
}
}
}
});
}
if (nextcaption.hasclass("randomrotate") && (opt.ie || opt.ie9)) nextcaption.removeclass("randomrotate").addclass("sfb");
nextcaption.removeclass('nofilterclass');
var imw =0;
var imh = 0;
if (nextcaption.find('img').length>0) {
var im = nextcaption.find('img');
if (im.data('ww') == undefined) im.data('ww',im.width());
if (im.data('hh') == undefined) im.data('hh',im.height());
var ww = im.data('ww');
var hh = im.data('hh');
im.width(ww*opt.bw);
im.height(hh*opt.bh);
imw = im.width();
imh = im.height();
} else {
if (nextcaption.find('iframe').length>0) {
var im = nextcaption.find('iframe');
if (nextcaption.data('ww') == undefined) {
nextcaption.data('ww',im.width());
}
if (nextcaption.data('hh') == undefined) nextcaption.data('hh',im.height());
var ww = nextcaption.data('ww');
var hh = nextcaption.data('hh');
var nc =nextcaption;
if (nc.data('fsize') == undefined) nc.data('fsize',parseint(nc.css('font-size'),0) || 0);
if (nc.data('pt') == undefined) nc.data('pt',parseint(nc.css('paddingtop'),0) || 0);
if (nc.data('pb') == undefined) nc.data('pb',parseint(nc.css('paddingbottom'),0) || 0);
if (nc.data('pl') == undefined) nc.data('pl',parseint(nc.css('paddingleft'),0) || 0);
if (nc.data('pr') == undefined) nc.data('pr',parseint(nc.css('paddingright'),0) || 0);
if (nc.data('mt') == undefined) nc.data('mt',parseint(nc.css('margintop'),0) || 0);
if (nc.data('mb') == undefined) nc.data('mb',parseint(nc.css('marginbottom'),0) || 0);
if (nc.data('ml') == undefined) nc.data('ml',parseint(nc.css('marginleft'),0) || 0);
if (nc.data('mr') == undefined) nc.data('mr',parseint(nc.css('marginright'),0) || 0);
if (nc.data('bt') == undefined) nc.data('bt',parseint(nc.css('bordertop'),0) || 0);
if (nc.data('bb') == undefined) nc.data('bb',parseint(nc.css('borderbottom'),0) || 0);
if (nc.data('bl') == undefined) nc.data('bl',parseint(nc.css('borderleft'),0) || 0);
if (nc.data('br') == undefined) nc.data('br',parseint(nc.css('borderright'),0) || 0);
if (nc.data('lh') == undefined) nc.data('lh',parseint(nc.css('lineheight'),0) || 0);
var fvwidth=opt.width;
var fvheight=opt.height;
if (fvwidth>opt.startwidth) fvwidth=opt.startwidth;
if (fvheight>opt.startheight) fvheight=opt.startheight;
if (!nextcaption.hasclass('fullscreenvideo'))
nextcaption.css({
'font-size': (nc.data('fsize') * opt.bw)+"px",
'padding-top': (nc.data('pt') * opt.bh) + "px",
'padding-bottom': (nc.data('pb') * opt.bh) + "px",
'padding-left': (nc.data('pl') * opt.bw) + "px",
'padding-right': (nc.data('pr') * opt.bw) + "px",
'margin-top': (nc.data('mt') * opt.bh) + "px",
'margin-bottom': (nc.data('mb') * opt.bh) + "px",
'margin-left': (nc.data('ml') * opt.bw) + "px",
'margin-right': (nc.data('mr') * opt.bw) + "px",
'border-top': (nc.data('bt') * opt.bh) + "px",
'border-bottom': (nc.data('bb') * opt.bh) + "px",
'border-left': (nc.data('bl') * opt.bw) + "px",
'border-right': (nc.data('br') * opt.bw) + "px",
'line-height': (nc.data('lh') * opt.bh) + "px",
'height':(hh*opt.bh)+'px',
'white-space':"nowrap"
});
else
nextcaption.css({
'width':opt.startwidth*opt.bw,
'height':opt.startheight*opt.bh
});
im.width(ww*opt.bw);
im.height(hh*opt.bh);
imw = im.width();
imh = im.height();
} else {
var nc =nextcaption;
if (nc.data('fsize') == undefined) nc.data('fsize',parseint(nc.css('font-size'),0) || 0);
if (nc.data('pt') == undefined) nc.data('pt',parseint(nc.css('paddingtop'),0) || 0);
if (nc.data('pb') == undefined) nc.data('pb',parseint(nc.css('paddingbottom'),0) || 0);
if (nc.data('pl') == undefined) nc.data('pl',parseint(nc.css('paddingleft'),0) || 0);
if (nc.data('pr') == undefined) nc.data('pr',parseint(nc.css('paddingright'),0) || 0);
if (nc.data('mt') == undefined) nc.data('mt',parseint(nc.css('margintop'),0) || 0);
if (nc.data('mb') == undefined) nc.data('mb',parseint(nc.css('marginbottom'),0) || 0);
if (nc.data('ml') == undefined) nc.data('ml',parseint(nc.css('marginleft'),0) || 0);
if (nc.data('mr') == undefined) nc.data('mr',parseint(nc.css('marginright'),0) || 0);
if (nc.data('bt') == undefined) nc.data('bt',parseint(nc.css('bordertop'),0) || 0);
if (nc.data('bb') == undefined) nc.data('bb',parseint(nc.css('borderbottom'),0) || 0);
if (nc.data('bl') == undefined) nc.data('bl',parseint(nc.css('borderleft'),0) || 0);
if (nc.data('br') == undefined) nc.data('br',parseint(nc.css('borderright'),0) || 0);
if (nc.data('lh') == undefined) nc.data('lh',parseint(nc.css('lineheight'),0) || 0);
nextcaption.css({
'font-size': (nc.data('fsize') * opt.bw)+"px",
'padding-top': (nc.data('pt') * opt.bh) + "px",
'padding-bottom': (nc.data('pb') * opt.bh) + "px",
'padding-left': (nc.data('pl') * opt.bw) + "px",
'padding-right': (nc.data('pr') * opt.bw) + "px",
'margin-top': (nc.data('mt') * opt.bh) + "px",
'margin-bottom': (nc.data('mb') * opt.bh) + "px",
'margin-left': (nc.data('ml') * opt.bw) + "px",
'margin-right': (nc.data('mr') * opt.bw) + "px",
'border-top': (nc.data('bt') * opt.bh) + "px",
'border-bottom': (nc.data('bb') * opt.bh) + "px",
'border-left': (nc.data('bl') * opt.bw) + "px",
'border-right': (nc.data('br') * opt.bw) + "px",
'line-height': (nc.data('lh') * opt.bh) + "px",
'white-space':"nowrap"
});
imh=nextcaption.outerheight(true);
imw=nextcaption.outerwidth(true);
}
}
if (nextcaption.hasclass('fade')) {
nextcaption.css({'opacity':0,'left':(xbw*nextcaption.data('x')+offsetx)+'px','top':(opt.bh*nextcaption.data('y'))+"px"});
}
if (nextcaption.hasclass("randomrotate")) {
nextcaption.css({'left':(xbw*nextcaption.data('x')+offsetx)+'px','top':((xbh*nextcaption.data('y'))+offsety)+"px" });
var sc=math.random()*2+1;
var ro=math.round(math.random()*200-100);
var xx=math.round(math.random()*200-100);
var yy=math.round(math.random()*200-100);
nextcaption.data('repx',xx);
nextcaption.data('repy',yy);
nextcaption.data('repo',nextcaption.css('opacity'));
nextcaption.data('rotate',ro);
nextcaption.data('scale',sc);
nextcaption.transition({opacity:0, scale:sc, rotate:ro, x:xx, y: yy,duration: '0ms'});
} else {
if (opt.ie || opt.ie9)
{}
else
nextcaption.transition({ scale:1, rotate:0});
}
if (nextcaption.hasclass('lfr')) {
nextcaption.css({'opacity':1,'left':(15+opt.width)+'px','top':(opt.bh*nextcaption.data('y'))+"px"});
}
if (nextcaption.hasclass('lfl')) {
nextcaption.css({'opacity':1,'left':(-15-imw)+'px','top':(opt.bh*nextcaption.data('y'))+"px"});
}
if (nextcaption.hasclass('sfl')) {
nextcaption.css({'opacity':0,'left':((xbw*nextcaption.data('x'))-50+offsetx)+'px','top':(opt.bh*nextcaption.data('y'))+"px"});
}
if (nextcaption.hasclass('sfr')) {
nextcaption.css({'opacity':0,'left':((xbw*nextcaption.data('x'))+50+offsetx)+'px','top':(opt.bh*nextcaption.data('y'))+"px"});
}
if (nextcaption.hasclass('lft')) {
nextcaption.css({'opacity':1,'left':(xbw*nextcaption.data('x')+offsetx)+'px','top':(-25 - imh)+"px"});
}
if (nextcaption.hasclass('lfb')) {
nextcaption.css({'opacity':1,'left':(xbw*nextcaption.data('x')+offsetx)+'px','top':(25+opt.height)+"px"});
}
if (nextcaption.hasclass('sft')) {
nextcaption.css({'opacity':0,'left':(xbw*nextcaption.data('x')+offsetx)+'px','top':((opt.bh*nextcaption.data('y'))-50)+"px"});
}
if (nextcaption.hasclass('sfb')) {
nextcaption.css({'opacity':0,'left':(xbw*nextcaption.data('x')+offsetx)+'px','top':((opt.bh*nextcaption.data('y'))+50)+"px"});
}
nextcaption.data('timer',settimeout(function() {
nextcaption.css({'visibility':'visible'});
if (nextcaption.hasclass('fade')) {
nextcaption.data('repo',nextcaption.css('opacity'));
nextcaption.animate({'opacity':1},{duration:nextcaption.data('speed')});
if (opt.ie) nextcaption.addclass('nofilterclass');
}
if (nextcaption.hasclass("randomrotate")) {
nextcaption.transition({opacity:1, scale:1, 'left':(xbw*nextcaption.data('x')+offsetx)+'px','top':(xbh*(nextcaption.data('y'))+offsety)+"px", rotate:0, x:0, y:0,duration: nextcaption.data('speed')});
if (opt.ie) nextcaption.addclass('nofilterclass');
}
if (nextcaption.hasclass('lfr') ||
nextcaption.hasclass('lfl') ||
nextcaption.hasclass('sfr') ||
nextcaption.hasclass('sfl') ||
nextcaption.hasclass('lft') ||
nextcaption.hasclass('lfb') ||
nextcaption.hasclass('sft') ||
nextcaption.hasclass('sfb')
)
{
var easetype=nextcaption.data('easing');
if (easetype==undefined) easetype="linear";
nextcaption.data('repx',nextcaption.position().left);
nextcaption.data('repy',nextcaption.position().top);
nextcaption.data('repo',nextcaption.css('opacity'));
nextcaption.animate({'opacity':1,'left':(xbw*nextcaption.data('x')+offsetx)+'px','top':opt.bh*(nextcaption.data('y'))+"px"},{duration:nextcaption.data('speed'), easing:easetype});
if (opt.ie) nextcaption.addclass('nofilterclass');
}
},nextcaption.data('start')));
// if there is any exit anim defined
if (nextcaption.data('end')!=undefined)
nextcaption.data('timer-end',settimeout(function() {
if ((opt.ie || opt.ie9) && (nextcaption.hasclass("randomrotate") || nextcaption.hasclass("randomrotateout"))) {
nextcaption.removeclass("randomrotate").removeclass("randomrotateout").addclass('fadeout');
}
endmovecaption(nextcaption,opt);
},nextcaption.data('end')));
}
})
}
//////////////////////////
// remove the captions //
/////////////////////////
function removethecaptions(actli,opt) {
actli.find('.tp-caption').each(function(i) {
var nextcaption=actli.find('.tp-caption:eq('+i+')');
nextcaption.stop(true,true);
cleartimeout(nextcaption.data('timer'));
cleartimeout(nextcaption.data('timer-end'));
var easetype=nextcaption.data('easing');
easetype="easeinoutsine";
var ll = nextcaption.data('repx');
var tt = nextcaption.data('repy');
var oo = nextcaption.data('repo');
var rot = nextcaption.data('rotate');
var sca = nextcaption.data('scale');
if (nextcaption.find('iframe').length>0) {
// vimeo video pause
try {
var ifr = nextcaption.find('iframe');
var id = ifr.attr('id');
var froogaloop = $f(id);
froogaloop.api("pause");
} catch(e) {}
//you tube pause
try {
var player=nextcaption.data('player');
player.stopvideo();
} catch(e) {}
}
try {
/*if (rot!=undefined || sca!=undefined)
{
if (rot==undefined) rot=0;
if (sca==undefined) sca=1;
nextcaption.transition({'rotate':rot, 'scale':sca, 'opacity':0,'left':ll+'px','top':tt+"px"},(nextcaption.data('speed')+10), function() { nextcaption.removeclass('nofilterclass');nextcaption.css({'visibility':'hidden'})});
} else {
nextcaption.animate({'opacity':0,'left':ll+'px','top':tt+"px"},{duration:(nextcaption.data('speed')+10), easing:easetype, complete:function() { nextcaption.removeclass('nofilterclass');nextcaption.css({'visibility':'hidden'})}});
}*/
endmovecaption(nextcaption,opt);
} catch(e) {}
});
}
//////////////////////////
// move out the captions //
/////////////////////////
function endmovecaption(nextcaption,opt) {
var endspeed=nextcaption.data('endspeed');
if (endspeed==undefined) endspeed=nextcaption.data('speed');
var xx=nextcaption.data('repx');
var yy=nextcaption.data('repy');
var oo=nextcaption.data('repo');
if (nextcaption.hasclass('ltr') ||
nextcaption.hasclass('ltl') ||
nextcaption.hasclass('str') ||
nextcaption.hasclass('stl') ||
nextcaption.hasclass('ltt') ||
nextcaption.hasclass('ltb') ||
nextcaption.hasclass('stt') ||
nextcaption.hasclass('stb')
)
{
xx=nextcaption.position().left;
yy=nextcaption.position().top;
if (nextcaption.hasclass('ltr'))
xx=opt.width+20;
else if (nextcaption.hasclass('ltl'))
xx=0-nextcaption.width()-20;
else if (nextcaption.hasclass('ltt'))
yy=0-nextcaption.height()-20;
else if (nextcaption.hasclass('ltb'))
yy=opt.height+20;
else if (nextcaption.hasclass('str')) {
xx=xx+50;oo=0;
} else if (nextcaption.hasclass('stl')) {
xx=xx-50;oo=0;
} else if (nextcaption.hasclass('stt')) {
yy=yy-50;oo=0;
} else if (nextcaption.hasclass('stb')) {
yy=yy+50;oo=0;
}
var easetype=nextcaption.data('endeasing');
if (easetype==undefined) easetype="linear";
nextcaption.animate({'opacity':oo,'left':xx+'px','top':yy+"px"},{duration:nextcaption.data('endspeed'), easing:easetype});
if (opt.ie) nextcaption.addclass('nofilterclass');
}
else
if ( nextcaption.hasclass("randomrotateout")) {
nextcaption.transition({opacity:0, scale:math.random()*2+0.3, 'left':math.random()*opt.width+'px','top':math.random()*opt.height+"px", rotate:math.random()*40, duration: endspeed});
if (opt.ie) nextcaption.addclass('nofilterclass');
}
else
if (nextcaption.hasclass('fadeout')) {
nextcaption.animate({'opacity':0},{duration:endspeed});
if (opt.ie) nextcaption.addclass('nofilterclass');
}
else
if (nextcaption.hasclass('lfr') ||
nextcaption.hasclass('lfl') ||
nextcaption.hasclass('sfr') ||
nextcaption.hasclass('sfl') ||
nextcaption.hasclass('lft') ||
nextcaption.hasclass('lfb') ||
nextcaption.hasclass('sft') ||
nextcaption.hasclass('sfb')
)
{
if (nextcaption.hasclass('lfr'))
xx=opt.width+20;
else if (nextcaption.hasclass('lfl'))
xx=0-nextcaption.width()-20;
else if (nextcaption.hasclass('lft'))
yy=0-nextcaption.height()-20;
else if (nextcaption.hasclass('lfb'))
yy=opt.height+20;
var easetype=nextcaption.data('endeasing');
if (easetype==undefined) easetype="linear";
nextcaption.animate({'opacity':oo,'left':xx+'px','top':yy+"px"},{duration:nextcaption.data('endspeed'), easing:easetype});
if (opt.ie) nextcaption.addclass('nofilterclass');
}
else
if (nextcaption.hasclass('fade')) {
nextcaption.animate({'opacity':0},{duration:endspeed});
if (opt.ie) nextcaption.addclass('nofilterclass');
}
else
if (nextcaption.hasclass("randomrotate")) {
nextcaption.transition({opacity:0, scale:math.random()*2+0.3, 'left':math.random()*opt.width+'px','top':math.random()*opt.height+"px", rotate:math.random()*40, duration: endspeed});
if (opt.ie) nextcaption.addclass('nofilterclass');
}
}
///////////////////////////
// - countdown - //
/////////////////////////
function countdown(container,opt) {
opt.cd=0;
opt.loop=0;
if (opt.stopafterloops!=undefined && opt.stopafterloops>-1)
opt.looptogo=opt.stopafterloops;
else
opt.looptogo=9999999;
if (opt.stopatslide!=undefined && opt.stopatslide>-1)
opt.lastslidetoshow=opt.stopatslide;
else
opt.lastslidetoshow=999;
if (opt.looptogo==0) opt.stoploop="on";
if (opt.slideamount >1 && !(opt.stopafterloops==0 && opt.stopatslide==1) ) {
var bt=container.find('.tp-bannertimer');
if (bt.length>0) {
bt.css({'width':'0%'});
bt.animate({'width':"100%"},{duration:(opt.delay-100),queue:false, easing:"linear"});
}
bt.data('opt',opt);
opt.cdint=setinterval(function() {
if (container.data('conthover-changed') == 1) {
opt.conthover= container.data('conthover');
container.data('conthover-changed',0);
}
if (opt.conthover!=1 && opt.videoplaying!=true && opt.width>opt.hideslideratlimit) opt.cd=opt.cd+100;
if (opt.fullwidth!="on")
if (opt.width>opt.hideslideratlimit)
container.parent().removeclass("tp-hide-revslider")
else
container.parent().addclass("tp-hide-revslider")
// event triggering in case video has been started
if (opt.videostartednow==1) {
container.trigger('revolution.slide.onvideoplay');
opt.videostartednow=0;
}
// event triggering in case video has been stopped
if (opt.videostoppednow==1) {
container.trigger('revolution.slide.onvideostop');
opt.videostoppednow=0;
}
if (opt.cd>=opt.delay) {
opt.cd=0;
// swap to next banner
opt.act=opt.next;
opt.next=opt.next+1;
if (opt.next>container.find('>ul >li').length-1) {
opt.next=0;
opt.looptogo=opt.looptogo-1;
if (opt.loop<=0) {
opt.stoploop="on";
}
}
// stop timer if no loop no more needed.
if (opt.stoploop=="on" && opt.next==opt.lastslidetoshow-1) {
clearinterval(opt.cdint);
container.find('.tp-bannertimer').css({'visibility':'hidden'});
container.trigger('revolution.slide.onstop');
}
// swap the slides
swapslide(container,opt);
// clear the timer
if (bt.length>0) {
bt.css({'width':'0%'});
bt.animate({'width':"100%"},{duration:(opt.delay-100),queue:false, easing:"linear"});
}
}
},100);
container.hover(
function() {
if (opt.onhoverstop=="on") {
opt.conthover=1;
bt.stop();
container.trigger('revolution.slide.onpause');
}
},
function() {
if (container.data('conthover')!=1) {
container.trigger('revolution.slide.onresume');
opt.conthover=0;
if (opt.onhoverstop=="on" && opt.videoplaying!=true) {
bt.animate({'width':"100%"},{duration:((opt.delay-opt.cd)-100),queue:false, easing:"linear"});
}
}
});
}
}
})(jquery);