(function($,undefined){ //////////////////////////////////////// // the revolution plugin starts here // /////////////////////////////////////// $.fn.extend({ // our plugin here :) revolution: function(options) { //////////////////////////////// // set default values of item // //////////////////////////////// $.fn.revolution.defaults = { delay:9000, startheight:500, startwidth:960, hidethumbs:200, thumbwidth:100, // thumb with and height and amount (only if navigation tyope set to thumb !) thumbheight:50, thumbamount:5, navigationtype:"bullet", //bullet, thumb, none, both (no thumbs in fullwidth version !) navigationarrows:"nexttobullets", //nexttobullets, verticalcentered, none navigationstyle:"round", //round,square,navbar touchenabled:"on", // enable swipe function : on/off onhoverstop:"on", // stop banner timet at hover on slide on/off navoffsethorizontal:0, navoffsetvertical:20, stopatslide:-1, // stop timer if slide "x" has been reached. if stopafterloops set to 0, then it stops already in the first loop at slide x which defined. -1 means do not stop at any slide. stopafterloops has no sinn in this case. stopafterloops:-1, // stop timer if all slides has been played "x" times. it will stop at the slide which is defined via stopatslide:x, if set to -1 slide never stop automatic hidecaptionatlimit:0, // it defines if a caption should be shown under a screen resolution ( basod on the width of browser) hideallcaptionatlilmit:0, // hide all the captions if width of browser is less then this value hideslideratlimit:0, // hide the whole slider, and stop also functions if width of browser is less than this value shadow:1, //0 = no shadow, 1,2,3 = 3 different art of shadows (no shadow in fullwidth version !) fullwidth:"off" // turns on or off the fullwidth image centering in fullwidth modus }; options = $.extend({}, $.fn.revolution.defaults, options); return this.each(function() { var opt=options; var container=$(this); // check if firefox 13 is on way.. it has a strange bug, css animate should not be used opt.firefox13 = ($.browser.mozilla) && (parseint($.browser.version,0)==13 || parseint($.browser.version,0)==14 || parseint($.browser.version,0)==15 || parseint($.browser.version,0)==16 ); opt.ie = $.browser.msie && parseint($.browser.version,0)<9; opt.ie9 = $.browser.msie && parseint($.browser.version,0)==9; // check the jquery version var version = $.fn.jquery.split('.'), versiontop = parsefloat(version[0]), versionminor = parsefloat(version[1]), versionincrement = parsefloat(version[2] || '0'); if (versiontop==1 && versionminor < 7) { container.html('
the current version of jquery:'+version+'
please update your jquery version to min. 1.7 in case you wish to use the revolution slider plugin
'); } // delegate .transition() calls to .animate() // if the browser can't do css transitions. if (!$.support.transition) $.fn.transition = $.fn.animate; $.cssease['bounce'] = 'cubic-bezier(0,1,0.5,1.3)'; // catch the container //var container=$(this); //container.css({'display':'block'}); // load the youtube api if necessary container.find('.caption').each(function() { $(this).addclass('tp-caption')}); container.find('.tp-caption iframe').each(function() { try { if ($(this).attr('src').indexof('you')>0) { var s = document.createelement("script"); s.src = "http://www.youtube.com/player_api"; /* load player api*/ var before = document.getelementsbytagname("script")[0]; before.parentnode.insertbefore(s, before); } } catch(e) {} }); // load the vimeo api container.find('.tp-caption iframe').each(function() { try{ if ($(this).attr('src').indexof('vim')>0) { var f = document.createelement("script"); f.src = "http://a.vimeocdn.com/js/froogaloop2.min.js"; /* load player api*/ var before = document.getelementsbytagname("script")[0]; before.parentnode.insertbefore(f, before); } } catch(e) {} }); // shuffle mode if (opt.shuffle=="on") { for (var u=0;uul:first-child >li').length;u++) { var it = math.round(math.random()*container.find('>ul:first-child >li').length); container.find('>ul:first-child >li:eq('+it+')').prependto(container.find('>ul:first-child')); } } // create some default options for later opt.slots=4; opt.act=-1; opt.next=0; opt.origcd=opt.delay; opt.firststart=1; // basic offset positions of the bullets if (opt.navoffsethorizontal==undefined) opt.navoffsethorizontal=0; if (opt.navoffsetvertical==undefined) opt.navoffsetvertical=0; // shortway usage of offsets opt.navoh = opt.navoffsethorizontal; opt.navov = opt.navoffsetvertical; container.append('
'); // reset the timer if (container.find('.tp-bannertimer').length==0) container.append(''); var bt=container.find('.tp-bannertimer'); if (bt.length>0) { bt.css({'width':'0%'}); }; // we need to add a basic class for settings.css container.addclass("tp-simpleresponsive"); opt.container=container; //if (container.height()==0) container.height(opt.startheight); // amount of the slides opt.slideamount = container.find('>ul:first >li').length; //alert(opt.slideamount); // a basic grid must be defined. if no default grid exist than we need a default value, actual size of conainer if (container.height()==0) container.height(opt.startheight); if (opt.startwidth==undefined || opt.startwidth==0) opt.startwidth=container.width(); if (opt.startheight==undefined || opt.startheight==0) opt.startheight=container.height(); // opt width && height should be set opt.width=container.width(); opt.height=container.height(); // default dependecies opt.bw = opt.startwidth / container.width(); opt.bh = opt.startheight / container.height(); // if the item already in a resized form if (opt.width!=opt.startwidth) { opt.height = math.round(opt.startheight * (opt.width/opt.startwidth)); container.height(opt.height); } // lets see if there is any shadow if (opt.shadow!=0) { container.parent().append('
'); container.parent().find('.tp-bannershadow').css({'width':opt.width}); } // if images has been loaded container.waitforimages(function() { // prepare the slides prepareslides(container,opt); // create bullets if (opt.slideamount >1) createbullets(container,opt); if (opt.slideamount >1) createthumbs(container,opt); if (opt.slideamount >1) createarrows(container,opt); swipeaction(container,opt); if (opt.hidethumbs>0) hidethumbs(container,opt); container.waitforimages(function() { // start the first slide container.find('.tp-loader').fadeout(600); settimeout(function() { swapslide(container,opt); // start countdown if (opt.slideamount >1) countdown(container,opt); },600); }); }); // if resized, need to stop actual transition and resize actual images $(window).resize(function() { if (container.outerwidth(true)!=opt.width) { containerresized(container,opt); } }); }) }, // methode pause revpause: function(options) { return this.each(function() { var container=$(this); container.data('conthover',1); container.data('conthover-changed',1); container.trigger('revolution.slide.onpause'); var bt = container.parent().find('.tp-bannertimer'); bt.stop(); }) }, // methode resume revresume: function(options) { return this.each(function() { var container=$(this); container.data('conthover',0); container.data('conthover-changed',1); container.trigger('revolution.slide.onresume'); var bt = container.parent().find('.tp-bannertimer'); var opt = bt.data('opt'); bt.animate({'width':"100%"},{duration:((opt.delay-opt.cd)-100),queue:false, easing:"linear"}); }) }, // methode next revnext: function(options) { return this.each(function() { // catch the container var container=$(this); container.parent().find('.tp-rightarrow').click(); }) }, // methode resume revprev: function(options) { return this.each(function() { // catch the container var container=$(this); container.parent().find('.tp-leftarrow').click(); }) }, // methode length revmaxslide: function(options) { // catch the container return $(this).find('>ul:first-child >li').length; }, // methode jump to slide revshowslide: function(slide) { return this.each(function() { // catch the container var container=$(this); container.data('showus',slide); container.parent().find('.tp-rightarrow').click(); }) } }) ////////////////////////// // container resized // ///////////////////////// function containerresized(container,opt) { container.find('.defaultimg').each(function(i) { setsize($(this),opt); opt.height = math.round(opt.startheight * (opt.width/opt.startwidth)); container.height(opt.height); setsize($(this),opt); try{ container.parent().find('.tp-bannershadow').css({'width':opt.width}); } catch(e) {} var actsh = container.find('>ul >li:eq('+opt.act+') .slotholder'); var nextsh = container.find('>ul >li:eq('+opt.next+') .slotholder'); removeslots(container,opt); nextsh.find('.defaultimg').css({'opacity':0}); actsh.find('.defaultimg').css({'opacity':1}); setcaptionpositions(container,opt); var nextli = container.find('>ul >li:eq('+opt.next+')'); container.find('.tp-caption').each(function() { $(this).stop(true,true);}); animatethecaptions(nextli, opt); restartbannertimer(opt,container); }); } //////////////////////////////// // restart the banner timer // ////////////////////////////// function restartbannertimer(opt,container) { opt.cd=0; if (opt.videoplaying !=true) { var bt= container.find('.tp-bannertimer'); if (bt.length>0) { bt.stop(); bt.css({'width':'0%'}); bt.animate({'width':"100%"},{duration:(opt.delay-100),queue:false, easing:"linear"}); } cleartimeout(opt.thumbtimer); opt.thumbtimer = settimeout(function() { moveselectedthumb(container); setbulpos(container,opt); },200); } } function callingnewslide(opt,container) { opt.cd=0; swapslide(container,opt); // stop timer and rescale it var bt= container.find('.tp-bannertimer'); if (bt.length>0) { bt.stop(); bt.css({'width':'0%'}); bt.animate({'width':"100%"},{duration:(opt.delay-100),queue:false, easing:"linear"}); } } //////////////////////////////// // - create the bullets - // //////////////////////////////// function createthumbs(container,opt) { var cap=container.parent(); if (opt.navigationtype=="thumb" || opt.navsecond=="both") { cap.append('
'); } var bullets = cap.find('.tp-bullets.tp-thumbs .tp-mask .tp-thumbcontainer'); var bup = bullets.parent(); bup.width(opt.thumbwidth*opt.thumbamount); bup.height(opt.thumbheight); bup.parent().width(opt.thumbwidth*opt.thumbamount); bup.parent().height(opt.thumbheight); container.find('>ul:first >li').each(function(i) { var li= container.find(">ul:first >li:eq("+i+")"); if (li.data('thumb') !=undefined) var src= li.data('thumb') else var src=li.find("img:first").attr('src'); bullets.append('
'); var bullet= bullets.find('.bullet:first'); }); bullets.append('
'); var minwidth=1000; // add the bullet click function here bullets.find('.bullet').each(function(i) { var bul = $(this); if (i==opt.slideamount-1) bul.addclass('last'); if (i==0) bul.addclass('first'); bul.width(opt.thumbwidth); bul.height(opt.thumbheight); if (minwidth>bul.outerwidth(true)) minwidth=bul.outerwidth(true); bul.click(function() { if (opt.transition==0 && bul.index() != opt.act) { opt.next = bul.index(); callingnewslide(opt,container); } }); }); var max=minwidth*container.find('>ul:first >li').length; var thumbconwidth=bullets.parent().width(); opt.thumbwidth = minwidth; //////////////////////// // slide to position // //////////////////////// if (thumbconwidthul:first >li').length; var diff=(max- thumbconwidth)+15; var steps = diff / thumbconwidth; x=x-30; //if (x<30) x=0; //if (x>thumbconwidth-30) x=thumbconwidth; //animate to position var pos=(0-((x)*steps)); if (pos>0) pos =0; if (pos<0-max+thumbconwidth) pos=0-max+thumbconwidth; movethumbslidertoposition($this,pos,200); }); bullets.parent().mousemove(function() { var $this=$(this); //if (!$this.hasclass("over")) { var offset = $this.offset(); var x = $('body').data('mousex')-offset.left; var thumbconwidth=$this.width(); var minwidth=$this.find('.bullet:first').outerwidth(true); var max=minwidth*container.find('>ul:first >li').length; var diff=(max- thumbconwidth)+15; var steps = diff / thumbconwidth; x=x-30; //if (x<30) x=0; //if (x>thumbconwidth-30) x=thumbconwidth; //animate to position var pos=(0-((x)*steps)); if (pos>0) pos =0; if (pos<0-max+thumbconwidth) pos=0-max+thumbconwidth; movethumbslidertoposition($this,pos,0); //} else { //$this.removeclass("over"); //} }); bullets.parent().mouseleave(function() { var $this=$(this); $this.removeclass("over"); moveselectedthumb(container); }); } } /////////////////////////////// // selectedthumbinposition // ////////////////////////////// function moveselectedthumb(container) { var bullets=container.parent().find('.tp-bullets.tp-thumbs .tp-mask .tp-thumbcontainer'); var $this=bullets.parent(); var offset = $this.offset(); var minwidth=$this.find('.bullet:first').outerwidth(true); var x = $this.find('.bullet.selected').index() * minwidth; var thumbconwidth=$this.width(); var minwidth=$this.find('.bullet:first').outerwidth(true); var max=minwidth*container.find('>ul:first >li').length; var diff=(max- thumbconwidth); var steps = diff / thumbconwidth; //animate to position var pos=0-x; if (pos>0) pos =0; if (pos<0-max+thumbconwidth) pos=0-max+thumbconwidth; if (!$this.hasclass("over")) { movethumbslidertoposition($this,pos,200); } } //////////////////////////////////// // move thumb slider to position // /////////////////////////////////// function movethumbslidertoposition($this,pos,speed) { $this.stop(); $this.find('.tp-thumbcontainer').animate({'left':pos+'px'},{duration:speed,queue:false}); } //////////////////////////////// // - create the bullets - // //////////////////////////////// function createbullets(container,opt) { if (opt.navigationtype=="bullet" || opt.navigationtype=="both") { container.parent().append('
'); } var bullets = container.parent().find('.tp-bullets'); container.find('>ul:first >li').each(function(i) { var src=container.find(">ul:first >li:eq("+i+") img:first").attr('src'); bullets.append('
'); var bullet= bullets.find('.bullet:first'); }); // add the bullet click function here bullets.find('.bullet').each(function(i) { var bul = $(this); if (i==opt.slideamount-1) bul.addclass('last'); if (i==0) bul.addclass('first'); bul.click(function() { if (opt.transition==0 && bul.index() != opt.act) { opt.next = bul.index(); callingnewslide(opt,container); } }); }); bullets.append('
'); setbulpos(container,opt); $('#unvisible_button').click(function() { opt.navigationarrows=$('.selectnavarrows').val(); opt.navigationtype=$('.selectnavtype').val(); setbulpos(container,opt); settimeout(function() { setbulpos(container,opt); },100); }); } ////////////////////// // create arrows // ///////////////////// function createarrows(container,opt) { var bullets = container.find('.tp-bullets'); var hidden=""; if (opt.navigationarrow=="none") hidden="visibility:none"; container.parent().append('
'); container.parent().append('
'); // the left / right button click ! // container.parent().find('.tp-rightarrow').click(function() { if (opt.transition==0) { if (container.data('showus') !=undefined && container.data('showus') != -1) opt.next = container.data('showus')-1; else opt.next = opt.next+1; container.data('showus',-1); if (opt.next >= opt.slideamount) opt.next=0; if (opt.next<0) opt.next=0; if (opt.act !=opt.next) callingnewslide(opt,container); } }); container.parent().find('.tp-leftarrow').click(function() { if (opt.transition==0) { opt.next = opt.next-1; opt.leftarrowpressed=1; if (opt.next < 0) opt.next=opt.slideamount-1; callingnewslide(opt,container); } }); setbulpos(container,opt); } //////////////////////////// // set the swipe function // //////////////////////////// function swipeaction(container,opt) { // touch enabled scroll if (opt.touchenabled=="on") container.swipe( {data:container, swiperight:function() { if (opt.transition==0) { opt.next = opt.next-1; opt.leftarrowpressed=1; if (opt.next < 0) opt.next=opt.slideamount-1; callingnewslide(opt,container); } }, swipeleft:function() { if (opt.transition==0) { opt.next = opt.next+1; if (opt.next == opt.slideamount) opt.next=0; callingnewslide(opt,container); } }, allowpagescroll:"auto"} ); } //////////////////////////////////////////////////////////////// // show and hide the thumbs if moue goes out of the banner /// ////////////////////////////////////////////////////////////// function hidethumbs(container,opt) { var bullets = container.parent().find('.tp-bullets'); var ca = container.parent().find('.tparrows'); if (bullets==null) { container.append('
'); var bullets = container.parent().find('.tp-bullets'); } if (ca==null) { container.append('
'); var ca = container.parent().find('.tparrows'); } //var bp = (thumbs.parent().outerheight(true) - opt.height)/2; // add thumbnail images for the bullets // container.data('hidethumbs',opt.hidethumbs); if (opt.ie) { bullets.css({'visibility':'hidden'}); ca.css({'visibility':'hidden'}); } else { try { bullets.css({'opacity':0}); } catch(e) {} try { ca.css({'opacity':0}); } catch(e) {} } bullets.hover(function() { bullets.addclass("hovered"); cleartimeout(container.data('hidethumbs')); bullets.animate({'opacity':1},{duration:200,queue:false}); ca.animate({'opacity':1},{duration:200,queue:false}); }, function() { bullets.removeclass("hovered"); if (!container.hasclass("hovered") && !bullets.hasclass("hovered")) container.data('hidethumbs', settimeout(function() { if (opt.ie) { bullets.css({'visibility':'hidden'}); ca.css({'visibility':'hidden'}); } else { bullets.animate({'opacity':0},{duration:200,queue:false}); ca.animate({'opacity':0},{duration:200,queue:false}); } },opt.hidethumbs)); }); ca.hover(function() { bullets.addclass("hovered"); cleartimeout(container.data('hidethumbs')); if (opt.ie) { bullets.css({'visibility':'visible'}); ca.css({'visibility':'visible'}); } else { bullets.animate({'opacity':1},{duration:200,queue:false}); ca.animate({'opacity':1},{duration:200,queue:false}); } }, function() { bullets.removeclass("hovered"); if (!container.hasclass("hovered") && !bullets.hasclass("hovered")) container.data('hidethumbs', settimeout(function() { if (opt.ie) { bullets.css({'visibility':'hidden'}); ca.css({'visibility':'hidden'}); } else { bullets.animate({'opacity':0},{duration:200,queue:false}); ca.animate({'opacity':0},{duration:200,queue:false}); } },opt.hidethumbs)); }); container.live('mouseenter', function() { container.addclass("hovered"); cleartimeout(container.data('hidethumbs')); if (opt.ie) { bullets.css({'visibility':'visible'}); ca.css({'visibility':'visible'}); } else { bullets.animate({'opacity':1},{duration:200,queue:false}); ca.animate({'opacity':1},{duration:200,queue:false}); } }); container.live('mouseleave', function() { container.removeclass("hovered"); if (!container.hasclass("hovered") && !bullets.hasclass("hovered")) container.data('hidethumbs', settimeout(function() { if (opt.ie) { bullets.css({'visibility':'hidden'}); ca.css({'visibility':'hidden'}); } else { bullets.animate({'opacity':0},{duration:200,queue:false}); ca.animate({'opacity':0},{duration:200,queue:false}); } },opt.hidethumbs)); }); } ////////////////////////////// // set position of bullets // ////////////////////////////// function setbulpos(container,opt) { /* for the preview we need to handle if both navigation is loaded */ if (opt.navigationtype=="both") { opt.navigationtype="bullet"; opt.navsecond = "both"; } if (opt.navigationtype=="none" && opt.navigationarrows!="none") opt.navigationarrows="verticalcentered"; opt.navoh = opt.navoffsethorizontal * opt.bw; opt.navov = opt.navoffsetvertical * opt.bh; if (opt.bw!=1) opt.navoh=0; // some help var cap=container.parent(); var la=cap.find('.tp-leftarrow'); var ra=cap.find('.tp-rightarrow'); ////////////////////////////////////// // the bullet navigation positions // ///////////////////////////////////// if (opt.navigationtype=="bullet") { var bullets = cap.find('.tp-bullets.simplebullets'); var navb = cap.find('.tp-bullets.simplebullets.navbar') bullets.css({'visibility':'visible'}); try{ cap.find('.tp-thumbs').css({'visibility':'hidden'}); if (opt.ie) cap.find('.tp-thumbs').remove(); } catch(e) {} var fulllong=bullets.width(); if (!bullets.hasclass("tp-thumbs")) { fulllong=0; bullets.find('.bullet').each(function() { fulllong = fulllong + $(this).outerwidth(true);}); bullets.css({'width':(fulllong)+"px"}); } var ldiff = cap.outerwidth()- opt.width; bullets.css({'left':(opt.navoh) + (ldiff/2)+(opt.width/2 - fulllong/2)+"px", 'bottom':opt.navov+"px"}); if (opt.navigationarrows=="nexttobullets") { la.removeclass("large"); ra.removeclass("large"); la.removeclass("thumbswitharrow"); ra.removeclass("thumbswitharrow"); la.css({'visibility':'visible'}); ra.css({'visibility':'visible'}); var diff = 0; la.css({'position':'absolute','left': (bullets.position().left - la.outerwidth(true))+"px", 'top': bullets.position().top+"px"}); ra.css({'position':'absolute','left': (bullets.outerwidth(true) + bullets.position().left)+"px", 'top':bullets.position().top+"px"}); try { navb.css({'paddingleft':'40px', 'paddingright':'40px','margin-left':'-40px'}); } catch(e) {} } else { if (opt.navigationarrows=="verticalcentered") { la.addclass("large"); ra.addclass("large"); la.css({'visibility':'visible'}); ra.css({'visibility':'visible'}); var decorh=cap.outerheight(); la.css({'position':'absolute','left': math.round((ldiff/2))+"px",'top': math.round((decorh/2))+"px"}); ra.css({'position':'absolute','left': math.round((opt.width - ra.outerwidth()+ldiff/2))+"px",'top': math.round((decorh/2))+"px"}); try { navb.css({'paddingleft':'10px', 'paddingright':'10px','margin-left':'-10px'}); } catch(e) {} } else { la.css({'visibility':'hidden'}); ra.css({'visibility':'hidden'}); try { navb.css({'paddingleft':'10px', 'paddingright':'10px','margin-left':'-10px'}); } catch(e) {} } } } else { ////////////////////////////////////// // the thumbs navigation positions // ///////////////////////////////////// if (opt.navigationtype=="thumb") { var thumbs=cap.find('.tp-thumbs'); try{ cap.find('.tp-bullets').css({'visibility':'hidden'}); } catch(e) {} thumbs.css({'visibility':'visible'}); var decorh=thumbs.parent().outerheight(); var ldiff = cap.outerwidth()- opt.width; thumbs.css({'left':(opt.navoh) + (opt.width/2 - thumbs.width()/2)+"px"}); thumbs.css({'bottom':(0-thumbs.outerheight(true) + (opt.navov))+"px"}); if (opt.navigationarrows=="verticalcentered") { la.css({'visibility':'visible'}); ra.css({'visibility':'visible'}); la.addclass("large"); ra.addclass("large"); la.css({'position':'absolute','left': math.round((ldiff/2))+"px",'top': math.round((cap.outerheight()/2 ))+"px"}); ra.css({'position':'absolute','left': math.round((opt.width - ra.outerwidth()+ldiff/2))+"px",'top': math.round((cap.outerheight()/2))+"px"}); } else { la.css({'visibility':'hidden'}); ra.css({'visibility':'hidden'}); } } else { if (opt.navigationtype=="none") { try{ cap.find('.tp-bullets').css({'visibility':'hidden'}); } catch(e) {} try{ cap.find('.tp-thumbs').css({'visibility':'hidden'});} catch(e) {} if (opt.navigationarrows!="none") { var ldiff = cap.outerwidth()- opt.width; la.css({'visibility':'visible'}); ra.css({'visibility':'visible'}); la.addclass("large"); ra.addclass("large"); la.css({'position':'absolute','left': math.round((ldiff/2))+"px",'top': math.round((cap.outerheight()/2))+"px"}); ra.css({'position':'absolute','left': math.round((opt.width - ra.outerwidth()+ldiff/2))+"px",'top': math.round((cap.outerheight()/2))+"px"}); } else { la.css({'visibility':'hidden'}); ra.css({'visibility':'hidden'}); } } } } } ////////////////////////////////////////////////////////// // - set the image size to fit into the contianer - // //////////////////////////////////////////////////////// function setsize(img,opt) { opt.width=parseint(opt.container.width(),0); opt.height=parseint(opt.container.height(),0); opt.bw = opt.width / opt.startwidth; opt.bh = opt.height / opt.startheight; if (opt.bh>1) { opt.bw=1; opt.bh=1; } // if img is already prepared, we reset the size first here if (img.data('orgw')!=undefined) { img.width(img.data('orgw')); img.height(img.data('orgh')); } var fw = opt.width / img.width(); var fh = opt.height / img.height(); opt.fw = fw; opt.fh = fh; if (img.data('orgw')==undefined) { img.data('orgw',img.width()); img.data('orgh',img.height()); } if (opt.fullwidth=="on") { var cow = opt.container.parent().width(); var coh = opt.container.parent().height(); var ffh = coh / img.data('orgh'); var ffw = cow / img.data('orgw'); img.width(img.width()*ffh); img.height(coh); if (img.width()cow) { img.data("fxof",(cow/2 - img.width()/2)); img.css({'position':'absolute','left':img.data('fxof')+"px"}); } if (img.height()<=coh) { img.data('fyof',0); img.css({'position':'absolute','top':img.data('fyof')+"px"}); } if (img.height()>coh && img.data('fullwidthcentering')=="on") { img.data('fyof',(coh/2 - img.height()/2)); img.css({'position':'absolute','top':img.data('fyof')+"px"}); } } else { img.width(opt.width); img.height(img.height()*fw); if (img.height()ul:first >li').each(function(j) { var li=$(this); if (li.data('link')!=undefined) { var link = li.data('link'); var target="_self"; var linktoslide=li.data('linktoslide'); if (li.data('target')!=undefined) target=li.data('target'); if (link=="slide") { li.append(''); } else { linktoslide="no"; li.append(''); } } }); container.find('>ul:first >li >img').each(function(j) { var img=$(this); img.addclass('defaultimg'); setsize(img,opt); setsize(img,opt); img.wrap('
'); img.css({'opacity':0}); img.data('li-id',j); }); } /////////////////////// // prepare the slide // ////////////////////// function prepareoneslide(slotholder,opt,visible) { var sh=slotholder; var img = sh.find('img') setsize(img,opt) var src = img.attr('src'); var w = img.data('neww'); var h = img.data('newh'); var fulloff = img.data("fxof"); if (fulloff==undefined) fulloff=0; var fullyoff=img.data("fyof"); if (img.data('fullwidthcentering')!="on" || fullyoff==undefined) fullyoff=0; var off=0; if (!visible) var off=0-opt.slotw; for (var i=0;i
'); } /////////////////////// // prepare the slide // ////////////////////// function prepareoneslidev(slotholder,opt,visible) { var sh=slotholder; var img = sh.find('img') setsize(img,opt) var src = img.attr('src'); var w = img.data('neww'); var h = img.data('newh'); var fulloff = img.data("fxof"); if (fulloff==undefined) fulloff=0; var fullyoff=img.data("fyof"); if (img.data('fullwidthcentering')!="on" || fullyoff==undefined) fullyoff=0; var off=0; if (!visible) var off=0-opt.sloth; for (var i=0;i
'); } /////////////////////// // prepare the slide // ////////////////////// function prepareoneslidebox(slotholder,opt,visible) { var sh=slotholder; var img = sh.find('img') setsize(img,opt) var src = img.attr('src'); var w = img.data('neww'); var h = img.data('newh'); var fulloff = img.data("fxof"); if (fulloff==undefined) fulloff=0; var fullyoff=img.data("fyof"); if (img.data('fullwidthcentering')!="on" || fullyoff==undefined) fullyoff=0; var off=0; // set the minimal size of a box var basicsize = 0; if (opt.sloth>opt.slotw) basicsize=opt.sloth else basicsize=opt.slotw; if (!visible) { var off=0-basicsize; } opt.slotw = basicsize; opt.sloth = basicsize; var x=0; var y=0; for (var j=0;j'+ '
'+ '
'); y=y+basicsize; } x=x+basicsize; } } /////////////////////// // remove slots // ///////////////////// function removeslots(container,opt,time) { if (time==undefined) time==80 settimeout(function() { container.find('.slotholder .slot').each(function() { cleartimeout($(this).data('tout')); $(this).remove(); }); opt.transition = 0; },time); } //////////////////////// // caption position // /////////////////////// function setcaptionpositions(container,opt) { // find the right captions var actli = container.find('>li:eq('+opt.act+')'); var nextli = container.find('>li:eq('+opt.next+')'); // set the next caption and remove the last caption var nextcaption=nextli.find('.tp-caption'); if (nextcaption.find('iframe')==0) { // move the captions to the right position if (nextcaption.hasclass('hcenter')) nextcaption.css({'height':opt.height+"px",'top':'0px','left':(opt.width/2 - nextcaption.outerwidth()/2)+'px'}); else if (nextcaption.hasclass('vcenter')) nextcaption.css({'width':opt.width+"px",'left':'0px','top':(opt.height/2 - nextcaption.outerheight()/2)+'px'}); } } ////////////////////////////// // // // - swap the slides - // // // //////////////////////////// function swapslide(container,opt) { opt.transition = 1; opt.videoplaying = false; try{ var actli = container.find('>ul:first-child >li:eq('+opt.act+')'); } catch(e) { var actli=container.find('>ul:first-child >li:eq(1)'); } var nextli = container.find('>ul:first-child >li:eq('+opt.next+')'); var actsh = actli.find('.slotholder'); var nextsh = nextli.find('.slotholder'); actli.css({'visibility':'visible'}); nextli.css({'visibility':'visible'}); if (opt.ie) { if (nextli.data('transition')=="boxfade") nextli.data('transition',"boxslide"); if (nextli.data('transition')=="slotfade-vertical") nextli.data('transition',"slotzoom-vertical"); if (nextli.data('transition')=="slotfade-horizontal") nextli.data('transition',"slotzoom-horizontal"); } // if delay has been set via the slide, we take the new value, other way the old one... if (nextli.data('delay')!=undefined) { opt.cd=0; opt.delay=nextli.data('delay'); } else { opt.delay=opt.origcd; } // reset position and fades of li's actli.css({'left':'0px','top':'0px'}); nextli.css({'left':'0px','top':'0px'}); /////////////////////////////////////// // transition choose - random effects// /////////////////////////////////////// var nexttrans = 0; if (nextli.data('transition')=="boxslide") nexttrans = 0 else if (nextli.data('transition')=="boxfade") nexttrans = 1 else if (nextli.data('transition')=="slotslide-horizontal") nexttrans = 2 else if (nextli.data('transition')=="slotslide-vertical") nexttrans = 3 else if (nextli.data('transition')=="curtain-1") nexttrans = 4 else if (nextli.data('transition')=="curtain-2") nexttrans = 5 else if (nextli.data('transition')=="curtain-3") nexttrans = 6 else if (nextli.data('transition')=="slotzoom-horizontal") nexttrans = 7 else if (nextli.data('transition')=="slotzoom-vertical") nexttrans = 8 else if (nextli.data('transition')=="slotfade-horizontal") nexttrans = 9 else if (nextli.data('transition')=="slotfade-vertical") nexttrans = 10 else if (nextli.data('transition')=="fade") nexttrans = 11 else if (nextli.data('transition')=="slideleft") nexttrans = 12 else if (nextli.data('transition')=="slideup") nexttrans = 13 else if (nextli.data('transition')=="slidedown") nexttrans = 14 else if (nextli.data('transition')=="slideright") nexttrans = 15; else if (nextli.data('transition')=="papercut") nexttrans = 16; else if (nextli.data('transition')=="3dcurtain-horizontal") nexttrans = 17; else if (nextli.data('transition')=="3dcurtain-vertical") nexttrans = 18; else if (nextli.data('transition')=="cubic") nexttrans = 19; else if (nextli.data('transition')=="flyin") nexttrans = 20; else if (nextli.data('transition')=="turnoff") nexttrans = 21; else { nexttrans=math.round(math.random()*21); nextli.data('slotamount',math.round(math.random()*12+4)); } if (nextli.data('transition')=="random-static") { nexttrans=math.round(math.random()*16); if (nexttrans>15) nexttrans=15; if (nexttrans<0) nexttrans=0; } if (nextli.data('transition')=="random-premium") { nexttrans=math.round(math.random()*6+16); if (nexttrans>21) nexttrans=21; if (nexttrans<16) nexttrans=16; } var direction=-1; if (opt.leftarrowpressed==1 || opt.act>opt.next) direction=1; if (nextli.data('transition')=="slidehorizontal") { nexttrans = 12 if (opt.leftarrowpressed==1) nexttrans = 15 } if (nextli.data('transition')=="slidevertical") { nexttrans = 13 if (opt.leftarrowpressed==1) nexttrans = 14 } opt.leftarrowpressed=0; if (nexttrans>21) nexttrans = 21; if (nexttrans<0) nexttrans = 0; if (!$.support.transition && nexttrans >16) { nexttrans=math.round(math.random()*16); nextli.data('slotamount',math.round(math.random()*12+4)); }; if (opt.ie && (nexttrans==17 || nexttrans==16 || nexttrans==2 || nexttrans==3 || nexttrans==9 || nexttrans==10 )) nexttrans=math.round(math.random()*3+12); if (opt.ie9 && (nexttrans==3)) nexttrans = 4; //$('body').find('.debug').html("transition:"+nextli.data('transition')+" id:"+nexttrans); // define the masterspeed for the slide // var masterspeed=300; if (nextli.data('masterspeed')!=undefined && nextli.data('masterspeed')>99 && nextli.data('masterspeed')<4001) masterspeed = nextli.data('masterspeed'); ///////////////////////////////////////////// // set the bullets selected or unselected // ///////////////////////////////////////////// container.parent().find(".bullet").each(function() { var bul = $(this); bul.removeclass("selected"); if (bul.index() == opt.next) bul.addclass('selected'); }); ////////////////////////////////////////////////////////////////// // set the next caption and remove the last caption // ////////////////////////////////////////////////////////////////// container.find('>li').each(function() { var li = $(this); if (li.index!=opt.act && li.index!=opt.next) li.css({'z-index':16}); }); actli.css({'z-index':18}); nextli.css({'z-index':20}); nextli.css({'opacity':0}); /////////////////////////// // animate the captions // /////////////////////////// removethecaptions(actli,opt); animatethecaptions(nextli, opt); ///////////////////////////////////////////// // set the actual amount of slides !! // // set a random amount of slots // /////////////////////////////////////////// if (nextli.data('slotamount')==undefined || nextli.data('slotamount')<1) { opt.slots=math.round(math.random()*12+4); if (nextli.data('transition')=="boxslide") opt.slots=math.round(math.random()*6+3); } else { opt.slots=nextli.data('slotamount'); } ///////////////////////////////////////////// // set the actual amount of slides !! // // set a random amount of slots // /////////////////////////////////////////// if (nextli.data('rotate')==undefined) opt.rotate = 0 else if (nextli.data('rotate')==999) opt.rotate=math.round(math.random()*360); else opt.rotate=nextli.data('rotate'); if (!$.support.transition || opt.ie || opt.ie9) opt.rotate=0; ////////////////////////////// // first start // ////////////////////////////// if (opt.firststart==1) { actli.css({'opacity':0}); opt.firststart=0; } ///////////////////////////////////// // the slotslide - transition i. // //////////////////////////////////// if (nexttrans==0) { // boxslide masterspeed = masterspeed + 100; if (opt.slots>10) opt.slots=10; nextli.css({'opacity':1}); // prepare the slots here prepareoneslidebox(actsh,opt,true); prepareoneslidebox(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 (opt.ie9) ss.transition({top:(0-opt.sloth),left:(0-opt.slotw)},0); else ss.transition({top:(0-opt.sloth),left:(0-opt.slotw), rotate:opt.rotate},0); settimeout(function() { ss.transition({top:0, left:0, scale:1, rotate:0},masterspeed*1.5,function() { if (j==(opt.slots*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*15); }); } ///////////////////////////////////// // the slotslide - transition i. // //////////////////////////////////// if (nexttrans==1) { if (opt.slots>5) opt.slots=5; nextli.css({'opacity':1}); // prepare the slots here //prepareoneslidebox(actsh,opt,true); prepareoneslidebox(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.css({'opacity':0}); ss.find('img').css({'opacity':0}); if (opt.ie9) ss.find('img').transition({'top':(math.random()*opt.slotw-opt.slotw)+"px",'left':(math.random()*opt.slotw-opt.slotw)+"px"},0); else ss.find('img').transition({'top':(math.random()*opt.slotw-opt.slotw)+"px",'left':(math.random()*opt.slotw-opt.slotw)+"px", rotate:opt.rotate},0); var rand=math.random()*1000+(masterspeed + 200); if (j==(opt.slots*opt.slots)-1) rand=1500; ss.find('img').transition({'opacity':1,'top':(0-ss.data('y'))+"px",'left':(0-ss.data('x'))+'px', rotate:0},rand); ss.transition({'opacity':1},rand,function() { if (j==(opt.slots*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); } }); }); } ///////////////////////////////////// // the slotslide - transition i. // //////////////////////////////////// if (nexttrans==2) { masterspeed = masterspeed + 200; 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 old slots should be slided to the right actsh.find('.slotslide').each(function() { var ss=$(this); //ss.animate({'left':opt.slotw+'px'},{duration:masterspeed,queue:false,complete:function() { ss.transit({'left':opt.slotw+'px',rotate:(0-opt.rotate)},masterspeed,function() { 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); }); }); // all new slots should be slided from the left to the right nextsh.find('.slotslide').each(function() { var ss=$(this); if (opt.ie9) ss.transit({'left':(0-opt.slotw)+"px"},0); else ss.transit({'left':(0-opt.slotw)+"px",rotate:opt.rotate},0); ss.transit({'left':'0px',rotate:0},masterspeed,function() { removeslots(container,opt); nextsh.find('.defaultimg').css({'opacity':1}); if (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0}); if (opt.ie) actsh.find('.defaultimg').css({'opacity':1}); opt.act=opt.next; moveselectedthumb(container); }); }); } ///////////////////////////////////// // the slotslide - transition i. // //////////////////////////////////// if (nexttrans==3) { masterspeed = masterspeed + 200; 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 old slots should be slided to the right actsh.find('.slotslide').each(function() { var ss=$(this); ss.transit({'top':opt.sloth+'px',rotate:opt.rotate},masterspeed,function() { 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); }); }); // all new slots should be slided from the left to the right nextsh.find('.slotslide').each(function() { var ss=$(this); if (opt.ie9) ss.transit({'top':(0-opt.sloth)+"px"},0); else ss.transit({'top':(0-opt.sloth)+"px",rotate:opt.rotate},0); ss.transit({'top':'0px',rotate:0},masterspeed,function() { 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); }); }); } ///////////////////////////////////// // the slotslide - transition i. // //////////////////////////////////// if (nexttrans==4) { nextli.css({'opacity':1}); // prepare the slots here prepareoneslide(actsh,opt,true); prepareoneslide(nextsh,opt,true); //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 actsh.find('.slotslide').each(function(i) { var ss=$(this); ss.transit({'top':(0+(opt.height))+"px",'opacity':1,rotate:opt.rotate},masterspeed+(i*(70-opt.slots))); }); // all new slots should be slided from the left to the right nextsh.find('.slotslide').each(function(i) { var ss=$(this); if (opt.ie9) ss.transition({'top':(0-(opt.height))+"px",'opacity':0},0); else ss.transition({'top':(0-(opt.height))+"px",'opacity':0,rotate:opt.rotate},0); ss.transition({'top':'0px','opacity':1,rotate:0},masterspeed+(i*(70-opt.slots)),function() { if (i==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); } }); }); } ///////////////////////////////////// // the slotslide - transition i. // //////////////////////////////////// if (nexttrans==5) { nextli.css({'opacity':1}); // prepare the slots here prepareoneslide(actsh,opt,true); prepareoneslide(nextsh,opt,true); //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 actsh.find('.slotslide').each(function(i) { var ss=$(this); ss.transition({'top':(0+(opt.height))+"px",'opacity':1,rotate:opt.rotate},masterspeed+((opt.slots-i)*(70-opt.slots))); }); // all new slots should be slided from the left to the right nextsh.find('.slotslide').each(function(i) { var ss=$(this); if (opt.ie9) ss.transition({'top':(0-(opt.height))+"px",'opacity':0},0); else ss.transition({'top':(0-(opt.height))+"px",'opacity':0,rotate:opt.rotate},0); ss.transition({'top':'0px','opacity':1,rotate:0},masterspeed+((opt.slots-i)*(70-opt.slots)),function() { if (i==0) { 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); } }); }); } ///////////////////////////////////// // the slotslide - transition i. // //////////////////////////////////// if (nexttrans==6) { nextli.css({'opacity':1}); if (opt.slots<2) opt.slots=2; // prepare the slots here prepareoneslide(actsh,opt,true); prepareoneslide(nextsh,opt,true); //set default img unvisible nextsh.find('.defaultimg').css({'opacity':0}); actsh.find('.defaultimg').css({'opacity':0}); actsh.find('.slotslide').each(function(i) { var ss=$(this); if (i'); 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);