5055 lines
168 KiB
JavaScript
5055 lines
168 KiB
JavaScript
|
|
||
|
|
||
|
/**************************************************************************
|
||
|
* jquery.themepunch.revolution.js - jQuery Plugin for Revolution Slider
|
||
|
* @version: 4.2.2 (28.02.2013)
|
||
|
* @requires jQuery v1.7 or later (tested on 1.9)
|
||
|
* @author ThemePunch
|
||
|
**************************************************************************/
|
||
|
|
||
|
(function(jQuery,undefined){
|
||
|
|
||
|
|
||
|
////////////////////////////////////////
|
||
|
// THE REVOLUTION PLUGIN STARTS HERE //
|
||
|
///////////////////////////////////////
|
||
|
|
||
|
jQuery.fn.extend({
|
||
|
|
||
|
// OUR PLUGIN HERE :)
|
||
|
revolution: function(options) {
|
||
|
|
||
|
|
||
|
|
||
|
////////////////////////////////
|
||
|
// SET DEFAULT VALUES OF ITEM //
|
||
|
////////////////////////////////
|
||
|
jQuery.fn.revolution.defaults = {
|
||
|
delay:9000,
|
||
|
startheight:500,
|
||
|
startwidth:960,
|
||
|
fullScreenAlignForce:"off",
|
||
|
autoHeight:"off",
|
||
|
|
||
|
hideThumbs:200,
|
||
|
|
||
|
thumbWidth:100, // Thumb With and Height and Amount (only if navigation Tyope set to thumb !)
|
||
|
thumbHeight:50,
|
||
|
thumbAmount:3,
|
||
|
|
||
|
navigationType:"bullet", // bullet, thumb, none
|
||
|
navigationArrows:"solo", // nextto, solo, none
|
||
|
|
||
|
hideThumbsOnMobile:"off",
|
||
|
hideBulletsOnMobile:"off",
|
||
|
hideArrowsOnMobile:"off",
|
||
|
hideThumbsUnderResoluition:0,
|
||
|
|
||
|
navigationStyle:"round", // round,square,navbar,round-old,square-old,navbar-old, or any from the list in the docu (choose between 50+ different item),
|
||
|
|
||
|
navigationHAlign:"center", // Vertical Align top,center,bottom
|
||
|
navigationVAlign:"bottom", // Horizontal Align left,center,right
|
||
|
navigationHOffset:0,
|
||
|
navigationVOffset:20,
|
||
|
|
||
|
soloArrowLeftHalign:"left",
|
||
|
soloArrowLeftValign:"center",
|
||
|
soloArrowLeftHOffset:20,
|
||
|
soloArrowLeftVOffset:0,
|
||
|
|
||
|
soloArrowRightHalign:"right",
|
||
|
soloArrowRightValign:"center",
|
||
|
soloArrowRightHOffset:20,
|
||
|
soloArrowRightVOffset:0,
|
||
|
|
||
|
keyboardNavigation:"on",
|
||
|
|
||
|
touchenabled:"on", // Enable Swipe Function : on/off
|
||
|
onHoverStop:"on", // Stop Banner Timet at Hover on Slide on/off
|
||
|
|
||
|
|
||
|
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)
|
||
|
hideAllCaptionAtLimit: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:0, //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
|
||
|
fullScreen:"off",
|
||
|
minFullScreenHeight:0, // The Minimum FullScreen Height
|
||
|
fullScreenOffsetContainer:"",
|
||
|
dottedOverlay:"none", //twoxtwo, threexthree, twoxtwowhite, threexthreewhite
|
||
|
|
||
|
forceFullWidth:"off", // Force The FullWidth
|
||
|
|
||
|
spinner:"spinner0"
|
||
|
|
||
|
|
||
|
};
|
||
|
|
||
|
options = jQuery.extend({}, jQuery.fn.revolution.defaults, options);
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
return this.each(function() {
|
||
|
|
||
|
var opt=options;
|
||
|
|
||
|
if (opt.fullWidth!="on" && opt.fullScreen!="on") opt.autoHeight = "off";
|
||
|
if (opt.fullScreen=="on") opt.autoHeight = "on";
|
||
|
if (opt.fullWidth!="on" && opt.fullScreen!="on") forceFulWidth="off";
|
||
|
|
||
|
var container=jQuery(this);
|
||
|
|
||
|
if (opt.fullWidth=="on" && opt.autoHeight=="off")
|
||
|
container.css({maxHeight:opt.startheight+"px"});
|
||
|
|
||
|
if (is_mobile() && opt.hideThumbsOnMobile=="on" && opt.navigationType=="thumb")
|
||
|
opt.navigationType = "none"
|
||
|
|
||
|
if (is_mobile() && opt.hideBulletsOnMobile=="on" && opt.navigationType=="bullet")
|
||
|
opt.navigationType = "none"
|
||
|
|
||
|
if (is_mobile() && opt.hideBulletsOnMobile=="on" && opt.navigationType=="both")
|
||
|
opt.navigationType = "none"
|
||
|
|
||
|
if (is_mobile() && opt.hideArrowsOnMobile=="on")
|
||
|
opt.navigationArrows = "none"
|
||
|
|
||
|
if (opt.forceFullWidth=="on") {
|
||
|
|
||
|
var loff = container.parent().offset().left;
|
||
|
var mb = container.parent().css('marginBottom');
|
||
|
var mt = container.parent().css('marginTop');
|
||
|
if (mb==undefined) mb=0;
|
||
|
if (mt==undefined) mt=0;
|
||
|
|
||
|
container.parent().wrap('<div style="position:relative;width:100%;height:auto;margin-top:'+mt+';margin-bottom:'+mb+'" class="forcefullwidth_wrapper_tp_banner"></div>');
|
||
|
container.closest('.forcefullwidth_wrapper_tp_banner').append('<div class="tp-fullwidth-forcer" style="width:100%;height:'+container.height()+'px"></div>');
|
||
|
container.css({'backgroundColor':container.parent().css('backgroundColor'),'backgroundImage':container.parent().css('backgroundImage')});
|
||
|
//container.parent().css({'position':'absolute','width':jQuery(window).width()});
|
||
|
container.parent().css({'left':(0-loff)+"px",position:'absolute','width':jQuery(window).width()});
|
||
|
opt.width=jQuery(window).width();
|
||
|
}
|
||
|
|
||
|
// HIDE THUMBS UNDER RESOLUTION
|
||
|
try{
|
||
|
if (opt.hideThumbsUnderResolution>jQuery(window).width() && opt.hideThumbsUnderResolution!=0) {
|
||
|
container.parent().find('.tp-bullets.tp-thumbs').css({display:"none"});
|
||
|
} else {
|
||
|
container.parent().find('.tp-bullets.tp-thumbs').css({display:"block"});
|
||
|
}
|
||
|
} catch(e) {}
|
||
|
|
||
|
if (!container.hasClass("revslider-initialised")) {
|
||
|
|
||
|
container.addClass("revslider-initialised");
|
||
|
if (container.attr('id')==undefined) container.attr('id',"revslider-"+Math.round(Math.random()*1000+5));
|
||
|
|
||
|
// CHECK IF FIREFOX 13 IS ON WAY.. IT HAS A STRANGE BUG, CSS ANIMATE SHOULD NOT BE USED
|
||
|
|
||
|
|
||
|
|
||
|
opt.firefox13 = false;
|
||
|
opt.ie = !jQuery.support.opacity;
|
||
|
opt.ie9 = (document.documentMode == 9);
|
||
|
|
||
|
|
||
|
// CHECK THE jQUERY VERSION
|
||
|
var version = jQuery.fn.jquery.split('.'),
|
||
|
versionTop = parseFloat(version[0]),
|
||
|
versionMinor = parseFloat(version[1]),
|
||
|
versionIncrement = parseFloat(version[2] || '0');
|
||
|
|
||
|
if (versionTop==1 && versionMinor < 7) {
|
||
|
container.html('<div style="text-align:center; padding:40px 0px; font-size:20px; color:#992222;"> The Current Version of jQuery:'+version+' <br>Please update your jQuery Version to min. 1.7 in Case you wish to use the Revolution Slider Plugin</div>');
|
||
|
}
|
||
|
|
||
|
if (versionTop>1) opt.ie=false;
|
||
|
|
||
|
|
||
|
// Delegate .transition() calls to .animate()
|
||
|
// if the browser can't do CSS transitions.
|
||
|
if (!jQuery.support.transition)
|
||
|
jQuery.fn.transition = jQuery.fn.animate;
|
||
|
|
||
|
// CATCH THE CONTAINER
|
||
|
|
||
|
|
||
|
// LOAD THE YOUTUBE API IF NECESSARY
|
||
|
|
||
|
container.find('.caption').each(function() { jQuery(this).addClass('tp-caption')});
|
||
|
|
||
|
if (is_mobile()) {
|
||
|
container.find('.tp-caption').each(function() {
|
||
|
if (jQuery(this).data('autoplay')==true)
|
||
|
jQuery(this).data('autoplay',false);
|
||
|
// && jQuery(this).data('forcecover')!=1)
|
||
|
})
|
||
|
}
|
||
|
|
||
|
|
||
|
var addedyt=0;
|
||
|
var addedvim=0;
|
||
|
var addedvid=0;
|
||
|
var httpprefix = "http";
|
||
|
|
||
|
if (location.protocol === 'https:') {
|
||
|
httpprefix = "https";
|
||
|
}
|
||
|
container.find('.tp-caption iframe').each(function(i) {
|
||
|
try {
|
||
|
|
||
|
if (jQuery(this).attr('src').indexOf('you')>0 && addedyt==0) {
|
||
|
addedyt=1;
|
||
|
var s = document.createElement("script");
|
||
|
var httpprefix2 = "https";
|
||
|
s.src = httpprefix2+"://www.youtube.com/iframe_api"; /* Load Player API*/
|
||
|
|
||
|
var before = document.getElementsByTagName("script")[0];
|
||
|
var loadit = true;
|
||
|
jQuery('head').find('*').each(function(){
|
||
|
if (jQuery(this).attr('src') == httpprefix2+"://www.youtube.com/iframe_api")
|
||
|
loadit = false;
|
||
|
});
|
||
|
if (loadit) {
|
||
|
before.parentNode.insertBefore(s, before);
|
||
|
/*var tag = document.createElement('script');
|
||
|
tag.src = httpprefix+"://www.youtube.com/iframe_api";
|
||
|
var firstScriptTag = document.getElementsByTagName('script')[0];
|
||
|
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
|
||
|
*/
|
||
|
|
||
|
}
|
||
|
}
|
||
|
} catch(e) {}
|
||
|
});
|
||
|
|
||
|
|
||
|
|
||
|
// LOAD THE VIMEO API
|
||
|
container.find('.tp-caption iframe').each(function(i) {
|
||
|
try{
|
||
|
if (jQuery(this).attr('src').indexOf('vim')>0 && addedvim==0) {
|
||
|
addedvim=1;
|
||
|
var f = document.createElement("script");
|
||
|
f.src = httpprefix+"://a.vimeocdn.com/js/froogaloop2.min.js"; /* Load Player API*/
|
||
|
var before = document.getElementsByTagName("script")[0];
|
||
|
|
||
|
var loadit = true;
|
||
|
jQuery('head').find('*').each(function(){
|
||
|
if (jQuery(this).attr('src') == httpprefix+"://a.vimeocdn.com/js/froogaloop2.min.js")
|
||
|
loadit = false;
|
||
|
});
|
||
|
if (loadit)
|
||
|
before.parentNode.insertBefore(f, before);
|
||
|
}
|
||
|
} catch(e) {}
|
||
|
});
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
// LOAD THE VIDEO.JS API IF NEEDED
|
||
|
container.find('.tp-caption video').each(function(i) {
|
||
|
try{
|
||
|
if (jQuery(this).hasClass('video-js') && addedvid==0) {
|
||
|
addedvid=1;
|
||
|
var f = document.createElement("script");
|
||
|
f.src = opt.videoJsPath+"video.js"; /* Load Player API*/
|
||
|
var before = document.getElementsByTagName("script")[0];
|
||
|
|
||
|
var loadit = true;
|
||
|
jQuery('head').find('*').each(function(){
|
||
|
if (jQuery(this).attr('src') == opt.videoJsPath+"video.js")
|
||
|
loadit = false;
|
||
|
});
|
||
|
if (loadit) {
|
||
|
before.parentNode.insertBefore(f, before);
|
||
|
jQuery('head').append('<link rel="stylesheet" type="text/css" href="'+opt.videoJsPath+'video-js.min.css" media="screen" />');
|
||
|
jQuery('head').append('<script> videojs.options.flash.swf = "'+opt.videoJsPath+'video-js.swf";</script>');
|
||
|
}
|
||
|
}
|
||
|
} catch(e) {}
|
||
|
});
|
||
|
|
||
|
// SHUFFLE MODE
|
||
|
if (opt.shuffle=="on") {
|
||
|
for (var u=0;u<container.find('>ul: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;
|
||
|
|
||
|
// IF START SLIDE IS SET
|
||
|
if (opt.startWithSlide !=undefined) opt.next=opt.startWithSlide;
|
||
|
|
||
|
// IF DEEPLINK HAS BEEN SET
|
||
|
var deeplink = getUrlVars("#")[0];
|
||
|
if (deeplink.length<9) {
|
||
|
if (deeplink.split('slide').length>1) {
|
||
|
var dslide=parseInt(deeplink.split('slide')[1],0);
|
||
|
if (dslide<1) dslide=1;
|
||
|
if (dslide>container.find('>ul:first >li').length) dslide=container.find('>ul:first >li').length;
|
||
|
opt.next=dslide-1;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
opt.origcd=opt.delay;
|
||
|
opt.firststart=1;
|
||
|
|
||
|
// BASIC OFFSET POSITIONS OF THE BULLETS
|
||
|
if (opt.navigationHOffset==undefined) opt.navOffsetHorizontal=0;
|
||
|
if (opt.navigationVOffset==undefined) opt.navOffsetVertical=0;
|
||
|
|
||
|
|
||
|
container.append('<div class="tp-loader '+opt.spinner+'">'+
|
||
|
'<div class="dot1"></div>'+
|
||
|
'<div class="dot2"></div>'+
|
||
|
'<div class="bounce1"></div>'+
|
||
|
'<div class="bounce2"></div>'+
|
||
|
'<div class="bounce3"></div>'+
|
||
|
'</div>');
|
||
|
|
||
|
// RESET THE TIMER
|
||
|
if (container.find('.tp-bannertimer').length==0) container.append('<div class="tp-bannertimer" style="visibility:hidden"></div>');
|
||
|
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;
|
||
|
|
||
|
|
||
|
// 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('<div class="tp-bannershadow tp-shadow'+opt.shadow+'"></div>');
|
||
|
var loff=0;
|
||
|
if (opt.forceFullWidth=="on")
|
||
|
loff = 0-opt.container.parent().offset().left;
|
||
|
container.parent().find('.tp-bannershadow').css({'width':opt.width,'left':loff});
|
||
|
}
|
||
|
|
||
|
|
||
|
container.find('ul').css({'display':'none'});
|
||
|
|
||
|
var fliparent = container;
|
||
|
|
||
|
|
||
|
// PREPARE THE SLIDES
|
||
|
container.find('ul').css({'display':'block'});
|
||
|
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);
|
||
|
if (opt.keyboardNavigation=="on") createKeyboard(container,opt);
|
||
|
|
||
|
swipeAction(container,opt);
|
||
|
|
||
|
if (opt.hideThumbs>0) hideThumbs(container,opt);
|
||
|
|
||
|
swapSlide(container,opt);
|
||
|
// START COUNTDOWN
|
||
|
if (opt.slideamount >1) countDown(container,opt);
|
||
|
setTimeout(function() {
|
||
|
container.trigger('revolution.slide.onloaded');
|
||
|
},500);
|
||
|
|
||
|
|
||
|
|
||
|
// IF RESIZED, NEED TO STOP ACTUAL TRANSITION AND RESIZE ACTUAL IMAGES
|
||
|
jQuery(window).resize(function() {
|
||
|
if (jQuery('body').find(container)!=0)
|
||
|
if (opt.forceFullWidth=="on" ) {
|
||
|
|
||
|
var loff = opt.container.closest('.forcefullwidth_wrapper_tp_banner').offset().left;
|
||
|
//opt.container.parent().css({'width':jQuery(window).width()});
|
||
|
opt.container.parent().css({'left':(0-loff)+"px",'width':jQuery(window).width()});
|
||
|
}
|
||
|
|
||
|
if (container.outerWidth(true)!=opt.width) {
|
||
|
containerResized(container,opt);
|
||
|
}
|
||
|
});
|
||
|
|
||
|
// HIDE THUMBS UNDER SIZE...
|
||
|
try{
|
||
|
if (opt.hideThumbsUnderResoluition!=0 && opt.navigationType=="thumb") {
|
||
|
if (opt.hideThumbsUnderResoluition>jQuery(window).width())
|
||
|
jQuery('.tp-bullets').css({display:"none"});
|
||
|
else
|
||
|
jQuery('.tp-bullets').css({display:"block"});
|
||
|
}
|
||
|
} catch(e) {}
|
||
|
|
||
|
|
||
|
|
||
|
// CHECK IF THE CAPTION IS A "SCROLL ME TO POSITION" CAPTION IS
|
||
|
//if (opt.fullScreen=="on") {
|
||
|
container.find('.tp-scrollbelowslider').on('click',function() {
|
||
|
var off=0;
|
||
|
try{
|
||
|
off = jQuery('body').find(opt.fullScreenOffsetContainer).height();
|
||
|
} catch(e) {}
|
||
|
try{
|
||
|
off = off - jQuery(this).data('scrolloffset');
|
||
|
} catch(e) {}
|
||
|
|
||
|
jQuery('body,html').animate(
|
||
|
{scrollTop:(container.offset().top+(container.find('>ul >li').height())-off)+"px"},{duration:400});
|
||
|
});
|
||
|
//}
|
||
|
}
|
||
|
|
||
|
})
|
||
|
},
|
||
|
|
||
|
|
||
|
// METHODE PAUSE
|
||
|
revscroll: function(oy) {
|
||
|
return this.each(function() {
|
||
|
var container=jQuery(this);
|
||
|
jQuery('body,html').animate(
|
||
|
{scrollTop:(container.offset().top+(container.find('>ul >li').height())-oy)+"px"},{duration:400});
|
||
|
})
|
||
|
},
|
||
|
|
||
|
// METHODE PAUSE
|
||
|
revredraw: function(oy) {
|
||
|
return this.each(function() {
|
||
|
var container=jQuery(this);
|
||
|
var bt = container.parent().find('.tp-bannertimer');
|
||
|
var opt = bt.data('opt');
|
||
|
containerResized(container,opt);
|
||
|
|
||
|
})
|
||
|
},
|
||
|
|
||
|
// METHODE PAUSE
|
||
|
revpause: function(options) {
|
||
|
|
||
|
return this.each(function() {
|
||
|
var container=jQuery(this);
|
||
|
container.data('conthover',1);
|
||
|
container.data('conthover-changed',1);
|
||
|
container.trigger('revolution.slide.onpause');
|
||
|
var bt = container.parent().find('.tp-bannertimer');
|
||
|
var opt = bt.data('opt');
|
||
|
opt.bannertimeronpause = true;
|
||
|
|
||
|
})
|
||
|
|
||
|
|
||
|
},
|
||
|
|
||
|
// METHODE RESUME
|
||
|
revresume: function(options) {
|
||
|
return this.each(function() {
|
||
|
var container=jQuery(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');
|
||
|
opt.bannertimeronpause = false;
|
||
|
|
||
|
})
|
||
|
|
||
|
},
|
||
|
|
||
|
// METHODE NEXT
|
||
|
revnext: function(options) {
|
||
|
return this.each(function() {
|
||
|
// CATCH THE CONTAINER
|
||
|
var container=jQuery(this);
|
||
|
container.parent().find('.tp-rightarrow').click();
|
||
|
|
||
|
|
||
|
})
|
||
|
|
||
|
},
|
||
|
|
||
|
// METHODE RESUME
|
||
|
revprev: function(options) {
|
||
|
return this.each(function() {
|
||
|
// CATCH THE CONTAINER
|
||
|
var container=jQuery(this);
|
||
|
container.parent().find('.tp-leftarrow').click();
|
||
|
})
|
||
|
|
||
|
},
|
||
|
|
||
|
// METHODE LENGTH
|
||
|
revmaxslide: function(options) {
|
||
|
// CATCH THE CONTAINER
|
||
|
return jQuery(this).find('>ul:first-child >li').length;
|
||
|
},
|
||
|
|
||
|
|
||
|
// METHODE CURRENT
|
||
|
revcurrentslide: function(options) {
|
||
|
// CATCH THE CONTAINER
|
||
|
var container=jQuery(this);
|
||
|
var bt = container.parent().find('.tp-bannertimer');
|
||
|
var opt = bt.data('opt');
|
||
|
return opt.act;
|
||
|
},
|
||
|
|
||
|
// METHODE CURRENT
|
||
|
revlastslide: function(options) {
|
||
|
// CATCH THE CONTAINER
|
||
|
var container=jQuery(this);
|
||
|
var bt = container.parent().find('.tp-bannertimer');
|
||
|
var opt = bt.data('opt');
|
||
|
return opt.lastslide;
|
||
|
},
|
||
|
|
||
|
|
||
|
// METHODE JUMP TO SLIDE
|
||
|
revshowslide: function(slide) {
|
||
|
return this.each(function() {
|
||
|
// CATCH THE CONTAINER
|
||
|
var container=jQuery(this);
|
||
|
container.data('showus',slide);
|
||
|
container.parent().find('.tp-rightarrow').click();
|
||
|
})
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
})
|
||
|
|
||
|
|
||
|
///////////////////////////
|
||
|
// GET THE URL PARAMETER //
|
||
|
///////////////////////////
|
||
|
function getUrlVars(hashdivider)
|
||
|
{
|
||
|
var vars = [], hash;
|
||
|
var hashes = window.location.href.slice(window.location.href.indexOf(hashdivider) + 1).split('_');
|
||
|
for(var i = 0; i < hashes.length; i++)
|
||
|
{
|
||
|
hashes[i] = hashes[i].replace('%3D',"=");
|
||
|
hash = hashes[i].split('=');
|
||
|
vars.push(hash[0]);
|
||
|
vars[hash[0]] = hash[1];
|
||
|
}
|
||
|
return vars;
|
||
|
}
|
||
|
|
||
|
//////////////////////////
|
||
|
// CONTAINER RESIZED //
|
||
|
/////////////////////////
|
||
|
function containerResized(container,opt) {
|
||
|
|
||
|
// HIDE THUMBS UNDER SIZE...
|
||
|
try{
|
||
|
if (opt.hideThumbsUnderResoluition!=0 && opt.navigationType=="thumb") {
|
||
|
if (opt.hideThumbsUnderResoluition>jQuery(window).width())
|
||
|
jQuery('.tp-bullets').css({display:"none"});
|
||
|
else
|
||
|
jQuery('.tp-bullets').css({display:"block"});
|
||
|
}
|
||
|
} catch(e) {}
|
||
|
|
||
|
|
||
|
container.find('.defaultimg').each(function(i) {
|
||
|
setSize(jQuery(this),opt);
|
||
|
});
|
||
|
|
||
|
var loff=0;
|
||
|
if (opt.forceFullWidth=="on")
|
||
|
loff = 0-opt.container.parent().offset().left;
|
||
|
try{
|
||
|
container.parent().find('.tp-bannershadow').css({'width':opt.width,'left':loff});
|
||
|
} 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});
|
||
|
|
||
|
nextsh.find('.defaultimg').each(function() {
|
||
|
var dimg = jQuery(this);
|
||
|
if (dimg.data('kenburn')!=undefined)
|
||
|
dimg.data('kenburn').restart();
|
||
|
});
|
||
|
|
||
|
var nextli = container.find('>ul >li:eq('+opt.next+')');
|
||
|
|
||
|
animateTheCaptions(nextli, opt,true);
|
||
|
//restartBannerTimer(opt,container);
|
||
|
setBulPos(container,opt);
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
//////////////////
|
||
|
// IS MOBILE ?? //
|
||
|
//////////////////
|
||
|
function is_mobile() {
|
||
|
var agents = ['android', 'webos', 'iphone', 'ipad', 'blackberry','Android', 'webos', ,'iPod', 'iPhone', 'iPad', 'Blackberry', 'BlackBerry'];
|
||
|
var ismobile=false;
|
||
|
for(i in agents) {
|
||
|
|
||
|
if (navigator.userAgent.split(agents[i]).length>1) {
|
||
|
ismobile = true;
|
||
|
|
||
|
}
|
||
|
}
|
||
|
return ismobile;
|
||
|
}
|
||
|
|
||
|
/*********************************
|
||
|
- CHECK IF BROWSER IS IE -
|
||
|
********************************/
|
||
|
function isIE( version, comparison ){
|
||
|
var $div = jQuery('<div style="display:none;"/>').appendTo(jQuery('body'));
|
||
|
$div.html('<!--[if '+(comparison||'')+' IE '+(version||'')+']><a> </a><![endif]-->');
|
||
|
var ieTest = $div.find('a').length;
|
||
|
$div.remove();
|
||
|
return ieTest;
|
||
|
}
|
||
|
|
||
|
|
||
|
function callingNewSlide(opt,container) {
|
||
|
opt.cd=0;
|
||
|
swapSlide(container,opt);
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
////////////////////////////////
|
||
|
// - CREATE THE BULLETS - //
|
||
|
////////////////////////////////
|
||
|
function createThumbs(container,opt) {
|
||
|
|
||
|
var cap=container.parent();
|
||
|
|
||
|
if (opt.navigationType=="thumb" || opt.navsecond=="both") {
|
||
|
cap.append('<div class="tp-bullets tp-thumbs '+opt.navigationStyle+'"><div class="tp-mask"><div class="tp-thumbcontainer"></div></div></div>');
|
||
|
}
|
||
|
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+")");
|
||
|
var bgcolor = li.find(".defaultimg").css("backgroundColor");
|
||
|
if (li.data('thumb') !=undefined)
|
||
|
var src= li.data('thumb')
|
||
|
else
|
||
|
var src=li.find("img:first").attr('src');
|
||
|
|
||
|
|
||
|
bullets.append('<div class="bullet thumb" style="background-color:'+bgcolor+';position:relative;width:'+opt.thumbWidth+'px;height:'+opt.thumbHeight+'px;background-image:url('+src+') !important;background-size:cover;background-position:center center;"></div>');
|
||
|
var bullet= bullets.find('.bullet:first');
|
||
|
});
|
||
|
//bullets.append('<div style="clear:both"></div>');
|
||
|
var minwidth=10;
|
||
|
|
||
|
|
||
|
// ADD THE BULLET CLICK FUNCTION HERE
|
||
|
bullets.find('.bullet').each(function(i) {
|
||
|
var bul = jQuery(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 (thumbconwidth<max) {
|
||
|
jQuery(document).mousemove(function(e) {
|
||
|
jQuery('body').data('mousex',e.pageX);
|
||
|
});
|
||
|
|
||
|
|
||
|
|
||
|
// ON MOUSE MOVE ON THE THUMBNAILS EVERYTHING SHOULD MOVE :)
|
||
|
|
||
|
bullets.parent().mouseenter(function() {
|
||
|
var $this=jQuery(this);
|
||
|
$this.addClass("over");
|
||
|
var offset = $this.offset();
|
||
|
var x = jQuery('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,200);
|
||
|
});
|
||
|
|
||
|
bullets.parent().mousemove(function() {
|
||
|
|
||
|
var $this=jQuery(this);
|
||
|
|
||
|
//if (!$this.hasClass("over")) {
|
||
|
var offset = $this.offset();
|
||
|
var x = jQuery('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-1;
|
||
|
var diff=(max- thumbconwidth)+15;
|
||
|
var steps = diff / thumbconwidth;
|
||
|
x=x-3;
|
||
|
if (x<6) x=0;
|
||
|
if (x+3>thumbconwidth-6) 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=jQuery(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});
|
||
|
TweenLite.to($this.find('.tp-thumbcontainer'),0.2,{left:pos,ease:Power3.easeOut,overwrite:"auto"});
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
////////////////////////////////
|
||
|
// - CREATE THE BULLETS - //
|
||
|
////////////////////////////////
|
||
|
function createBullets(container,opt) {
|
||
|
|
||
|
if (opt.navigationType=="bullet" || opt.navigationType=="both") {
|
||
|
container.parent().append('<div class="tp-bullets simplebullets '+opt.navigationStyle+'"></div>');
|
||
|
}
|
||
|
|
||
|
|
||
|
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('<div class="bullet"></div>');
|
||
|
var bullet= bullets.find('.bullet:first');
|
||
|
|
||
|
|
||
|
});
|
||
|
|
||
|
// ADD THE BULLET CLICK FUNCTION HERE
|
||
|
bullets.find('.bullet').each(function(i) {
|
||
|
var bul = jQuery(this);
|
||
|
if (i==opt.slideamount-1) bul.addClass('last');
|
||
|
if (i==0) bul.addClass('first');
|
||
|
|
||
|
bul.click(function() {
|
||
|
var sameslide = false;
|
||
|
if (opt.navigationArrows=="withbullet" || opt.navigationArrows=="nexttobullets") {
|
||
|
if (bul.index()-1 == opt.act) sameslide=true;
|
||
|
} else {
|
||
|
if (bul.index() == opt.act) sameslide=true;
|
||
|
}
|
||
|
|
||
|
if (opt.transition==0 && !sameslide) {
|
||
|
|
||
|
if (opt.navigationArrows=="withbullet" || opt.navigationArrows=="nexttobullets") {
|
||
|
opt.next = bul.index()-1;
|
||
|
} else {
|
||
|
opt.next = bul.index();
|
||
|
}
|
||
|
|
||
|
callingNewSlide(opt,container);
|
||
|
}
|
||
|
});
|
||
|
|
||
|
});
|
||
|
|
||
|
bullets.append('<div class="tpclear"></div>');
|
||
|
|
||
|
|
||
|
|
||
|
setBulPos(container,opt);
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
//////////////////////
|
||
|
// CREATE ARROWS //
|
||
|
/////////////////////
|
||
|
function createArrows(container,opt) {
|
||
|
|
||
|
var bullets = container.find('.tp-bullets');
|
||
|
|
||
|
var hidden="";
|
||
|
var arst= opt.navigationStyle;
|
||
|
if (opt.navigationArrows=="none") hidden="visibility:hidden;display:none";
|
||
|
opt.soloArrowStyle = "default";
|
||
|
|
||
|
if (opt.navigationArrows!="none" && opt.navigationArrows!="nexttobullets") arst = opt.soloArrowStyle;
|
||
|
|
||
|
container.parent().append('<div style="'+hidden+'" class="tp-leftarrow tparrows '+arst+'"></div>');
|
||
|
container.parent().append('<div style="'+hidden+'" class="tp-rightarrow tparrows '+arst+'"></div>');
|
||
|
|
||
|
// 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);
|
||
|
|
||
|
}
|
||
|
|
||
|
//////////////////////
|
||
|
// CREATE ARROWS //
|
||
|
/////////////////////
|
||
|
function createKeyboard(container,opt) {
|
||
|
|
||
|
|
||
|
// THE LEFT / RIGHT BUTTON CLICK ! //
|
||
|
jQuery(document).keydown(function(e){
|
||
|
if (opt.transition==0 && e.keyCode == 39) {
|
||
|
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);
|
||
|
}
|
||
|
|
||
|
if (opt.transition==0 && e.keyCode == 37) {
|
||
|
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")
|
||
|
|
||
|
Hammer(container).on("swipeleft", function() {
|
||
|
if (opt.transition==0) {
|
||
|
opt.next = opt.next+1;
|
||
|
if (opt.next == opt.slideamount) opt.next=0;
|
||
|
callingNewSlide(opt,container);
|
||
|
}
|
||
|
});
|
||
|
Hammer(container).on("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);
|
||
|
}
|
||
|
});
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
////////////////////////////////////////////////////////////////
|
||
|
// 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('<div class=".tp-bullets"></div>');
|
||
|
var bullets = container.parent().find('.tp-bullets');
|
||
|
}
|
||
|
|
||
|
if (ca==null) {
|
||
|
container.append('<div class=".tparrows"></div>');
|
||
|
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);
|
||
|
|
||
|
bullets.addClass("hidebullets");
|
||
|
ca.addClass("hidearrows");
|
||
|
|
||
|
bullets.hover(function() {
|
||
|
opt.overnav = true;
|
||
|
bullets.addClass("hovered");
|
||
|
clearTimeout(container.data('hidethumbs'));
|
||
|
bullets.removeClass("hidebullets");
|
||
|
ca.removeClass("hidearrows");
|
||
|
},
|
||
|
function() {
|
||
|
opt.overnav = false;
|
||
|
bullets.removeClass("hovered");
|
||
|
if (!container.hasClass("hovered") && !bullets.hasClass("hovered"))
|
||
|
container.data('hidethumbs', setTimeout(function() {
|
||
|
bullets.addClass("hidebullets");
|
||
|
ca.addClass("hidearrows");
|
||
|
},opt.hideThumbs));
|
||
|
});
|
||
|
|
||
|
|
||
|
ca.hover(function() {
|
||
|
opt.overnav = true;
|
||
|
bullets.addClass("hovered");
|
||
|
clearTimeout(container.data('hidethumbs'));
|
||
|
bullets.removeClass("hidebullets");
|
||
|
ca.removeClass("hidearrows");
|
||
|
|
||
|
},
|
||
|
function() {
|
||
|
opt.overnav = false;
|
||
|
bullets.removeClass("hovered");
|
||
|
});
|
||
|
|
||
|
|
||
|
|
||
|
container.on('mouseenter', function() {
|
||
|
container.addClass("hovered");
|
||
|
clearTimeout(container.data('hidethumbs'));
|
||
|
bullets.removeClass("hidebullets");
|
||
|
ca.removeClass("hidearrows");
|
||
|
});
|
||
|
|
||
|
container.on('mouseleave', function() {
|
||
|
container.removeClass("hovered");
|
||
|
if (!container.hasClass("hovered") && !bullets.hasClass("hovered"))
|
||
|
container.data('hidethumbs', setTimeout(function() {
|
||
|
bullets.addClass("hidebullets");
|
||
|
ca.addClass("hidearrows");
|
||
|
},opt.hideThumbs));
|
||
|
});
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
//////////////////////////////
|
||
|
// SET POSITION OF BULLETS //
|
||
|
//////////////////////////////
|
||
|
function setBulPos(container,opt) {
|
||
|
var topcont=container.parent();
|
||
|
var bullets=topcont.find('.tp-bullets');
|
||
|
|
||
|
if (opt.navigationType=="thumb") {
|
||
|
bullets.find('.thumb').each(function(i) {
|
||
|
var thumb = jQuery(this);
|
||
|
|
||
|
thumb.css({'width':opt.thumbWidth * opt.bw+"px", 'height':opt.thumbHeight*opt.bh+"px"});
|
||
|
|
||
|
})
|
||
|
var bup = bullets.find('.tp-mask');
|
||
|
|
||
|
bup.width(opt.thumbWidth*opt.thumbAmount * opt.bw);
|
||
|
bup.height(opt.thumbHeight * opt.bh);
|
||
|
bup.parent().width(opt.thumbWidth*opt.thumbAmount * opt.bw);
|
||
|
bup.parent().height(opt.thumbHeight * opt.bh);
|
||
|
}
|
||
|
|
||
|
|
||
|
var tl = topcont.find('.tp-leftarrow');
|
||
|
var tr = topcont.find('.tp-rightarrow');
|
||
|
|
||
|
if (opt.navigationType=="thumb" && opt.navigationArrows=="nexttobullets") opt.navigationArrows="solo";
|
||
|
// IM CASE WE HAVE NAVIGATION BULLETS TOGETHER WITH ARROWS
|
||
|
if (opt.navigationArrows=="nexttobullets") {
|
||
|
tl.prependTo(bullets).css({'float':'left'});
|
||
|
tr.insertBefore(bullets.find('.tpclear')).css({'float':'left'});
|
||
|
}
|
||
|
var loff=0;
|
||
|
if (opt.forceFullWidth=="on")
|
||
|
loff = 0-opt.container.parent().offset().left;
|
||
|
|
||
|
if (opt.navigationArrows!="none" && opt.navigationArrows!="nexttobullets") {
|
||
|
|
||
|
tl.css({'position':'absolute'});
|
||
|
tr.css({'position':'absolute'});
|
||
|
|
||
|
|
||
|
if (opt.soloArrowLeftValign=="center") tl.css({'top':'50%','marginTop':(opt.soloArrowLeftVOffset-Math.round(tl.innerHeight()/2))+"px"});
|
||
|
if (opt.soloArrowLeftValign=="bottom") tl.css({'top':'auto','bottom':(0+opt.soloArrowLeftVOffset)+"px"});
|
||
|
if (opt.soloArrowLeftValign=="top") tl.css({'bottom':'auto','top':(0+opt.soloArrowLeftVOffset)+"px"});
|
||
|
if (opt.soloArrowLeftHalign=="center") tl.css({'left':'50%','marginLeft':(loff+opt.soloArrowLeftHOffset-Math.round(tl.innerWidth()/2))+"px"});
|
||
|
if (opt.soloArrowLeftHalign=="left") tl.css({'left':(0+opt.soloArrowLeftHOffset+loff)+"px"});
|
||
|
if (opt.soloArrowLeftHalign=="right") tl.css({'right':(0+opt.soloArrowLeftHOffset-loff)+"px"});
|
||
|
|
||
|
if (opt.soloArrowRightValign=="center") tr.css({'top':'50%','marginTop':(opt.soloArrowRightVOffset-Math.round(tr.innerHeight()/2))+"px"});
|
||
|
if (opt.soloArrowRightValign=="bottom") tr.css({'top':'auto','bottom':(0+opt.soloArrowRightVOffset)+"px"});
|
||
|
if (opt.soloArrowRightValign=="top") tr.css({'bottom':'auto','top':(0+opt.soloArrowRightVOffset)+"px"});
|
||
|
if (opt.soloArrowRightHalign=="center") tr.css({'left':'50%','marginLeft':(loff+opt.soloArrowRightHOffset-Math.round(tr.innerWidth()/2))+"px"});
|
||
|
if (opt.soloArrowRightHalign=="left") tr.css({'left':(0+opt.soloArrowRightHOffset+loff)+"px"});
|
||
|
if (opt.soloArrowRightHalign=="right") tr.css({'right':(0+opt.soloArrowRightHOffset-loff)+"px"});
|
||
|
|
||
|
|
||
|
if (tl.position()!=null)
|
||
|
tl.css({'top':Math.round(parseInt(tl.position().top,0))+"px"});
|
||
|
|
||
|
if (tr.position()!=null)
|
||
|
tr.css({'top':Math.round(parseInt(tr.position().top,0))+"px"});
|
||
|
}
|
||
|
|
||
|
if (opt.navigationArrows=="none") {
|
||
|
tl.css({'visibility':'hidden'});
|
||
|
tr.css({'visibility':'hidden'});
|
||
|
}
|
||
|
|
||
|
// SET THE POSITIONS OF THE BULLETS // THUMBNAILS
|
||
|
|
||
|
|
||
|
if (opt.navigationVAlign=="center") bullets.css({'top':'50%','marginTop':(opt.navigationVOffset-Math.round(bullets.innerHeight()/2))+"px"});
|
||
|
if (opt.navigationVAlign=="bottom") bullets.css({'bottom':(0+opt.navigationVOffset)+"px"});
|
||
|
if (opt.navigationVAlign=="top") bullets.css({'top':(0+opt.navigationVOffset)+"px"});
|
||
|
|
||
|
|
||
|
|
||
|
if (opt.navigationHAlign=="center") bullets.css({'left':'50%','marginLeft':(loff+opt.navigationHOffset-Math.round(bullets.innerWidth()/2))+"px"});
|
||
|
if (opt.navigationHAlign=="left") bullets.css({'left':(0+opt.navigationHOffset+loff)+"px"});
|
||
|
if (opt.navigationHAlign=="right") bullets.css({'right':(0+opt.navigationHOffset-loff)+"px"});
|
||
|
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
//////////////////////////////////////////////////////////
|
||
|
// - SET THE IMAGE SIZE TO FIT INTO THE CONTIANER - //
|
||
|
////////////////////////////////////////////////////////
|
||
|
function setSize(img,opt) {
|
||
|
|
||
|
|
||
|
opt.container.closest('.forcefullwidth_wrapper_tp_banner').find('.tp-fullwidth-forcer').css({'height':opt.container.height()});
|
||
|
opt.container.closest('.rev_slider_wrapper').css({'height':opt.container.height()});
|
||
|
|
||
|
|
||
|
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>opt.bw) opt.bh=opt.bw;
|
||
|
if (opt.bh<opt.bw) opt.bw = opt.bh;
|
||
|
if (opt.bw<opt.bh) opt.bh = opt.bw;
|
||
|
if (opt.bh>1) { opt.bw=1; opt.bh=1; }
|
||
|
if (opt.bw>1) {opt.bw=1; opt.bh=1; }
|
||
|
|
||
|
|
||
|
//opt.height= opt.startheight * opt.bh;
|
||
|
opt.height = Math.round(opt.startheight * (opt.width/opt.startwidth));
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
if (opt.height>opt.startheight && opt.autoHeight!="on") opt.height=opt.startheight;
|
||
|
|
||
|
|
||
|
|
||
|
if (opt.fullScreen=="on") {
|
||
|
opt.height = opt.bw * opt.startheight;
|
||
|
var cow = opt.container.parent().width();
|
||
|
var coh = jQuery(window).height();
|
||
|
if (opt.fullScreenOffsetContainer!=undefined) {
|
||
|
try{
|
||
|
var offcontainers = opt.fullScreenOffsetContainer.split(",");
|
||
|
jQuery.each(offcontainers,function(index,searchedcont) {
|
||
|
coh = coh - jQuery(searchedcont).outerHeight(true);
|
||
|
if (coh<opt.minFullScreenHeight) coh=opt.minFullScreenHeight;
|
||
|
});
|
||
|
} catch(e) {}
|
||
|
}
|
||
|
|
||
|
opt.container.parent().height(coh);
|
||
|
opt.container.css({'height':'100%'});
|
||
|
|
||
|
opt.height=coh;
|
||
|
|
||
|
} else {
|
||
|
opt.container.height(opt.height);
|
||
|
}
|
||
|
|
||
|
|
||
|
opt.slotw=Math.ceil(opt.width/opt.slots);
|
||
|
|
||
|
if (opt.fullSreen=="on")
|
||
|
opt.sloth=Math.ceil(jQuery(window).height()/opt.slots);
|
||
|
else
|
||
|
opt.sloth=Math.ceil(opt.height/opt.slots);
|
||
|
|
||
|
if (opt.autoHeight=="on")
|
||
|
opt.sloth=Math.ceil(img.height()/opt.slots);
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
/////////////////////////////////////////
|
||
|
// - PREPARE THE SLIDES / SLOTS - //
|
||
|
///////////////////////////////////////
|
||
|
function prepareSlides(container,opt) {
|
||
|
|
||
|
container.find('.tp-caption').each(function() { jQuery(this).addClass(jQuery(this).data('transition')); jQuery(this).addClass('start') });
|
||
|
|
||
|
// PREPARE THE UL CONTAINER TO HAVEING MAX HEIGHT AND HEIGHT FOR ANY SITUATION
|
||
|
container.find('>ul:first').css({overflow:'hidden',width:'100%',height:'100%',maxHeight:container.parent().css('maxHeight')});
|
||
|
if (opt.autoHeight=="on") {
|
||
|
container.find('>ul:first').css({overflow:'hidden',width:'100%',height:'100%',maxHeight:"none"});
|
||
|
container.css({'maxHeight':'none'});
|
||
|
container.parent().css({'maxHeight':'none'});
|
||
|
}
|
||
|
|
||
|
container.find('>ul:first >li').each(function(j) {
|
||
|
var li=jQuery(this);
|
||
|
|
||
|
// MAKE LI OVERFLOW HIDDEN FOR FURTHER ISSUES
|
||
|
li.css({'width':'100%','height':'100%','overflow':'hidden'});
|
||
|
|
||
|
if (li.data('link')!=undefined) {
|
||
|
var link = li.data('link');
|
||
|
var target="_self";
|
||
|
var zindex=2;
|
||
|
if (li.data('slideindex')=="back") zindex=0;
|
||
|
|
||
|
var linktoslide=li.data('linktoslide');
|
||
|
if (li.data('target')!=undefined) target=li.data('target');
|
||
|
|
||
|
if (link=="slide") {
|
||
|
li.append('<div class="tp-caption sft slidelink" style="z-index:'+zindex+';" data-x="0" data-y="0" data-linktoslide="'+linktoslide+'" data-start="0"><a><div></div></a></div>');
|
||
|
} else {
|
||
|
linktoslide="no";
|
||
|
li.append('<div class="tp-caption sft slidelink" style="z-index:'+zindex+';" data-x="0" data-y="0" data-linktoslide="'+linktoslide+'" data-start="0"><a target="'+target+'" href="'+link+'"><div></div></a></div>');
|
||
|
}
|
||
|
|
||
|
}
|
||
|
});
|
||
|
|
||
|
// RESOLVE OVERFLOW HIDDEN OF MAIN CONTAINER
|
||
|
container.parent().css({'overflow':'visible'});
|
||
|
|
||
|
|
||
|
container.find('>ul:first >li >img').each(function(j) {
|
||
|
|
||
|
var img=jQuery(this);
|
||
|
|
||
|
img.addClass('defaultimg');
|
||
|
if (img.data('lazyload')!=undefined && img.data('lazydone') != 1) {
|
||
|
|
||
|
} else {
|
||
|
setSize(img,opt);
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
img.wrap('<div class="slotholder" style="width:100%;height:100%;"'+
|
||
|
'data-duration="'+img.data('duration')+'"'+
|
||
|
'data-zoomstart="'+img.data("zoomstart")+'"'+
|
||
|
'data-zoomend="'+img.data("zoomend")+'"'+
|
||
|
'data-rotationstart="'+img.data("rotationstart")+'"'+
|
||
|
'data-rotationend="'+img.data("rotationend")+'"'+
|
||
|
'data-ease="'+img.data("ease")+'"'+
|
||
|
'data-duration="'+img.data("duration")+'"'+
|
||
|
'data-bgpositionend="'+img.data("bgpositionend")+'"'+
|
||
|
'data-bgposition="'+img.data("bgposition")+'"'+
|
||
|
'data-duration="'+img.data("duration")+'"'+
|
||
|
'data-kenburns="'+img.data("kenburns")+'"'+
|
||
|
'data-easeme="'+img.data("ease")+'"'+
|
||
|
'data-bgfit="'+img.data("bgfit")+'"'+
|
||
|
'data-bgfitend="'+img.data("bgfitend")+'"'+
|
||
|
'data-owidth="'+img.data("owidth")+'"'+
|
||
|
'data-oheight="'+img.data("oheight")+'"'+
|
||
|
'></div>');
|
||
|
|
||
|
if (opt.dottedOverlay!="none" && opt.dottedOverlay!=undefined)
|
||
|
img.closest('.slotholder').append('<div class="tp-dottedoverlay '+opt.dottedOverlay+'"></div>');
|
||
|
|
||
|
var src=img.attr('src');
|
||
|
var ll = img.data('lazyload');
|
||
|
var bgfit = img.data('bgfit');
|
||
|
var bgrepeat = img.data('bgrepeat');
|
||
|
var bgposition = img.data('bgposition');
|
||
|
|
||
|
|
||
|
if (bgfit==undefined) bgfit="cover";
|
||
|
if (bgrepeat==undefined) bgrepeat="no-repeat";
|
||
|
if (bgposition==undefined) bgposition="center center"
|
||
|
|
||
|
|
||
|
var pari = img.closest('.slotholder');
|
||
|
img.replaceWith('<div class="tp-bgimg defaultimg" data-lazyload="'+img.data('lazyload')+'" data-bgfit="'+bgfit+'"data-bgposition="'+bgposition+'" data-bgrepeat="'+bgrepeat+'" data-lazydone="'+img.data('lazydone')+'" src="'+src+'" data-src="'+src+'" style="background-color:'+img.css("backgroundColor")+';background-repeat:'+bgrepeat+';background-image:url('+src+');background-size:'+bgfit+';background-position:'+bgposition+';width:100%;height:100%;"></div>');
|
||
|
|
||
|
if (isIE(8)) {
|
||
|
pari.find('.tp-bgimg').css({backgroundImage:"none",'background-image':'none'});
|
||
|
pari.find('.tp-bgimg').append('<img class="ieeightfallbackimage defaultimg" src="'+src+'" style="width:100%">');
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
img.css({'opacity':0});
|
||
|
img.data('li-id',j);
|
||
|
|
||
|
});
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
///////////////////////
|
||
|
// PREPARE THE SLIDE //
|
||
|
//////////////////////
|
||
|
function prepareOneSlideSlot(slotholder,opt,visible,vorh) {
|
||
|
|
||
|
|
||
|
var sh=slotholder;
|
||
|
var img = sh.find('.defaultimg')
|
||
|
|
||
|
var scalestart = sh.data('zoomstart');
|
||
|
var rotatestart = sh.data('rotationstart');
|
||
|
|
||
|
if (img.data('currotate')!=undefined)
|
||
|
rotatestart = img.data('currotate');
|
||
|
if (img.data('curscale')!=undefined)
|
||
|
scalestart = img.data('curscale');
|
||
|
|
||
|
|
||
|
setSize(img,opt)
|
||
|
var src = img.data('src');
|
||
|
|
||
|
var bgcolor=img.css('background-color');
|
||
|
|
||
|
var w = opt.width;
|
||
|
var h = opt.height;
|
||
|
if (opt.autoHeight=="on")
|
||
|
h = opt.container.height();
|
||
|
|
||
|
var fulloff = img.data("fxof");
|
||
|
if (fulloff==undefined) fulloff=0;
|
||
|
|
||
|
fullyoff=0;
|
||
|
|
||
|
var off=0;
|
||
|
|
||
|
var bgfit = img.data('bgfit');
|
||
|
var bgrepeat = img.data('bgrepeat');
|
||
|
var bgposition = img.data('bgposition');
|
||
|
|
||
|
if (bgfit==undefined) bgfit="cover";
|
||
|
if (bgrepeat==undefined) bgrepeat="no-repeat";
|
||
|
if (bgposition==undefined) bgposition="center center";
|
||
|
|
||
|
|
||
|
|
||
|
if (sh.data('kenburns')=="on") {
|
||
|
bgfit=scalestart;
|
||
|
if (bgfit.toString().length<4)
|
||
|
bgfit = calculateKenBurnScales(bgfit,sh,opt);
|
||
|
}
|
||
|
|
||
|
if (isIE(8)) {
|
||
|
var imgsrc=src;
|
||
|
src="";
|
||
|
}
|
||
|
|
||
|
if (vorh == "horizontal") {
|
||
|
|
||
|
if (!visible) var off=0-opt.slotw;
|
||
|
|
||
|
for (var i=0;i<opt.slots;i++) {
|
||
|
sh.append('<div class="slot" style="position:absolute;'+
|
||
|
'top:'+(0+fullyoff)+'px;'+
|
||
|
'left:'+(fulloff+i*opt.slotw)+'px;'+
|
||
|
'overflow:hidden;width:'+opt.slotw+'px;'+
|
||
|
'height:'+h+'px">'+
|
||
|
'<div class="slotslide" style="position:absolute;'+
|
||
|
'top:0px;left:'+off+'px;'+
|
||
|
'width:'+opt.slotw+'px;'+
|
||
|
'height:'+h+'px;overflow:hidden;">'+
|
||
|
'<div style="background-color:'+bgcolor+';'+
|
||
|
'position:absolute;top:0px;'+
|
||
|
'left:'+(0-(i*opt.slotw))+'px;'+
|
||
|
'width:'+w+'px;height:'+h+'px;'+
|
||
|
'background-image:url('+src+');'+
|
||
|
'background-repeat:'+bgrepeat+';'+
|
||
|
'background-size:'+bgfit+';background-position:'+bgposition+';">'+
|
||
|
'</div></div></div>');
|
||
|
if (scalestart!=undefined && rotatestart!=undefined)
|
||
|
TweenLite.set(sh.find('.slot').last(),{rotationZ:rotatestart});
|
||
|
if (isIE(8)) {
|
||
|
sh.find('.slot ').last().find('.slotslide').append('<img class="ieeightfallbackimage" src="'+imgsrc+'" style="width:100%">');
|
||
|
ieimgposition(sh,opt);
|
||
|
|
||
|
}
|
||
|
}
|
||
|
} else {
|
||
|
|
||
|
if (!visible) var off=0-opt.sloth;
|
||
|
|
||
|
for (var i=0;i<opt.slots+2;i++) {
|
||
|
sh.append('<div class="slot" style="position:absolute;'+
|
||
|
'top:'+(fullyoff+(i*opt.sloth))+'px;'+
|
||
|
'left:'+(fulloff)+'px;'+
|
||
|
'overflow:hidden;'+
|
||
|
'width:'+w+'px;'+
|
||
|
'height:'+(opt.sloth)+'px">'+
|
||
|
|
||
|
'<div class="slotslide" style="position:absolute;'+
|
||
|
'top:'+(off)+'px;'+
|
||
|
'left:0px;width:'+w+'px;'+
|
||
|
'height:'+opt.sloth+'px;'+
|
||
|
'overflow:hidden;">'+
|
||
|
'<div style="background-color:'+bgcolor+';'+
|
||
|
'position:absolute;'+
|
||
|
'top:'+(0-(i*opt.sloth))+'px;'+
|
||
|
'left:0px;'+
|
||
|
'width:'+w+'px;height:'+h+'px;'+
|
||
|
'background-image:url('+src+');'+
|
||
|
'background-repeat:'+bgrepeat+';'+
|
||
|
'background-size:'+bgfit+';background-position:'+bgposition+';">'+
|
||
|
|
||
|
'</div></div></div>');
|
||
|
if (scalestart!=undefined && rotatestart!=undefined)
|
||
|
TweenLite.set(sh.find('.slot').last(),{rotationZ:rotatestart});
|
||
|
if (isIE(8)) {
|
||
|
sh.find('.slot ').last().find('.slotslide').append('<img class="ieeightfallbackimage" src="'+imgsrc+'" style="width:100%">');
|
||
|
ieimgposition(sh,opt);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
///////////////////////
|
||
|
// PREPARE THE SLIDE //
|
||
|
//////////////////////
|
||
|
function prepareOneSlideBox(slotholder,opt,visible) {
|
||
|
|
||
|
var sh=slotholder;
|
||
|
var img = sh.find('.defaultimg');
|
||
|
|
||
|
var scalestart = sh.data('zoomstart');
|
||
|
var rotatestart = sh.data('rotationstart');
|
||
|
|
||
|
if (img.data('currotate')!=undefined)
|
||
|
rotatestart = img.data('currotate');
|
||
|
if (img.data('curscale')!=undefined)
|
||
|
scalestart = img.data('curscale')*100;
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
setSize(img,opt)
|
||
|
var src = img.data('src');
|
||
|
var bgcolor=img.css('backgroundColor');
|
||
|
|
||
|
var w = opt.width;
|
||
|
var h = opt.height;
|
||
|
if (opt.autoHeight=="on")
|
||
|
h = opt.container.height();
|
||
|
|
||
|
var fulloff = img.data("fxof");
|
||
|
if (fulloff==undefined) fulloff=0;
|
||
|
|
||
|
fullyoff=0;
|
||
|
|
||
|
|
||
|
|
||
|
var off=0;
|
||
|
|
||
|
|
||
|
if (isIE(8)) {
|
||
|
var imgsrc=src;
|
||
|
src="";
|
||
|
}
|
||
|
|
||
|
// 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;
|
||
|
|
||
|
var bgfit = img.data('bgfit');
|
||
|
var bgrepeat = img.data('bgrepeat');
|
||
|
var bgposition = img.data('bgposition');
|
||
|
|
||
|
if (bgfit==undefined) bgfit="cover";
|
||
|
if (bgrepeat==undefined) bgrepeat="no-repeat";
|
||
|
if (bgposition==undefined) bgposition="center center";
|
||
|
|
||
|
if (sh.data('kenburns')=="on") {
|
||
|
bgfit=scalestart;
|
||
|
if (bgfit.toString().length<4)
|
||
|
bgfit = calculateKenBurnScales(bgfit,sh,opt);
|
||
|
}
|
||
|
|
||
|
for (var j=0;j<opt.slots;j++) {
|
||
|
|
||
|
y=0;
|
||
|
for (var i=0;i<opt.slots;i++) {
|
||
|
|
||
|
|
||
|
sh.append('<div class="slot" '+
|
||
|
'style="position:absolute;'+
|
||
|
'top:'+(fullyoff+y)+'px;'+
|
||
|
'left:'+(fulloff+x)+'px;'+
|
||
|
'width:'+basicsize+'px;'+
|
||
|
'height:'+basicsize+'px;'+
|
||
|
'overflow:hidden;">'+
|
||
|
|
||
|
'<div class="slotslide" data-x="'+x+'" data-y="'+y+'" '+
|
||
|
'style="position:absolute;'+
|
||
|
'top:'+(0)+'px;'+
|
||
|
'left:'+(0)+'px;'+
|
||
|
'width:'+basicsize+'px;'+
|
||
|
'height:'+basicsize+'px;'+
|
||
|
'overflow:hidden;">'+
|
||
|
|
||
|
'<div style="position:absolute;'+
|
||
|
'top:'+(0-y)+'px;'+
|
||
|
'left:'+(0-x)+'px;'+
|
||
|
'width:'+w+'px;'+
|
||
|
'height:'+h+'px;'+
|
||
|
'background-color:'+bgcolor+';'+
|
||
|
'background-image:url('+src+');'+
|
||
|
'background-repeat:'+bgrepeat+';'+
|
||
|
'background-size:'+bgfit+';background-position:'+bgposition+';">'+
|
||
|
'</div></div></div>');
|
||
|
y=y+basicsize;
|
||
|
|
||
|
if (isIE(8)) {
|
||
|
|
||
|
sh.find('.slot ').last().find('.slotslide').append('<img src="'+imgsrc+'">');
|
||
|
ieimgposition(sh,opt);
|
||
|
}
|
||
|
|
||
|
if (scalestart!=undefined && rotatestart!=undefined)
|
||
|
TweenLite.set(sh.find('.slot').last(),{rotationZ:rotatestart});
|
||
|
}
|
||
|
x=x+basicsize;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/***********************************************
|
||
|
- MOVE IE8 IMAGE IN RIGHT POSITION -
|
||
|
***********************************************/
|
||
|
|
||
|
function ieimgposition(nextsh,opt) {
|
||
|
|
||
|
if (isIE(8)) {
|
||
|
var ie8img = nextsh.find('.ieeightfallbackimage');
|
||
|
if (opt.startwidth/opt.startheight <nextsh.data('owidth')/nextsh.data('oheight'))
|
||
|
ie8img.css({width:"auto",height:"100%"})
|
||
|
else
|
||
|
ie8img.css({width:"100%",height:"auto"})
|
||
|
|
||
|
|
||
|
|
||
|
var ie8w = ie8img.width(),
|
||
|
ie8h = ie8img.height();
|
||
|
|
||
|
if (nextsh.data('bgposition')=="center center")
|
||
|
ie8img.css({position:"absolute",top:opt.height/2 - ie8h/2+"px", left:opt.width/2-ie8w/2+"px"});
|
||
|
|
||
|
if (nextsh.data('bgposition')=="center top" || nextsh.data('bgposition')=="top center")
|
||
|
ie8img.css({position:"absolute",top:"0px", left:opt.width/2-ie8w/2+"px"});
|
||
|
|
||
|
if (nextsh.data('bgposition')=="center bottom" || nextsh.data('bgposition')=="bottom center")
|
||
|
ie8img.css({position:"absolute",bottom:"0px", left:opt.width/2-ie8w/2+"px"});
|
||
|
|
||
|
|
||
|
if (nextsh.data('bgposition')=="right top" || nextsh.data('bgposition')=="top right")
|
||
|
ie8img.css({position:"absolute",top:"0px", right:"0px"});
|
||
|
|
||
|
if (nextsh.data('bgposition')=="right bottom" || nextsh.data('bgposition')=="bottom right")
|
||
|
ie8img.css({position:"absolute",bottom:"0px", right:"0px"});
|
||
|
|
||
|
if (nextsh.data('bgposition')=="right center" || nextsh.data('bgposition')=="center right")
|
||
|
ie8img.css({position:"absolute",top:opt.height/2 - ie8h/2+"px", right:"0px"});
|
||
|
|
||
|
if (nextsh.data('bgposition')=="left bottom" || nextsh.data('bgposition')=="bottom left")
|
||
|
ie8img.css({position:"absolute",bottom:"0px", left:"0px"});
|
||
|
|
||
|
if (nextsh.data('bgposition')=="left center" || nextsh.data('bgposition')=="center left")
|
||
|
ie8img.css({position:"absolute",top:opt.height/2 - ie8h/2+"px", left:"0px"});
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
///////////////////////
|
||
|
// REMOVE SLOTS //
|
||
|
/////////////////////
|
||
|
function removeSlots(container,opt,time) {
|
||
|
if (time==undefined)
|
||
|
time==80
|
||
|
|
||
|
setTimeout(function() {
|
||
|
container.find('.slotholder .slot').each(function() {
|
||
|
clearTimeout(jQuery(this).data('tout'));
|
||
|
jQuery(this).remove();
|
||
|
});
|
||
|
opt.transition = 0;
|
||
|
},time);
|
||
|
}
|
||
|
|
||
|
|
||
|
/*******************************************
|
||
|
- PREPARE LOADING OF IMAGES -
|
||
|
********************************************/
|
||
|
function loadAllPrepared(container,alreadyinload) {
|
||
|
|
||
|
container.find('img, .defaultimg').each(function(i) {
|
||
|
var img = jQuery(this);
|
||
|
|
||
|
if (img.data('lazyload')!=img.attr('src') && alreadyinload<3 && img.data('lazyload')!=undefined && img.data('lazyload')!='undefined') {
|
||
|
|
||
|
if (img.data('lazyload') !=undefined && img.data('lazyload') !='undefined') {
|
||
|
img.attr('src',img.data('lazyload'));
|
||
|
|
||
|
var limg = new Image();
|
||
|
|
||
|
limg.onload = function(i) {
|
||
|
img.data('lazydone',1);
|
||
|
if (img.hasClass("defaultimg")) setDefImg(img,limg);
|
||
|
}
|
||
|
limg.error = function() {
|
||
|
img.data('lazydone',1);
|
||
|
}
|
||
|
|
||
|
limg.src=img.attr('src');
|
||
|
if (limg.complete) {
|
||
|
if (img.hasClass("defaultimg")) setDefImg(img,limg);
|
||
|
img.data('lazydone',1);
|
||
|
}
|
||
|
|
||
|
}
|
||
|
} else {
|
||
|
|
||
|
if ((img.data('lazyload') === undefined || img.data('lazyload') === 'undefined') && img.data('lazydone')!=1) {
|
||
|
var limg = new Image();
|
||
|
limg.onload = function() {
|
||
|
if (img.hasClass("defaultimg")) setDefImg(img,limg);
|
||
|
img.data('lazydone',1);
|
||
|
}
|
||
|
limg.error = function() {
|
||
|
img.data('lazydone',1);
|
||
|
}
|
||
|
|
||
|
|
||
|
if (img.attr('src')!=undefined && img.attr('src')!='undefined') {
|
||
|
limg.src = img.attr('src');
|
||
|
} else
|
||
|
limg.src = img.data('src');
|
||
|
|
||
|
if (limg.complete) {
|
||
|
if (img.hasClass("defaultimg")) {
|
||
|
setDefImg(img,limg);
|
||
|
}
|
||
|
img.data('lazydone',1);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
})
|
||
|
}
|
||
|
|
||
|
function setDefImg(img,limg) {
|
||
|
var nextli = img.closest('li');
|
||
|
var ww = limg.width;
|
||
|
var hh = limg.height;
|
||
|
nextli.data('owidth',ww);
|
||
|
nextli.data('oheight',hh);
|
||
|
nextli.find('.slotholder').data('owidth',ww);
|
||
|
nextli.find('.slotholder').data('oheight',hh);
|
||
|
nextli.data('loadeddone',1);
|
||
|
}
|
||
|
|
||
|
var waitForLoads = function(element,call,opt) {
|
||
|
|
||
|
loadAllPrepared(element,0)
|
||
|
var inter = setInterval(function() {
|
||
|
opt.bannertimeronpause = true;
|
||
|
opt.cd=0;
|
||
|
var found = 0;
|
||
|
element.find('img, .defaultimg').each(function(i) {
|
||
|
if (jQuery(this).data('lazydone')!=1) {
|
||
|
found++;
|
||
|
|
||
|
}
|
||
|
});
|
||
|
|
||
|
if (found>0)
|
||
|
loadAllPrepared(element,found);
|
||
|
else {
|
||
|
clearInterval(inter);
|
||
|
if (call!=undefined) call();
|
||
|
}
|
||
|
|
||
|
},100)
|
||
|
}
|
||
|
|
||
|
|
||
|
//////////////////////////////
|
||
|
// //
|
||
|
// - SWAP THE SLIDES - //
|
||
|
// //
|
||
|
////////////////////////////
|
||
|
function swapSlide(container,opt) {
|
||
|
try{
|
||
|
var actli = container.find('>ul:first-child >li:eq('+opt.act+')');
|
||
|
} catch(e) {
|
||
|
var actli=container.find('>ul:first-child >li:eq(1)');
|
||
|
}
|
||
|
opt.lastslide=opt.act;
|
||
|
var nextli = container.find('>ul:first-child >li:eq('+opt.next+')');
|
||
|
|
||
|
var defimg= nextli.find('.defaultimg');
|
||
|
|
||
|
|
||
|
opt.bannertimeronpause = true;
|
||
|
opt.cd=0;
|
||
|
|
||
|
if (defimg.data('lazyload') !=undefined && defimg.data('lazyload') !="undefined" && defimg.data('lazydone') !=1 ) {
|
||
|
|
||
|
defimg.css({backgroundImage:'url("'+nextli.find('.defaultimg').data('lazyload')+'")'});
|
||
|
|
||
|
defimg.data('src',nextli.find('.defaultimg').data('lazyload'));
|
||
|
defimg.data('lazydone',1);
|
||
|
defimg.data('orgw',0);
|
||
|
nextli.data('loadeddone',1);
|
||
|
|
||
|
TweenLite.set(container.find('.tp-loader'),{display:"block",opacity:0});
|
||
|
TweenLite.to(container.find('.tp-loader'),0.3,{autoAlpha:1});
|
||
|
|
||
|
waitForLoads(nextli,function() {
|
||
|
swapSlideCall(opt,defimg,container)
|
||
|
},opt);
|
||
|
|
||
|
} else {
|
||
|
|
||
|
if (nextli.data('loadeddone')===undefined) {
|
||
|
nextli.data('loadeddone',1);
|
||
|
waitForLoads(nextli,function() {
|
||
|
swapSlideCall(opt,defimg,container)
|
||
|
},opt);
|
||
|
} else
|
||
|
|
||
|
swapSlideCall(opt,defimg,container)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function swapSlideCall(opt,defimg,container) {
|
||
|
opt.bannertimeronpause = false;
|
||
|
opt.cd=0;
|
||
|
TweenLite.to(container.find('.tp-loader'),0.3,{autoAlpha:0});
|
||
|
setSize(defimg,opt);
|
||
|
setBulPos(container,opt);
|
||
|
setSize(defimg,opt);
|
||
|
swapSlideProgress(container,opt);
|
||
|
|
||
|
}
|
||
|
|
||
|
/******************************
|
||
|
- SWAP SLIDE PROGRESS -
|
||
|
********************************/
|
||
|
/*!SWAP SLIDE*/
|
||
|
function swapSlideProgress(container,opt) {
|
||
|
|
||
|
|
||
|
container.trigger('revolution.slide.onbeforeswap');
|
||
|
|
||
|
opt.transition = 1;
|
||
|
opt.videoplaying = false;
|
||
|
//konsole.log("VideoPlay set to False due swapSlideProgress");
|
||
|
|
||
|
try{
|
||
|
var actli = container.find('>ul:first-child >li:eq('+opt.act+')');
|
||
|
} catch(e) {
|
||
|
var actli=container.find('>ul:first-child >li:eq(1)');
|
||
|
}
|
||
|
|
||
|
opt.lastslide=opt.act;
|
||
|
|
||
|
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 (nextsh.data('kenburns')=="on")
|
||
|
stopKenBurn(container,opt);
|
||
|
|
||
|
|
||
|
if (opt.ie) {
|
||
|
if (comingtransition=="boxfade") comingtransition = "boxslide";
|
||
|
if (comingtransition=="slotfade-vertical") comingtransition = "slotzoom-vertical";
|
||
|
if (comingtransition=="slotfade-horizontal") comingtransition = "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'});
|
||
|
|
||
|
|
||
|
// IF THERE IS AN OTHER FIRST SLIDE START HAS BEED SELECTED
|
||
|
if (nextli.data('differentissplayed') =='prepared') {
|
||
|
nextli.data('differentissplayed','done');
|
||
|
nextli.data('transition',nextli.data('savedtransition'));
|
||
|
nextli.data('slotamount',nextli.data('savedslotamount'));
|
||
|
nextli.data('masterspeed',nextli.data('savedmasterspeed'));
|
||
|
}
|
||
|
|
||
|
|
||
|
if (nextli.data('fstransition') != undefined && nextli.data('differentissplayed') !="done") {
|
||
|
nextli.data('savedtransition',nextli.data('transition'));
|
||
|
nextli.data('savedslotamount',nextli.data('slotamount'));
|
||
|
nextli.data('savedmasterspeed',nextli.data('masterspeed'));
|
||
|
|
||
|
nextli.data('transition',nextli.data('fstransition'));
|
||
|
nextli.data('slotamount',nextli.data('fsslotamount'));
|
||
|
nextli.data('masterspeed',nextli.data('fsmasterspeed'));
|
||
|
|
||
|
nextli.data('differentissplayed','prepared');
|
||
|
}
|
||
|
|
||
|
///////////////////////////////////////
|
||
|
// TRANSITION CHOOSE - RANDOM EFFECTS//
|
||
|
///////////////////////////////////////
|
||
|
var nexttrans = 0;
|
||
|
|
||
|
|
||
|
var transtext = nextli.data('transition').split(",");
|
||
|
var curtransid = nextli.data('nexttransid');
|
||
|
if (curtransid == undefined) {
|
||
|
curtransid=0;
|
||
|
nextli.data('nexttransid',curtransid);
|
||
|
} else {
|
||
|
curtransid=curtransid+1;
|
||
|
if (curtransid==transtext.length) curtransid=0;
|
||
|
nextli.data('nexttransid',curtransid);
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
var comingtransition = transtext[curtransid];
|
||
|
var specials = 0;
|
||
|
|
||
|
/*if (opt.ffnn == undefined) opt.ffnn=0;
|
||
|
comingtransition=opt.ffnn;
|
||
|
opt.ffnn=opt.ffnn+1;
|
||
|
if (opt.ffnn>46) opt.ffnn=0;*/
|
||
|
|
||
|
|
||
|
/* Transition Name ,
|
||
|
Transition Code,
|
||
|
Transition Sub Code,
|
||
|
Max Slots,
|
||
|
MasterSpeed Delays,
|
||
|
Preparing Slots (box,slideh, slidev),
|
||
|
Call on nextsh (null = no, true/false for visibility first preparing),
|
||
|
Call on actsh (null = no, true/false for visibility first preparing),
|
||
|
*/
|
||
|
|
||
|
if (comingtransition=="slidehorizontal") {
|
||
|
comingtransition = "slideleft"
|
||
|
if (opt.leftarrowpressed==1)
|
||
|
comingtransition = "slideright"
|
||
|
}
|
||
|
|
||
|
if (comingtransition=="slidevertical") {
|
||
|
comingtransition = "slideup"
|
||
|
if (opt.leftarrowpressed==1)
|
||
|
comingtransition = "slidedown"
|
||
|
}
|
||
|
|
||
|
|
||
|
var transitionsArray = [ ['boxslide' , 0, 1, 10, 0,'box',false,null,0],
|
||
|
['boxfade', 1, 0, 10, 0,'box',false,null,1],
|
||
|
['slotslide-horizontal', 2, 0, 0, 200,'horizontal',true,false,2],
|
||
|
['slotslide-vertical', 3, 0,0,200,'vertical',true,false,3],
|
||
|
['curtain-1', 4, 3,0,0,'horizontal',true,true,4],
|
||
|
['curtain-2', 5, 3,0,0,'horizontal',true,true,5],
|
||
|
['curtain-3', 6, 3,25,0,'horizontal',true,true,6],
|
||
|
['slotzoom-horizontal', 7, 0,0,400,'horizontal',true,true,7],
|
||
|
['slotzoom-vertical', 8, 0,0,0,'vertical',true,true,8],
|
||
|
['slotfade-horizontal', 9, 0,0,500,'horizontal',true,null,9],
|
||
|
['slotfade-vertical', 10, 0,0 ,500,'vertical',true,null,10],
|
||
|
['fade', 11, 0, 1 ,300,'horizontal',true,null,11],
|
||
|
['slideleft', 12, 0,1,0,'horizontal',true,true,12],
|
||
|
['slideup', 13, 0,1,0,'horizontal',true,true,13],
|
||
|
['slidedown', 14, 0,1,0,'horizontal',true,true,14],
|
||
|
['slideright', 15, 0,1,0,'horizontal',true,true,15],
|
||
|
['papercut', 16, 0,0,600,'',null,null,16],
|
||
|
['3dcurtain-horizontal', 17, 0,20,100,'vertical',false,true,17],
|
||
|
['3dcurtain-vertical', 18, 0,10,100,'horizontal',false,true,18],
|
||
|
['cubic', 19, 0,20,600,'horizontal',false,true,19],
|
||
|
['cube',19,0,20,600,'horizontal',false,true,20],
|
||
|
['flyin', 20, 0,4,600,'vertical',false,true,21],
|
||
|
['turnoff', 21, 0,1,1600,'horizontal',false,true,22],
|
||
|
['incube', 22, 0,20,600,'horizontal',false,true,23],
|
||
|
['cubic-horizontal', 23, 0,20,500,'vertical',false,true,24],
|
||
|
['cube-horizontal', 23, 0,20,500,'vertical',false,true,25],
|
||
|
['incube-horizontal', 24, 0,20,500,'vertical',false,true,26],
|
||
|
['turnoff-vertical', 25, 0,1,1600,'horizontal',false,true,27],
|
||
|
['fadefromright', 12, 1,1,0,'horizontal',true,true,28],
|
||
|
['fadefromleft', 15, 1,1,0,'horizontal',true,true,29],
|
||
|
['fadefromtop', 14, 1,1,0,'horizontal',true,true,30],
|
||
|
['fadefrombottom', 13, 1,1,0,'horizontal',true,true,31],
|
||
|
['fadetoleftfadefromright', 12, 2,1,0,'horizontal',true,true,32],
|
||
|
['fadetorightfadetoleft', 15, 2,1,0,'horizontal',true,true,33],
|
||
|
['fadetobottomfadefromtop', 14, 2,1,0,'horizontal',true,true,34],
|
||
|
['fadetotopfadefrombottom', 13, 2,1,0,'horizontal',true,true,35],
|
||
|
['parallaxtoright', 12, 3,1,0,'horizontal',true,true,36],
|
||
|
['parallaxtoleft', 15, 3,1,0,'horizontal',true,true,37],
|
||
|
['parallaxtotop', 14, 3,1,0,'horizontal',true,true,38],
|
||
|
['parallaxtobottom', 13, 3,1,0,'horizontal',true,true,39],
|
||
|
['scaledownfromright', 12, 4,1,0,'horizontal',true,true,40],
|
||
|
['scaledownfromleft', 15, 4,1,0,'horizontal',true,true,41],
|
||
|
['scaledownfromtop', 14, 4,1,0,'horizontal',true,true,42],
|
||
|
['scaledownfrombottom', 13, 4,1,0,'horizontal',true,true,43],
|
||
|
['zoomout', 13, 5,1,0,'horizontal',true,true,44],
|
||
|
['zoomin', 13, 6,1,0,'horizontal',true,true,45],
|
||
|
['notransition',26,0,1,0,'horizontal',true,null,46]
|
||
|
];
|
||
|
|
||
|
|
||
|
var flatTransitions = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45];
|
||
|
var premiumTransitions = [16,17,18,19,20,21,22,23,24,25,26,27]
|
||
|
|
||
|
var nexttrans =0;
|
||
|
var specials = 1;
|
||
|
var STAindex = 0;
|
||
|
var indexcounter =0;
|
||
|
var STA = new Array;
|
||
|
|
||
|
|
||
|
// RANDOM TRANSITIONS
|
||
|
if (comingtransition == "random") {
|
||
|
comingtransition = Math.round(Math.random()*transitionsArray.length-1);
|
||
|
if (comingtransition>transitionsArray.length-1) comingtransition=transitionsArray.length-1;
|
||
|
}
|
||
|
|
||
|
// RANDOM FLAT TRANSITIONS
|
||
|
if (comingtransition == "random-static") {
|
||
|
comingtransition = Math.round(Math.random()*flatTransitions.length-1);
|
||
|
if (comingtransition>flatTransitions.length-1) comingtransition=flatTransitions.length-1;
|
||
|
comingtransition = flatTransitions[comingtransition];
|
||
|
}
|
||
|
|
||
|
// RANDOM PREMIUM TRANSITIONS
|
||
|
if (comingtransition == "random-premium") {
|
||
|
comingtransition = Math.round(Math.random()*premiumTransitions.length-1);
|
||
|
if (comingtransition>premiumTransitions.length-1) comingtransition=premiumTransitions.length-1;
|
||
|
comingtransition = premiumTransitions[comingtransition];
|
||
|
}
|
||
|
|
||
|
findTransition();
|
||
|
|
||
|
// CHECK IF WE HAVE IE8 AND THAN FALL BACK ON FLAT TRANSITIONS
|
||
|
if (isIE(8) && nexttrans>15 && nexttrans<28) {
|
||
|
comingtransition = Math.round(Math.random()*flatTransitions.length-1);
|
||
|
if (comingtransition>flatTransitions.length-1) comingtransition=flatTransitions.length-1;
|
||
|
comingtransition = flatTransitions[comingtransition];
|
||
|
indexcounter =0;
|
||
|
findTransition();
|
||
|
}
|
||
|
|
||
|
function findTransition() {
|
||
|
// FIND THE RIGHT TRANSITION PARAMETERS HERE
|
||
|
jQuery.each(transitionsArray,function(inde,trans) {
|
||
|
if (trans[0] == comingtransition || trans[8] == comingtransition) {
|
||
|
nexttrans = trans[1];
|
||
|
specials = trans[2];
|
||
|
STAindex = indexcounter;
|
||
|
}
|
||
|
indexcounter = indexcounter+1;
|
||
|
})
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
var direction=-1;
|
||
|
if (opt.leftarrowpressed==1 || opt.act>opt.next) direction=1;
|
||
|
|
||
|
|
||
|
|
||
|
opt.leftarrowpressed=0;
|
||
|
|
||
|
if (nexttrans>26) nexttrans = 26;
|
||
|
if (nexttrans<0) nexttrans = 0;
|
||
|
|
||
|
|
||
|
// 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');
|
||
|
|
||
|
// PREPARED DEFAULT SETTINGS PER TRANSITION
|
||
|
STA = transitionsArray[STAindex];
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
/////////////////////////////////////////////
|
||
|
// SET THE BULLETS SELECTED OR UNSELECTED //
|
||
|
/////////////////////////////////////////////
|
||
|
|
||
|
|
||
|
container.parent().find(".bullet").each(function() {
|
||
|
var bul = jQuery(this);
|
||
|
bul.removeClass("selected");
|
||
|
|
||
|
if (opt.navigationArrows=="withbullet" || opt.navigationArrows=="nexttobullets") {
|
||
|
if (bul.index()-1 == opt.next) bul.addClass('selected');
|
||
|
|
||
|
} else {
|
||
|
|
||
|
if (bul.index() == opt.next) bul.addClass('selected');
|
||
|
|
||
|
}
|
||
|
});
|
||
|
|
||
|
|
||
|
|
||
|
//////////////////////////////////////////////////////////////////
|
||
|
// SET THE NEXT CAPTION AND REMOVE THE LAST CAPTION //
|
||
|
//////////////////////////////////////////////////////////////////
|
||
|
|
||
|
container.find('>li').each(function() {
|
||
|
var li = jQuery(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 //
|
||
|
///////////////////////////
|
||
|
|
||
|
if (actli.index() != nextli.index() && opt.firststart!=1) {
|
||
|
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 (comingtransition=="boxslide")
|
||
|
opt.slots=Math.round(Math.random()*6+3);
|
||
|
else
|
||
|
if (comingtransition=="flyin")
|
||
|
opt.slots=Math.round(Math.random()*4+1);
|
||
|
} 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 (!jQuery.support.transition || opt.ie || opt.ie9) opt.rotate=0;
|
||
|
|
||
|
|
||
|
|
||
|
//////////////////////////////
|
||
|
// FIRST START //
|
||
|
//////////////////////////////
|
||
|
|
||
|
if (opt.firststart==1) {
|
||
|
actli.css({'opacity':0});
|
||
|
opt.firststart=0;
|
||
|
}
|
||
|
|
||
|
|
||
|
// HERE COMES THE TRANSITION ENGINE
|
||
|
|
||
|
// ADJUST MASTERSPEED
|
||
|
masterspeed = masterspeed + STA[4];
|
||
|
|
||
|
if ((nexttrans==4 || nexttrans==5 || nexttrans==6) && opt.slots<3 ) opt.slots=3;
|
||
|
|
||
|
// ADJUST SLOTS
|
||
|
if (STA[3] != 0) opt.slots = Math.min(opt.slots,STA[3]);
|
||
|
if (nexttrans==9) opt.slots = opt.width/20;
|
||
|
if (nexttrans==10) opt.slots = opt.height/20;
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
// PREPAREONESLIDEBOX
|
||
|
if (STA[5] == "box") {
|
||
|
if (STA[7] !=null) prepareOneSlideBox(actsh,opt,STA[7]);
|
||
|
if (STA[6] !=null) prepareOneSlideBox(nextsh,opt,STA[6]);
|
||
|
} else
|
||
|
|
||
|
if (STA[5] == "vertical" || STA[5] == "horizontal") {
|
||
|
if (STA[7] !=null) prepareOneSlideSlot(actsh,opt,STA[7],STA[5]);
|
||
|
if (STA[6] !=null) prepareOneSlideSlot(nextsh,opt,STA[6],STA[5]);
|
||
|
}
|
||
|
|
||
|
// SHOW FIRST LI
|
||
|
if (nexttrans<12 || nexttrans>16) nextli.css({'opacity':1});
|
||
|
|
||
|
|
||
|
/////////////////////////////////////
|
||
|
// THE SLOTSLIDE - TRANSITION I. //
|
||
|
////////////////////////////////////
|
||
|
if (nexttrans==0) { // BOXSLIDE
|
||
|
//SET DEFAULT IMG UNVISIBLE
|
||
|
nextsh.find('.defaultimg').css({'opacity':0});
|
||
|
|
||
|
// ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT
|
||
|
|
||
|
var maxz = Math.ceil(opt.height/opt.sloth);
|
||
|
var curz = 0;
|
||
|
nextsh.find('.slotslide').each(function(j) {
|
||
|
var ss=jQuery(this);
|
||
|
curz=curz+1;
|
||
|
if (curz==maxz) curz=0;
|
||
|
|
||
|
TweenLite.fromTo(ss,(masterspeed)/600,
|
||
|
{opacity:0,top:(0-opt.sloth),left:(0-opt.slotw),rotation:opt.rotate},
|
||
|
{opacity:1,transformPerspective:600,top:0,left:0,scale:1,rotation:0,delay:((j)*15 + (curz)*30)/1500, ease:Power2.easeOut,onComplete:function() {
|
||
|
if (j==(opt.slots*opt.slots)-1) {
|
||
|
letItFree(container,opt,nextsh,actsh,nextli,actli)
|
||
|
}
|
||
|
|
||
|
}});
|
||
|
});
|
||
|
}
|
||
|
/////////////////////////////////////
|
||
|
// THE SLOTSLIDE - TRANSITION I. //
|
||
|
////////////////////////////////////
|
||
|
if (nexttrans==1) {
|
||
|
|
||
|
|
||
|
//SET DEFAULT IMG UNVISIBLE
|
||
|
nextsh.find('.defaultimg').css({'opacity':0});
|
||
|
|
||
|
// ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT
|
||
|
|
||
|
var maxtime;
|
||
|
|
||
|
nextsh.find('.slotslide').each(function(j) {
|
||
|
var ss=jQuery(this);
|
||
|
|
||
|
rand=Math.random()*masterspeed+300;
|
||
|
rand2=Math.random()*500+200;
|
||
|
|
||
|
if (rand+rand2>maxtime) maxtime = rand2+rand2;
|
||
|
|
||
|
|
||
|
TweenLite.fromTo(ss,rand/1000,
|
||
|
{opacity:0,transformPerspective:600,rotation:opt.rotate},
|
||
|
{opacity:1, ease:Power2.easeInOut,rotation:0,delay:rand2/1000})
|
||
|
|
||
|
|
||
|
|
||
|
});
|
||
|
|
||
|
setTimeout(function() {
|
||
|
letItFree(container,opt,nextsh,actsh,nextli,actli)
|
||
|
},masterspeed+300);
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
/////////////////////////////////////
|
||
|
// THE SLOTSLIDE - TRANSITION I. //
|
||
|
////////////////////////////////////
|
||
|
if (nexttrans==2) {
|
||
|
|
||
|
|
||
|
//SET DEFAULT IMG UNVISIBLE
|
||
|
nextsh.find('.defaultimg').css({'opacity':0});
|
||
|
|
||
|
// ALL OLD SLOTS SHOULD BE SLIDED TO THE RIGHT
|
||
|
actsh.find('.slotslide').each(function() {
|
||
|
var ss=jQuery(this);
|
||
|
|
||
|
TweenLite.to(ss,masterspeed/1000,{left:opt.slotw, rotation:(0-opt.rotate),onComplete:function() {
|
||
|
letItFree(container,opt,nextsh,actsh,nextli,actli)
|
||
|
|
||
|
}});
|
||
|
|
||
|
});
|
||
|
|
||
|
// ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT
|
||
|
nextsh.find('.slotslide').each(function() {
|
||
|
var ss=jQuery(this);
|
||
|
|
||
|
TweenLite.fromTo(ss,masterspeed/1000,
|
||
|
{left:0-opt.slotw, rotation:opt.rotate,transformPerspective:600},
|
||
|
{left:0, rotation:0,ease:Power2.easeOut,onComplete:function() {
|
||
|
letItFree(container,opt,nextsh,actsh,nextli,actli)
|
||
|
}
|
||
|
});
|
||
|
|
||
|
});
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
/////////////////////////////////////
|
||
|
// THE SLOTSLIDE - TRANSITION I. //
|
||
|
////////////////////////////////////
|
||
|
if (nexttrans==3) {
|
||
|
|
||
|
|
||
|
//SET DEFAULT IMG UNVISIBLE
|
||
|
nextsh.find('.defaultimg').css({'opacity':0});
|
||
|
|
||
|
// ALL OLD SLOTS SHOULD BE SLIDED TO THE RIGHT
|
||
|
actsh.find('.slotslide').each(function() {
|
||
|
var ss=jQuery(this);
|
||
|
TweenLite.to(ss,masterspeed/1000,{top:opt.sloth,rotation:opt.rotate,transformPerspective:600,onComplete:function() {
|
||
|
letItFree(container,opt,nextsh,actsh,nextli,actli)
|
||
|
}});
|
||
|
|
||
|
});
|
||
|
|
||
|
// ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT
|
||
|
nextsh.find('.slotslide').each(function() {
|
||
|
var ss=jQuery(this);
|
||
|
|
||
|
TweenLite.fromTo(ss,masterspeed/1000,
|
||
|
{top:0-opt.sloth,rotation:opt.rotate,transformPerspective:600},
|
||
|
{top:0,rotation:0,ease:Power2.easeOut,onComplete:function() {
|
||
|
letItFree(container,opt,nextsh,actsh,nextli,actli)
|
||
|
}});
|
||
|
|
||
|
});
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
/////////////////////////////////////
|
||
|
// THE SLOTSLIDE - TRANSITION I. //
|
||
|
////////////////////////////////////
|
||
|
if (nexttrans==4 || nexttrans==5) {
|
||
|
|
||
|
//SET DEFAULT IMG UNVISIBLE
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
nextsh.find('.defaultimg').css({'opacity':0});
|
||
|
setTimeout(function() {
|
||
|
actsh.find('.defaultimg').css({opacity:0});
|
||
|
},100);
|
||
|
|
||
|
|
||
|
|
||
|
// ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT
|
||
|
var cspeed = (masterspeed)/1000;
|
||
|
var ticker = cspeed;
|
||
|
|
||
|
|
||
|
|
||
|
actsh.find('.slotslide').each(function(i) {
|
||
|
var ss=jQuery(this);
|
||
|
var del = (i*cspeed)/opt.slots;
|
||
|
if (nexttrans==5) del = ((opt.slots-i-1)*cspeed)/(opt.slots)/1.5;
|
||
|
TweenLite.to(ss,cspeed*3,{transformPerspective:600,top:0+opt.height,opacity:0.5,rotation:opt.rotate,ease:Power2.easeInOut,delay:del});
|
||
|
});
|
||
|
|
||
|
// ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT
|
||
|
nextsh.find('.slotslide').each(function(i) {
|
||
|
var ss=jQuery(this);
|
||
|
var del = (i*cspeed)/opt.slots;
|
||
|
if (nexttrans==5) del = ((opt.slots-i-1)*cspeed)/(opt.slots)/1.5;
|
||
|
TweenLite.fromTo(ss,cspeed*3,
|
||
|
{top:(0-opt.height),opacity:0.5,rotation:opt.rotate,transformPerspective:600},
|
||
|
{top:0,opacity:1,rotation:0,ease:Power2.easeInOut,delay:del,onComplete:function() {
|
||
|
if (i==opt.slots-1) {
|
||
|
letItFree(container,opt,nextsh,actsh,nextli,actli)
|
||
|
}
|
||
|
}});
|
||
|
|
||
|
});
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
/////////////////////////////////////
|
||
|
// THE SLOTSLIDE - TRANSITION I. //
|
||
|
////////////////////////////////////
|
||
|
if (nexttrans==6) {
|
||
|
|
||
|
|
||
|
if (opt.slots<2) opt.slots=2;
|
||
|
|
||
|
//SET DEFAULT IMG UNVISIBLE
|
||
|
nextsh.find('.defaultimg').css({'opacity':0});
|
||
|
setTimeout(function() {
|
||
|
actsh.find('.defaultimg').css({opacity:0});
|
||
|
},100);
|
||
|
|
||
|
actsh.find('.slotslide').each(function(i) {
|
||
|
var ss=jQuery(this);
|
||
|
|
||
|
if (i<opt.slots/2)
|
||
|
var tempo = (i+2)*60;
|
||
|
else
|
||
|
var tempo = (2+opt.slots-i)*60;
|
||
|
|
||
|
TweenLite.to(ss,(masterspeed+tempo)/1000,{top:0+opt.height,opacity:1,rotation:opt.rotate,transformPerspective:600,ease:Power2.easeInOut});
|
||
|
|
||
|
|
||
|
});
|
||
|
|
||
|
// ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT
|
||
|
nextsh.find('.slotslide').each(function(i) {
|
||
|
var ss=jQuery(this);
|
||
|
|
||
|
if (i<opt.slots/2)
|
||
|
var tempo = (i+2)*60;
|
||
|
else
|
||
|
var tempo = (2+opt.slots-i)*60;
|
||
|
|
||
|
TweenLite.fromTo(ss,(masterspeed+tempo)/1000,
|
||
|
{top:(0-opt.height),opacity:1,rotation:opt.rotate,transformPerspective:600},
|
||
|
{top:(0),opacity:1,rotation:0,ease:Power2.easeInOut,onComplete:function() {
|
||
|
if (i==Math.round(opt.slots/2)) {
|
||
|
letItFree(container,opt,nextsh,actsh,nextli,actli)
|
||
|
}
|
||
|
}});
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
});
|
||
|
}
|
||
|
|
||
|
|
||
|
////////////////////////////////////
|
||
|
// THE SLOTSZOOM - TRANSITION II. //
|
||
|
////////////////////////////////////
|
||
|
if (nexttrans==7) {
|
||
|
|
||
|
masterspeed = masterspeed *2;
|
||
|
|
||
|
//SET DEFAULT IMG UNVISIBLE
|
||
|
nextsh.find('.defaultimg').css({'opacity':0});
|
||
|
setTimeout(function() {
|
||
|
actsh.find('.defaultimg').css({opacity:0});
|
||
|
},100);
|
||
|
// ALL OLD SLOTS SHOULD BE SLIDED TO THE RIGHT
|
||
|
actsh.find('.slotslide').each(function() {
|
||
|
var ss=jQuery(this).find('div');
|
||
|
TweenLite.to(ss,masterspeed/1000,{
|
||
|
left:(0-opt.slotw/2)+'px',
|
||
|
top:(0-opt.height/2)+'px',
|
||
|
width:(opt.slotw*2)+"px",
|
||
|
height:(opt.height*2)+"px",
|
||
|
opacity:0,
|
||
|
rotation:opt.rotate,
|
||
|
transformPerspective:600,
|
||
|
ease:Power2.easeOut});
|
||
|
|
||
|
});
|
||
|
|
||
|
//////////////////////////////////////////////////////////////
|
||
|
// ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT //
|
||
|
///////////////////////////////////////////////////////////////
|
||
|
nextsh.find('.slotslide').each(function(i) {
|
||
|
var ss=jQuery(this).find('div');
|
||
|
|
||
|
TweenLite.fromTo(ss,masterspeed/1000,
|
||
|
{left:0,top:0,opacity:0,transformPerspective:600},
|
||
|
{left:(0-i*opt.slotw)+'px',
|
||
|
ease:Power2.easeOut,
|
||
|
top:(0)+'px',
|
||
|
width:opt.width,
|
||
|
height:opt.height,
|
||
|
opacity:1,rotation:0,
|
||
|
delay:0.1,
|
||
|
onComplete:function() {
|
||
|
letItFree(container,opt,nextsh,actsh,nextli,actli)
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
////////////////////////////////////
|
||
|
// THE SLOTSZOOM - TRANSITION II. //
|
||
|
////////////////////////////////////
|
||
|
if (nexttrans==8) {
|
||
|
|
||
|
masterspeed = masterspeed * 3;
|
||
|
|
||
|
//SET DEFAULT IMG UNVISIBLE
|
||
|
nextsh.find('.defaultimg').css({'opacity':0});
|
||
|
|
||
|
|
||
|
// ALL OLD SLOTS SHOULD BE SLIDED TO THE RIGHT
|
||
|
actsh.find('.slotslide').each(function() {
|
||
|
var ss=jQuery(this).find('div');
|
||
|
|
||
|
TweenLite.to(ss,masterspeed/1000,
|
||
|
{left:(0-opt.width/2)+'px',
|
||
|
top:(0-opt.sloth/2)+'px',
|
||
|
width:(opt.width*2)+"px",
|
||
|
height:(opt.sloth*2)+"px",
|
||
|
transformPerspective:600,
|
||
|
opacity:0,rotation:opt.rotate
|
||
|
|
||
|
});
|
||
|
|
||
|
});
|
||
|
|
||
|
|
||
|
// ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT //
|
||
|
///////////////////////////////////////////////////////////////
|
||
|
nextsh.find('.slotslide').each(function(i) {
|
||
|
var ss=jQuery(this).find('div');
|
||
|
|
||
|
TweenLite.fromTo(ss,masterspeed/1000,
|
||
|
{left:0, top:0,opacity:0,transformPerspective:600},
|
||
|
{'left':(0)+'px',
|
||
|
'top':(0-i*opt.sloth)+'px',
|
||
|
'width':(nextsh.find('.defaultimg').data('neww'))+"px",
|
||
|
'height':(nextsh.find('.defaultimg').data('newh'))+"px",
|
||
|
opacity:1,rotation:0,
|
||
|
onComplete:function() {
|
||
|
letItFree(container,opt,nextsh,actsh,nextli,actli)
|
||
|
}});
|
||
|
|
||
|
});
|
||
|
}
|
||
|
|
||
|
|
||
|
////////////////////////////////////////
|
||
|
// THE SLOTSFADE - TRANSITION III. //
|
||
|
//////////////////////////////////////
|
||
|
if (nexttrans==9 || nexttrans==10) {
|
||
|
|
||
|
|
||
|
nextsh.find('.defaultimg').css({'opacity':0});
|
||
|
|
||
|
var ssamount=0;
|
||
|
// ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT
|
||
|
nextsh.find('.slotslide').each(function(i) {
|
||
|
var ss=jQuery(this);
|
||
|
ssamount++;
|
||
|
TweenLite.fromTo(ss,masterspeed/1000,{opacity:0,transformPerspective:600,left:0,top:0},{opacity:1,ease:Power2.easeInOut,delay:(i*4)/1000});
|
||
|
|
||
|
});
|
||
|
|
||
|
//nextsh.find('.defaultimg').transition({'opacity':1},(masterspeed+(ssamount*4)));
|
||
|
|
||
|
setTimeout(function() {
|
||
|
letItFree(container,opt,nextsh,actsh,nextli,actli)
|
||
|
},(masterspeed+(ssamount*4)));
|
||
|
}
|
||
|
|
||
|
|
||
|
///////////////////////////
|
||
|
// SIMPLE FADE ANIMATION //
|
||
|
///////////////////////////
|
||
|
|
||
|
if (nexttrans==11 || nexttrans==26) {
|
||
|
|
||
|
|
||
|
nextsh.find('.defaultimg').css({'opacity':0,'position':'relative'});
|
||
|
|
||
|
var ssamount=0;
|
||
|
if (nexttrans==26) masterspeed=0;
|
||
|
|
||
|
// ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT
|
||
|
nextsh.find('.slotslide').each(function(i) {
|
||
|
var ss=jQuery(this);
|
||
|
TweenLite.fromTo(ss,masterspeed/1000,{opacity:0},{opacity:1,ease:Power2.easeInOut});
|
||
|
});
|
||
|
|
||
|
setTimeout(function() {
|
||
|
letItFree(container,opt,nextsh,actsh,nextli,actli)
|
||
|
},masterspeed+15);
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
if (nexttrans==12 || nexttrans==13 || nexttrans==14 || nexttrans==15) {
|
||
|
|
||
|
//masterspeed = masterspeed * 3;
|
||
|
|
||
|
|
||
|
setTimeout(function() {
|
||
|
actsh.find('.defaultimg').css({opacity:0});
|
||
|
},100);
|
||
|
nextsh.find('.defaultimg').css({'opacity':0});
|
||
|
|
||
|
// kill();
|
||
|
|
||
|
var oow = opt.width;
|
||
|
var ooh = opt.height;
|
||
|
|
||
|
|
||
|
// ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT
|
||
|
var ssn=nextsh.find('.slotslide')
|
||
|
|
||
|
if (opt.fullWidth=="on" || opt.fullSreen=="on") {
|
||
|
oow=ssn.width();
|
||
|
ooh=ssn.height();
|
||
|
}
|
||
|
var twx = 0;
|
||
|
var twy = 0;
|
||
|
|
||
|
if (nexttrans==12)
|
||
|
twx = oow;
|
||
|
else
|
||
|
if (nexttrans==15)
|
||
|
twx = 0-oow;
|
||
|
else
|
||
|
if (nexttrans==13)
|
||
|
twy = ooh;
|
||
|
else
|
||
|
if (nexttrans==14)
|
||
|
twy = 0-ooh;
|
||
|
|
||
|
// SPECIALS FOR EXTENDED ANIMATIONS
|
||
|
var op = 1;
|
||
|
var scal = 1;
|
||
|
var fromscale = 1;
|
||
|
var easeitout = Power2.easeInOut;
|
||
|
var easeitin = Power2.easeInOut;
|
||
|
var speedy = masterspeed/1000;
|
||
|
var speedy2 = speedy;
|
||
|
|
||
|
// DEPENDING ON EXTENDED SPECIALS, DIFFERENT SCALE AND OPACITY FUNCTIONS NEED TO BE ADDED
|
||
|
if (specials == 1) op = 0;
|
||
|
if (specials == 2) op = 0;
|
||
|
if (specials == 3) {
|
||
|
easeitout = Power2.easeInOut;
|
||
|
easeitin = Power1.easeInOut;
|
||
|
actli.css({'position':'absolute','z-index':20});
|
||
|
nextli.css({'position':'absolute','z-index':15});
|
||
|
speedy = masterspeed / 1200;
|
||
|
}
|
||
|
|
||
|
if (specials==4 || specials==5)
|
||
|
scal=0.6;
|
||
|
if (specials==6 )
|
||
|
scal=1.4;
|
||
|
|
||
|
|
||
|
if (specials==5 || specials==6) {
|
||
|
fromscale=1.4;
|
||
|
op=0;
|
||
|
oow=0;
|
||
|
ooh=0;twx=0;twy=0;
|
||
|
}
|
||
|
if (specials==6) fromscale=0.6;
|
||
|
|
||
|
|
||
|
|
||
|
TweenLite.fromTo(ssn,speedy,
|
||
|
{left:twx, top:twy, scale:fromscale, opacity:op,rotation:opt.rotate},
|
||
|
{opacity:1,rotation:0,left:0,top:0,scale:1,ease:easeitin,onComplete:function() {
|
||
|
letItFree(container,opt,nextsh,actsh,nextli,actli);
|
||
|
actli.css({'position':'absolute','z-index':18});
|
||
|
nextli.css({'position':'absolute','z-index':20});
|
||
|
}
|
||
|
|
||
|
});
|
||
|
|
||
|
var ssa=actsh.find('.slotslide');
|
||
|
|
||
|
if (specials==4 || specials==5) {
|
||
|
oow = 0; ooh=0;
|
||
|
}
|
||
|
|
||
|
if (specials!=1) {
|
||
|
if (nexttrans==12)
|
||
|
TweenLite.to(ssa,speedy2,{'left':(0-oow)+'px',scale:scal,opacity:op,rotation:opt.rotate,ease:easeitout});
|
||
|
else
|
||
|
if (nexttrans==15)
|
||
|
TweenLite.to(ssa,speedy2,{'left':(oow)+'px',scale:scal,opacity:op,rotation:opt.rotate,ease:easeitout});
|
||
|
else
|
||
|
if (nexttrans==13)
|
||
|
TweenLite.to(ssa,speedy2,{'top':(0-ooh)+'px',scale:scal,opacity:op,rotation:opt.rotate,ease:easeitout});
|
||
|
else
|
||
|
if (nexttrans==14)
|
||
|
TweenLite.to(ssa,speedy2,{'top':(ooh)+'px',scale:scal,opacity:op,rotation:opt.rotate,ease:easeitout});
|
||
|
}
|
||
|
nextli.css({'opacity':1});
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
//////////////////////////////////////
|
||
|
// THE SLOTSLIDE - TRANSITION XVI. //
|
||
|
//////////////////////////////////////
|
||
|
if (nexttrans==16) { // PAPERCUT
|
||
|
|
||
|
|
||
|
|
||
|
actli.css({'position':'absolute','z-index':20});
|
||
|
nextli.css({'position':'absolute','z-index':15});
|
||
|
|
||
|
|
||
|
// PREPARE THE CUTS
|
||
|
actli.wrapInner('<div class="tp-half-one" style="position:relative; width:100%;height:100%"></div>');
|
||
|
|
||
|
actli.find('.tp-half-one').clone(true).appendTo(actli).addClass("tp-half-two");
|
||
|
actli.find('.tp-half-two').removeClass('tp-half-one');
|
||
|
|
||
|
var oow = opt.width;
|
||
|
var ooh = opt.height;
|
||
|
if (opt.autoHeight=="on")
|
||
|
ooh = container.height();
|
||
|
|
||
|
|
||
|
actli.find('.tp-half-one .defaultimg').wrap('<div class="tp-papercut" style="width:'+oow+'px;height:'+ooh+'px;"></div>')
|
||
|
|
||
|
actli.find('.tp-half-two .defaultimg').wrap('<div class="tp-papercut" style="width:'+oow+'px;height:'+ooh+'px;"></div>')
|
||
|
|
||
|
actli.find('.tp-half-two .defaultimg').css({position:'absolute',top:'-50%'});
|
||
|
|
||
|
actli.find('.tp-half-two .tp-caption').wrapAll('<div style="position:absolute;top:-50%;left:0px"></div>');
|
||
|
|
||
|
TweenLite.set(actli.find('.tp-half-two'),
|
||
|
{width:oow,height:ooh,overflow:'hidden',zIndex:15,position:'absolute',top:ooh/2,left:'0px',transformPerspective:600,transformOrigin:"center bottom"});
|
||
|
|
||
|
TweenLite.set(actli.find('.tp-half-one'),
|
||
|
{width:oow,height:ooh/2,overflow:'visible',zIndex:10,position:'absolute',top:'0px',left:'0px',transformPerspective:600,transformOrigin:"center top"});
|
||
|
|
||
|
|
||
|
|
||
|
// ANIMATE THE CUTS
|
||
|
var img=actli.find('.defaultimg');
|
||
|
|
||
|
|
||
|
var ro1=Math.round(Math.random()*20-10);
|
||
|
var ro2=Math.round(Math.random()*20-10);
|
||
|
var ro3=Math.round(Math.random()*20-10);
|
||
|
var xof = Math.random()*0.4-0.2;
|
||
|
var yof = Math.random()*0.4-0.2;
|
||
|
var sc1=Math.random()*1+1;
|
||
|
var sc2=Math.random()*1+1;
|
||
|
|
||
|
|
||
|
TweenLite.fromTo(actli.find('.tp-half-one'),masterspeed/1000,
|
||
|
{width:oow,height:ooh/2,position:'absolute',top:'0px',left:'0px',transformPerspective:600,transformOrigin:"center top"},
|
||
|
{scale:sc1,rotation:ro1,y:(0-ooh-ooh/4),ease:Power2.easeInOut});
|
||
|
setTimeout(function() {
|
||
|
TweenLite.set(actli.find('.tp-half-one'),{overflow:'hidden'});
|
||
|
},50);
|
||
|
TweenLite.fromTo(actli.find('.tp-half-one'),masterspeed/2000,{opacity:1,transformPerspective:600,transformOrigin:"center center"},{opacity:0,delay:masterspeed/2000});
|
||
|
|
||
|
TweenLite.fromTo(actli.find('.tp-half-two'),masterspeed/1000,
|
||
|
{width:oow,height:ooh,overflow:'hidden',position:'absolute',top:ooh/2,left:'0px',transformPerspective:600,transformOrigin:"center bottom"},
|
||
|
{scale:sc2,rotation:ro2,y:ooh+ooh/4,ease:Power2.easeInOut});
|
||
|
|
||
|
TweenLite.fromTo(actli.find('.tp-half-two'),masterspeed/2000,{opacity:1,transformPerspective:600,transformOrigin:"center center"},{opacity:0,delay:masterspeed/2000});
|
||
|
|
||
|
if (actli.html()!=null)
|
||
|
TweenLite.fromTo(nextli,(masterspeed-200)/1000,{opacity:0,scale:0.8,x:opt.width*xof, y:ooh*yof,rotation:ro3,transformPerspective:600,transformOrigin:"center center"},{rotation:0,scale:1,x:0,y:0,opacity:1,ease:Power2.easeInOut});
|
||
|
|
||
|
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 .defaultimg').unwrap();
|
||
|
actli.find('.tp-half-one .slotholder').unwrap();
|
||
|
|
||
|
}
|
||
|
actli.find('.tp-half-two').remove();
|
||
|
opt.transition = 0;
|
||
|
opt.act = opt.next;
|
||
|
|
||
|
},masterspeed);
|
||
|
nextli.css({'opacity':1});
|
||
|
|
||
|
}
|
||
|
|
||
|
////////////////////////////////////////
|
||
|
// THE SLOTSLIDE - TRANSITION XVII. //
|
||
|
///////////////////////////////////////
|
||
|
if (nexttrans==17) { // 3D CURTAIN HORIZONTAL
|
||
|
|
||
|
|
||
|
//SET DEFAULT IMG UNVISIBLE
|
||
|
nextsh.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=jQuery(this);
|
||
|
|
||
|
TweenLite.fromTo(ss,(masterspeed)/800,
|
||
|
{opacity:0,rotationY:0,scale:0.9,rotationX:-110,transformPerspective:600,transformOrigin:"center center"},
|
||
|
{opacity:1,top:0,left:0,scale:1,rotation:0,rotationX:0,rotationY:0,ease:Power3.easeOut,delay:j*0.06,onComplete:function() {
|
||
|
if (j==opt.slots-1) letItFree(container,opt,nextsh,actsh,nextli,actli)
|
||
|
}});
|
||
|
|
||
|
});
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
////////////////////////////////////////
|
||
|
// THE SLOTSLIDE - TRANSITION XVIII. //
|
||
|
///////////////////////////////////////
|
||
|
if (nexttrans==18) { // 3D CURTAIN VERTICAL
|
||
|
|
||
|
|
||
|
//SET DEFAULT IMG UNVISIBLE
|
||
|
nextsh.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=jQuery(this);
|
||
|
|
||
|
TweenLite.fromTo(ss,(masterspeed)/500,
|
||
|
{opacity:0,rotationY:310,scale:0.9,rotationX:10,transformPerspective:600,transformOrigin:"center center"},
|
||
|
{opacity:1,top:0,left:0,scale:1,rotation:0,rotationX:0,rotationY:0,ease:Power3.easeOut,delay:j*0.06,onComplete:function() {
|
||
|
if (j==opt.slots-1)
|
||
|
letItFree(container,opt,nextsh,actsh,nextli,actli)
|
||
|
}});
|
||
|
|
||
|
});
|
||
|
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
////////////////////////////////////////
|
||
|
// THE SLOTSLIDE - TRANSITION XIX. //
|
||
|
///////////////////////////////////////
|
||
|
|
||
|
|
||
|
if (nexttrans==19 || nexttrans==22) { // IN CUBE
|
||
|
|
||
|
|
||
|
//SET DEFAULT IMG UNVISIBLE
|
||
|
nextsh.find('.defaultimg').css({'opacity':0});
|
||
|
setTimeout(function() {
|
||
|
actsh.find('.defaultimg').css({opacity:0});
|
||
|
},100);
|
||
|
var chix=nextli.css('z-index');
|
||
|
var chix2=actli.css('z-index');
|
||
|
|
||
|
var rot = 90;
|
||
|
var op = 1;
|
||
|
if (direction==1) rot = -90;
|
||
|
|
||
|
if (nexttrans==19) {
|
||
|
var torig = "center center -"+opt.height/2;
|
||
|
op=0;
|
||
|
|
||
|
} else {
|
||
|
var torig = "center center "+opt.height/2;
|
||
|
|
||
|
}
|
||
|
|
||
|
// ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT
|
||
|
|
||
|
//if (nexttrans==129) {
|
||
|
TweenLite.fromTo(nextsh,masterspeed/2000,{transformPerspective:600,z:0,x:0,rotationY:0},{rotationY:1,ease:Power1.easeInOut,z:-40});
|
||
|
TweenLite.fromTo(nextsh,masterspeed/2000,{transformPerspective:600,z:-40,rotationY:1},{rotationY:0,z:0,ease:Power1.easeInOut,x:0,delay:3*(masterspeed/4000)});
|
||
|
TweenLite.fromTo(actsh,masterspeed/2000,{transformPerspective:600,z:0,x:0,rotationY:0},{rotationY:1,x:0,ease:Power1.easeInOut,z:-40});
|
||
|
TweenLite.fromTo(actsh,masterspeed/2000,{transformPerspective:600,z:-40,x:0,rotationY:1},{rotationY:0,z:0,x:0,ease:Power1.easeInOut,delay:3*(masterspeed/4000)});
|
||
|
//}
|
||
|
|
||
|
nextsh.find('.slotslide').each(function(j) {
|
||
|
var ss=jQuery(this);
|
||
|
|
||
|
TweenLite.fromTo(ss,masterspeed/1000,
|
||
|
{left:0,rotationY:opt.rotate,opacity:op,top:0,scale:0.8,transformPerspective:600,transformOrigin:torig,rotationX:rot},
|
||
|
{left:0,rotationY:0,opacity:1,top:0,z:0, scale:1,rotationX:0, delay:(j*50)/1000,ease:Power2.easeInOut,onComplete: function() {
|
||
|
|
||
|
if (j==opt.slots-1)
|
||
|
letItFree(container,opt,nextsh,actsh,nextli,actli)
|
||
|
}
|
||
|
});
|
||
|
TweenLite.to(ss,0.1,{opacity:1,delay:(j*50)/1000+masterspeed/3000});
|
||
|
|
||
|
});
|
||
|
|
||
|
actsh.find('.slotslide').each(function(j) {
|
||
|
var ss=jQuery(this);
|
||
|
var rot = -90;
|
||
|
if (direction==1) rot = 90;
|
||
|
|
||
|
TweenLite.fromTo(ss,masterspeed/1000,
|
||
|
{opacity:1,rotationY:0,top:0,z:0,scale:1,transformPerspective:600,transformOrigin:torig, rotationX:0},
|
||
|
{opacity:1,rotationY:opt.rotate,top:0, scale:0.8,rotationX:rot, delay:(j*50)/1000,ease:Power2.easeInOut,onComplete: function() {
|
||
|
|
||
|
if (j==opt.slots-1)
|
||
|
letItFree(container,opt,nextsh,actsh,nextli,actli)
|
||
|
}
|
||
|
});
|
||
|
TweenLite.to(ss,0.1,{opacity:0,delay:(j*50)/1000+(masterspeed/1000 - (masterspeed/10000))});
|
||
|
|
||
|
|
||
|
});
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
////////////////////////////////////////
|
||
|
// THE SLOTSLIDE - TRANSITION XX. //
|
||
|
///////////////////////////////////////
|
||
|
if (nexttrans==20 ) { // FLYIN
|
||
|
|
||
|
|
||
|
//SET DEFAULT IMG UNVISIBLE
|
||
|
nextsh.find('.defaultimg').css({'opacity':0});
|
||
|
setTimeout(function() {
|
||
|
actsh.find('.defaultimg').css({opacity:0});
|
||
|
},100);
|
||
|
var chix=nextli.css('z-index');
|
||
|
var chix2=actli.css('z-index');
|
||
|
|
||
|
|
||
|
if (direction==1) {
|
||
|
var ofx = -opt.width
|
||
|
var rot =70;
|
||
|
var torig = "left center -"+opt.height/2;
|
||
|
} else {
|
||
|
var ofx = opt.width;
|
||
|
var rot = -70;
|
||
|
var torig = "right center -"+opt.height/2;
|
||
|
}
|
||
|
|
||
|
|
||
|
nextsh.find('.slotslide').each(function(j) {
|
||
|
var ss=jQuery(this);
|
||
|
//ss.css({overflow:'visible'});
|
||
|
TweenLite.fromTo(ss,masterspeed/1500,
|
||
|
{left:ofx,rotationX:40,z:-600, opacity:op,top:0,transformPerspective:600,transformOrigin:torig,rotationY:rot},
|
||
|
{left:0, delay:(j*50)/1000,ease:Power2.easeInOut});
|
||
|
|
||
|
TweenLite.fromTo(ss,masterspeed/1000,
|
||
|
{rotationX:40,z:-600, opacity:op,top:0,scale:1,transformPerspective:600,transformOrigin:torig,rotationY:rot},
|
||
|
{rotationX:0,opacity:1,top:0,z:0, scale:1,rotationY:0, delay:(j*50)/1000,ease:Power2.easeInOut,onComplete: function() {
|
||
|
|
||
|
if (j==opt.slots-1)
|
||
|
letItFree(container,opt,nextsh,actsh,nextli,actli)
|
||
|
}
|
||
|
});
|
||
|
TweenLite.to(ss,0.1,{opacity:1,delay:(j*50)/1000+masterspeed/2000});
|
||
|
|
||
|
});
|
||
|
|
||
|
|
||
|
|
||
|
actsh.find('.slotslide').each(function(j) {
|
||
|
var ss=jQuery(this);
|
||
|
//ss.css({overflow:'visible'});
|
||
|
if (direction!=1) {
|
||
|
var ofx = -opt.width
|
||
|
var rot =70;
|
||
|
var torig = "left center -"+opt.height/2;
|
||
|
} else {
|
||
|
var ofx = opt.width;
|
||
|
var rot = -70;
|
||
|
var torig = "right center -"+opt.height/2;
|
||
|
}
|
||
|
TweenLite.fromTo(ss,masterspeed/1000,
|
||
|
{opacity:1,rotationX:0,top:0,z:0,scale:1,left:0, transformPerspective:600,transformOrigin:torig, rotationY:0},
|
||
|
{opacity:1,rotationX:40,top:0, z:-600, left:ofx, scale:0.8,rotationY:rot, delay:(j*50)/1000,ease:Power2.easeInOut,onComplete: function() {
|
||
|
|
||
|
if (j==opt.slots-1)
|
||
|
letItFree(container,opt,nextsh,actsh,nextli,actli) }
|
||
|
});
|
||
|
TweenLite.to(ss,0.1,{opacity:0,delay:(j*50)/1000+(masterspeed/1000 - (masterspeed/10000))});
|
||
|
|
||
|
|
||
|
});
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
////////////////////////////////////////
|
||
|
// THE SLOTSLIDE - TRANSITION XX. //
|
||
|
///////////////////////////////////////
|
||
|
if (nexttrans==21 || nexttrans==25) { // TURNOFF
|
||
|
|
||
|
|
||
|
//SET DEFAULT IMG UNVISIBLE
|
||
|
nextsh.find('.defaultimg').css({'opacity':0});
|
||
|
setTimeout(function() {
|
||
|
actsh.find('.defaultimg').css({opacity:0});
|
||
|
},100);
|
||
|
var chix=nextli.css('z-index');
|
||
|
var chix2=actli.css('z-index');
|
||
|
|
||
|
|
||
|
if (direction==1) {
|
||
|
var ofx = -opt.width
|
||
|
var rot =110;
|
||
|
|
||
|
if (nexttrans==25) {
|
||
|
var torig = "center top 0"
|
||
|
rot2 = -rot;
|
||
|
rot = opt.rotate;
|
||
|
} else {
|
||
|
var torig = "left center 0";
|
||
|
rot2 = opt.rotate;
|
||
|
}
|
||
|
|
||
|
} else {
|
||
|
var ofx = opt.width;
|
||
|
var rot = -110;
|
||
|
if (nexttrans==25) {
|
||
|
var torig = "center bottom 0"
|
||
|
rot2 = -rot;
|
||
|
rot = opt.rotate;
|
||
|
} else {
|
||
|
var torig = "right center 0";
|
||
|
rot2 = opt.rotate;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
nextsh.find('.slotslide').each(function(j) {
|
||
|
var ss=jQuery(this);
|
||
|
|
||
|
|
||
|
TweenLite.fromTo(ss,masterspeed/1500,
|
||
|
{left:0,rotationX:rot2,z:0, opacity:0,top:0,scale:1,transformPerspective:600,transformOrigin:torig,rotationY:rot},
|
||
|
{left:0,rotationX:0,top:0,z:0, scale:1,rotationY:0, delay:(j*100)/1000+masterspeed/10000,ease:Power2.easeInOut,onComplete: function() {
|
||
|
|
||
|
if (j==opt.slots-1)
|
||
|
letItFree(container,opt,nextsh,actsh,nextli,actli)
|
||
|
}
|
||
|
});
|
||
|
TweenLite.to(ss,0.3,{opacity:1,delay:(j*100)/1000+(masterspeed*0.2)/2000+masterspeed/10000});
|
||
|
|
||
|
});
|
||
|
|
||
|
|
||
|
|
||
|
if (direction!=1) {
|
||
|
var ofx = -opt.width
|
||
|
var rot = 90;
|
||
|
|
||
|
if (nexttrans==25) {
|
||
|
var torig = "center top 0"
|
||
|
rot2 = -rot;
|
||
|
rot = opt.rotate;
|
||
|
} else {
|
||
|
var torig = "left center 0";
|
||
|
rot2 = opt.rotate;
|
||
|
}
|
||
|
|
||
|
} else {
|
||
|
var ofx = opt.width;
|
||
|
var rot = -90;
|
||
|
if (nexttrans==25) {
|
||
|
var torig = "center bottom 0"
|
||
|
rot2 = -rot;
|
||
|
rot = opt.rotate;
|
||
|
} else {
|
||
|
var torig = "right center 0";
|
||
|
rot2 = opt.rotate;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
actsh.find('.slotslide').each(function(j) {
|
||
|
var ss=jQuery(this);
|
||
|
|
||
|
|
||
|
TweenLite.fromTo(ss,masterspeed/3000,
|
||
|
{left:0,rotationX:0,z:0, opacity:1,top:0,scale:1,transformPerspective:600,transformOrigin:torig,rotationY:0},
|
||
|
{left:0,rotationX:rot2,top:0,z:0, scale:1,rotationY:rot, delay:(j*100)/1000,ease:Power1.easeInOut});
|
||
|
TweenLite.to(ss,0.2,{opacity:0,delay:(j*50)/1000+(masterspeed/3000 - (masterspeed/10000))});
|
||
|
|
||
|
|
||
|
});
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
////////////////////////////////////////
|
||
|
// THE SLOTSLIDE - TRANSITION XX. //
|
||
|
///////////////////////////////////////
|
||
|
if (nexttrans==23 || nexttrans == 24) { // cube-horizontal - inboxhorizontal
|
||
|
|
||
|
|
||
|
//SET DEFAULT IMG UNVISIBLE
|
||
|
nextsh.find('.defaultimg').css({'opacity':0});
|
||
|
setTimeout(function() {
|
||
|
actsh.find('.defaultimg').css({opacity:0});
|
||
|
},100);
|
||
|
var chix=nextli.css('z-index');
|
||
|
var chix2=actli.css('z-index');
|
||
|
|
||
|
var rot = -90;
|
||
|
if (direction==1)
|
||
|
rot = 90;
|
||
|
|
||
|
var op = 1;
|
||
|
|
||
|
|
||
|
if (nexttrans==23) {
|
||
|
var torig = "center center -"+opt.width/2;
|
||
|
op=0;
|
||
|
|
||
|
} else {
|
||
|
var torig = "center center "+opt.width/2;
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
var opx=0;
|
||
|
|
||
|
// ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT
|
||
|
TweenLite.fromTo(nextsh,masterspeed/2000,{transformPerspective:600,z:0,x:0,rotationY:0},{rotationY:1,ease:Power1.easeInOut,z:-90});
|
||
|
TweenLite.fromTo(nextsh,masterspeed/2000,{transformPerspective:600,z:-90,rotationY:1},{rotationY:0,z:0,ease:Power1.easeInOut,x:0,delay:3*(masterspeed/4000)});
|
||
|
TweenLite.fromTo(actsh,masterspeed/2000,{transformPerspective:600,z:0,x:0,rotationY:0},{rotationY:1,x:0,ease:Power1.easeInOut,z:-90});
|
||
|
TweenLite.fromTo(actsh,masterspeed/2000,{transformPerspective:600,z:-90,x:0,rotationY:1},{rotationY:0,z:0,x:0,ease:Power1.easeInOut,delay:3*(masterspeed/4000)});
|
||
|
|
||
|
nextsh.find('.slotslide').each(function(j) {
|
||
|
var ss=jQuery(this);
|
||
|
|
||
|
TweenLite.fromTo(ss,masterspeed/1000,
|
||
|
{left:opx,rotationX:opt.rotate,opacity:op,top:0,scale:1,transformPerspective:600,transformOrigin:torig,rotationY:rot},
|
||
|
{left:0,rotationX:0,opacity:1,top:0,z:0, scale:1,rotationY:0, delay:(j*50)/1000,ease:Power2.easeInOut,onComplete: function() {
|
||
|
|
||
|
if (j==opt.slots-1)
|
||
|
letItFree(container,opt,nextsh,actsh,nextli,actli);
|
||
|
|
||
|
}
|
||
|
});
|
||
|
TweenLite.to(ss,0.1,{opacity:1,delay:(j*50)/1000+masterspeed/3000});
|
||
|
|
||
|
});
|
||
|
|
||
|
rot = 90;
|
||
|
if (direction==1)
|
||
|
rot = -90;
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
actsh.find('.slotslide').each(function(j) {
|
||
|
var ss=jQuery(this);
|
||
|
TweenLite.fromTo(ss,masterspeed/1000,
|
||
|
{left:0,opacity:1,rotationX:0,top:0,z:0,scale:1,transformPerspective:600,transformOrigin:torig, rotationY:0},
|
||
|
{left:opx,opacity:1,rotationX:opt.rotate,top:0, scale:1,rotationY:rot, delay:(j*50)/1000,ease:Power2.easeInOut,onComplete: function() {
|
||
|
|
||
|
if (j==opt.slots-1)
|
||
|
letItFree(container,opt,nextsh,actsh,nextli,actli)
|
||
|
|
||
|
}
|
||
|
});
|
||
|
TweenLite.to(ss,0.1,{opacity:0,delay:(j*50)/1000+(masterspeed/1000 - (masterspeed/10000))});
|
||
|
|
||
|
|
||
|
});
|
||
|
}
|
||
|
|
||
|
|
||
|
var data={};
|
||
|
data.slideIndex=opt.next+1;
|
||
|
container.trigger('revolution.slide.onchange',data);
|
||
|
setTimeout(function() { container.trigger('revolution.slide.onafterswap'); },masterspeed);
|
||
|
container.trigger('revolution.slide.onvideostop');
|
||
|
}
|
||
|
|
||
|
|
||
|
/******************************
|
||
|
- STOP KEN BURN -
|
||
|
********************************/
|
||
|
function stopKenBurn(container,opt) {
|
||
|
try{
|
||
|
var actli = container.find('>ul:first-child >li:eq('+opt.act+')');
|
||
|
} catch(e) {
|
||
|
var actli=container.find('>ul:first-child >li:eq(1)');
|
||
|
}
|
||
|
|
||
|
opt.lastslide=opt.act;
|
||
|
|
||
|
var nextli = container.find('>ul:first-child >li:eq('+opt.next+')');
|
||
|
|
||
|
|
||
|
var actsh = actli.find('.slotholder');
|
||
|
var nextsh = nextli.find('.slotholder');
|
||
|
|
||
|
nextsh.find('.defaultimg').each(function() {
|
||
|
var defimg = jQuery(this);
|
||
|
if (defimg.data('kenburn')!=undefined)
|
||
|
defimg.data('kenburn').restart();
|
||
|
TweenLite.killTweensOf(defimg,false);
|
||
|
TweenLite.set(defimg,{scale:1,rotationZ:0});
|
||
|
|
||
|
defimg.data('bgposition',nextsh.data('bgposition'));
|
||
|
defimg.data('currotate',nextsh.data('rotationstart'));
|
||
|
defimg.data('curscale',nextsh.data('bgfit'));
|
||
|
|
||
|
});
|
||
|
/*actsh.find('.defaultimg').each(function() {
|
||
|
var defimg = jQuery(this);
|
||
|
TweenLite.killTweensOf(defimg,false);
|
||
|
TweenLite.set(defimg,{scale:1,rotationZ:0});
|
||
|
if (defimg.data('oldbgposition')!=undefined)
|
||
|
defimg.data('bgposition',defimg.data('oldbgposition'));
|
||
|
|
||
|
defimg.data('currotate',nextsh.data('rotationstart'));
|
||
|
defimg.data('curscale',nextsh.data('zoomstart')/100);
|
||
|
|
||
|
});*/
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
/******************************
|
||
|
- startKenBurn -
|
||
|
********************************/
|
||
|
function startKenBurn(container,opt) {
|
||
|
|
||
|
try{
|
||
|
var actli = container.find('>ul:first-child >li:eq('+opt.act+')');
|
||
|
} catch(e) {
|
||
|
var actli=container.find('>ul:first-child >li:eq(1)');
|
||
|
}
|
||
|
|
||
|
opt.lastslide=opt.act;
|
||
|
|
||
|
var nextli = container.find('>ul:first-child >li:eq('+opt.next+')');
|
||
|
|
||
|
|
||
|
var actsh = actli.find('.slotholder');
|
||
|
var nextsh = nextli.find('.slotholder');
|
||
|
|
||
|
var
|
||
|
bgps = nextsh.data('bgposition'),
|
||
|
bgpe = nextsh.data('bgpositionend'),
|
||
|
zos = nextsh.data('zoomstart')/100,
|
||
|
zoe = nextsh.data('zoomend')/100,
|
||
|
ros = nextsh.data('rotationstart'),
|
||
|
roe = nextsh.data('rotationend'),
|
||
|
bgfs = nextsh.data('bgfit'),
|
||
|
bgfe = nextsh.data('bgfitend'),
|
||
|
easeme = nextsh.data('easeme'),
|
||
|
dur = nextsh.data('duration')/1000;
|
||
|
|
||
|
if (bgfs==undefined) bgfs=100;
|
||
|
if (bgfe==undefined) bgfe=100;
|
||
|
|
||
|
bgfs = calculateKenBurnScales(bgfs,nextsh,opt);
|
||
|
bgfe = calculateKenBurnScales(bgfe,nextsh,opt);
|
||
|
|
||
|
|
||
|
if (zos==undefined) zos=1;
|
||
|
if (zoe==undefined) zoe=1;
|
||
|
if (ros==undefined) ros=0;
|
||
|
if (roe==undefined) roe=0;
|
||
|
|
||
|
if (zos<1) zos=1;
|
||
|
if (zoe<1) zoe=1;
|
||
|
|
||
|
|
||
|
|
||
|
nextsh.find('.defaultimg').each(function() {
|
||
|
var defimg = jQuery(this);
|
||
|
|
||
|
defimg.data('kenburn',TweenLite.fromTo(defimg,dur,{transformPerspective:1200, backgroundSize:bgfs, z:0,backgroundPosition:bgps,rotationZ:ros},{yoyo:2,rotationZ:roe,ease:easeme,backgroundSize:bgfe,backgroundPosition:bgpe,onUpdate:function() {
|
||
|
defimg.data('bgposition',defimg.css('backgroundPosition'));
|
||
|
if (!isIE(8)) defimg.data('currotate',getRotationDegrees(defimg));
|
||
|
if (!isIE(8)) defimg.data('curscale',defimg.css('backgroundSize'));
|
||
|
}})
|
||
|
);
|
||
|
|
||
|
})
|
||
|
}
|
||
|
|
||
|
|
||
|
/***********************************************
|
||
|
- KEN BURN BACKGROUND FIT CALCULATOR -
|
||
|
***********************************************/
|
||
|
function calculateKenBurnScales(proc,sloth,opt) {
|
||
|
var ow = sloth.data('owidth');
|
||
|
var oh = sloth.data('oheight');
|
||
|
|
||
|
var factor = (opt.container.width() /ow);
|
||
|
var nheight = oh * factor;
|
||
|
|
||
|
var hfactor = (nheight / opt.container.height())*proc;
|
||
|
|
||
|
|
||
|
|
||
|
return (proc+"% "+hfactor+"%");
|
||
|
}
|
||
|
|
||
|
|
||
|
/******************************************************
|
||
|
- CALCULATE CURRENT SCALE AND ROTATION -
|
||
|
*******************************************************/
|
||
|
|
||
|
function getMatrix(obj) {
|
||
|
var matrix = obj.css("-webkit-transform") ||
|
||
|
obj.css("-moz-transform") ||
|
||
|
obj.css("-ms-transform") ||
|
||
|
obj.css("-o-transform") ||
|
||
|
obj.css("transform");
|
||
|
return matrix;
|
||
|
};
|
||
|
|
||
|
function parseMatrix(_str) {
|
||
|
return _str.replace(/^matrix(3d)?\((.*)\)$/,'$2').split(/, /);
|
||
|
}
|
||
|
|
||
|
function getScaleDegrees(obj) {
|
||
|
var matrix = parseMatrix(getMatrix(obj)),
|
||
|
scale = 1;
|
||
|
|
||
|
if(matrix[0] !== 'none') {
|
||
|
var a = matrix[0],
|
||
|
b = matrix[1],
|
||
|
d = 10;
|
||
|
scale = Math.round( Math.sqrt( a*a + b*b ) * d ) / d;
|
||
|
}
|
||
|
|
||
|
return scale;
|
||
|
};
|
||
|
|
||
|
function getRotationDegrees(obj) {
|
||
|
var matrix = obj.css("-webkit-transform") ||
|
||
|
obj.css("-moz-transform") ||
|
||
|
obj.css("-ms-transform") ||
|
||
|
obj.css("-o-transform") ||
|
||
|
obj.css("transform");
|
||
|
if(matrix !== 'none') {
|
||
|
var values = matrix.split('(')[1].split(')')[0].split(',');
|
||
|
var a = values[0];
|
||
|
var b = values[1];
|
||
|
var angle = Math.round(Math.atan2(b, a) * (180/Math.PI));
|
||
|
} else { var angle = 0; }
|
||
|
return (angle < 0) ? angle +=360 : angle;
|
||
|
}
|
||
|
|
||
|
/**************************************
|
||
|
- GIVE FREE THE TRANSITIOSN -
|
||
|
**************************************/
|
||
|
function letItFree(container,opt,nextsh,actsh,nextli,actli) {
|
||
|
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);
|
||
|
if (nextsh.data('kenburns')=="on")
|
||
|
startKenBurn(container,opt);
|
||
|
}
|
||
|
|
||
|
|
||
|
//////////////////////////////////////////
|
||
|
// CHANG THE YOUTUBE PLAYER STATE HERE //
|
||
|
////////////////////////////////////////
|
||
|
function onPlayerStateChange(event) {
|
||
|
|
||
|
var embedCode = event.target.getVideoEmbedCode();
|
||
|
var ytcont = jQuery('#'+embedCode.split('id="')[1].split('"')[0])
|
||
|
var container = ytcont.closest('.tp-simpleresponsive');
|
||
|
var player = ytcont.parent().data('player');
|
||
|
|
||
|
if (event.data == YT.PlayerState.PLAYING) {
|
||
|
|
||
|
var bt = container.find('.tp-bannertimer');
|
||
|
var opt = bt.data('opt');
|
||
|
|
||
|
|
||
|
if (ytcont.closest('.tp-caption').data('volume')=="mute")
|
||
|
player.mute();
|
||
|
|
||
|
opt.videoplaying=true;
|
||
|
//konsole.log("VideoPlay set to True due onPlayerStateChange PLAYING");
|
||
|
opt.videostartednow=1;
|
||
|
|
||
|
} else {
|
||
|
|
||
|
var bt = container.find('.tp-bannertimer');
|
||
|
var opt = bt.data('opt');
|
||
|
|
||
|
if (event.data!=-1) {
|
||
|
opt.videoplaying=false;
|
||
|
opt.videostoppednow=1;
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|
||
|
if (event.data==0 && opt.nextslideatend==true)
|
||
|
opt.container.revnext();
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
////////////////////////
|
||
|
// VIMEO ADD EVENT /////
|
||
|
////////////////////////
|
||
|
function addEvent(element, eventName, callback) {
|
||
|
|
||
|
if (element.addEventListener) element.addEventListener(eventName, callback, false);
|
||
|
else
|
||
|
element.attachEvent(eventName, callback, false);
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
/////////////////////////////////////
|
||
|
// EVENT HANDLING FOR VIMEO VIDEOS //
|
||
|
/////////////////////////////////////
|
||
|
|
||
|
function vimeoready_auto(player_id,autoplay) {
|
||
|
|
||
|
var froogaloop = $f(player_id);
|
||
|
var vimcont = jQuery('#'+player_id);
|
||
|
var container = vimcont.closest('.tp-simpleresponsive');
|
||
|
|
||
|
|
||
|
froogaloop.addEvent('ready', function(data) {
|
||
|
if(autoplay) froogaloop.api('play');
|
||
|
|
||
|
froogaloop.addEvent('play', function(data) {
|
||
|
var bt = container.find('.tp-bannertimer');
|
||
|
var opt = bt.data('opt');
|
||
|
|
||
|
opt.videoplaying=true;
|
||
|
if (vimcont.closest('.tp-caption').data('volume')=="mute")
|
||
|
froogaloop.api('setVolume',"0");
|
||
|
//konsole.log("VideoPlay set to True due vimeoready_auto PLAYING");
|
||
|
});
|
||
|
|
||
|
froogaloop.addEvent('finish', function(data) {
|
||
|
var bt = container.find('.tp-bannertimer');
|
||
|
var opt = bt.data('opt');
|
||
|
opt.videoplaying=false;
|
||
|
//konsole.log("VideoPlay set to False due vimeoready_auto FINISH");
|
||
|
opt.videostartednow=1;
|
||
|
if (opt.nextslideatend==true)
|
||
|
opt.container.revnext();
|
||
|
|
||
|
});
|
||
|
|
||
|
froogaloop.addEvent('pause', function(data) {
|
||
|
var bt = container.find('.tp-bannertimer');
|
||
|
var opt = bt.data('opt');
|
||
|
opt.videoplaying=false;
|
||
|
//konsole.log("VideoPlay set to False due vimeoready_auto PAUSE");
|
||
|
opt.videostoppednow=1;
|
||
|
});
|
||
|
});
|
||
|
}
|
||
|
|
||
|
|
||
|
///////////////////////////////////////
|
||
|
// EVENT HANDLING FOR VIDEO JS VIDEOS //
|
||
|
////////////////////////////////////////
|
||
|
function html5vidready(myPlayer,player_id) {
|
||
|
|
||
|
if (player_id==undefined) player_id = jQuery(myPlayer["b"]).attr('id');
|
||
|
var player_cont = jQuery('#'+player_id);
|
||
|
var container = player_cont.closest('.tp-simpleresponsive');
|
||
|
|
||
|
|
||
|
|
||
|
myPlayer.on("canplay",function() {
|
||
|
|
||
|
player_cont.data('canplay',1);
|
||
|
});
|
||
|
|
||
|
myPlayer.on("play",function() {
|
||
|
|
||
|
if (player_cont.closest('.tp-caption').data('volume')=="mute")
|
||
|
myPlayer.volume(0);
|
||
|
var bt = jQuery('body').find('.tp-bannertimer');
|
||
|
var opt = bt.data('opt');
|
||
|
|
||
|
try{
|
||
|
opt.videoplaying=true;
|
||
|
} catch(e) {}
|
||
|
|
||
|
|
||
|
//konsole.log("VideoPlay set to True due html5vidready PLAYING");
|
||
|
});
|
||
|
|
||
|
myPlayer.on("pause",function() {
|
||
|
var bt = container.find('.tp-bannertimer');
|
||
|
var opt = bt.data('opt');
|
||
|
opt.videoplaying=false;
|
||
|
//konsole.log("VideoPlay set to False due html5vidready pause");
|
||
|
opt.videostoppednow=1;
|
||
|
});
|
||
|
|
||
|
myPlayer.on("ended",function() {
|
||
|
var bt = container.find('.tp-bannertimer');
|
||
|
var opt = bt.data('opt');
|
||
|
opt.videoplaying=false;
|
||
|
//konsole.log("VideoPlay set to False due html5vidready pause");
|
||
|
opt.videostoppednow=1;
|
||
|
if (opt.nextslideatend==true)
|
||
|
opt.container.revnext();
|
||
|
});
|
||
|
|
||
|
|
||
|
myPlayer.on('loadedmetadata', function(data) {
|
||
|
|
||
|
player_cont.data('loadedmetadata',1);
|
||
|
|
||
|
|
||
|
var videoWidth =0;
|
||
|
var videoHeight=0;
|
||
|
|
||
|
for(var prop in this) {
|
||
|
try{
|
||
|
if(this[prop].hasOwnProperty('videoWidth'))
|
||
|
videoWidth = this[prop].videoWidth;
|
||
|
|
||
|
if(this[prop].hasOwnProperty('videoHeight'))
|
||
|
videoHeight = this[prop].videoHeight;
|
||
|
} catch(e) {}
|
||
|
}
|
||
|
|
||
|
|
||
|
var mediaAspect = videoWidth/videoHeight;
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
if (player_cont.data('mediaAspect') == undefined) player_cont.data('mediaAspect',mediaAspect);
|
||
|
if (player_cont.closest('.tp-caption').data('forcecover')==1)
|
||
|
updateHTML5Size(player_cont,container);
|
||
|
|
||
|
});
|
||
|
|
||
|
}
|
||
|
/////////////////////////////////////
|
||
|
// RESIZE HTML5VIDEO FOR FULLSCREEN//
|
||
|
/////////////////////////////////////
|
||
|
function updateHTML5Size(pc,container) {
|
||
|
var windowW = container.width();
|
||
|
var windowH = container.height();
|
||
|
var mediaAspect = pc.data('mediaAspect');
|
||
|
|
||
|
var windowAspect = windowW/windowH;
|
||
|
pc.parent().find('.vjs-poster').css({width:"100%",height:"100%"});
|
||
|
if (windowAspect < mediaAspect) {
|
||
|
// taller
|
||
|
pc
|
||
|
.width(windowH*mediaAspect)
|
||
|
.height(windowH);
|
||
|
pc
|
||
|
.css('top',0)
|
||
|
.css('left',-(windowH*mediaAspect-windowW)/2)
|
||
|
.css('height',windowH);
|
||
|
pc.find('.vjs-tech').css('width',windowH*mediaAspect);
|
||
|
|
||
|
} else {
|
||
|
// wider
|
||
|
pc
|
||
|
.width(windowW)
|
||
|
.height(windowW/mediaAspect);
|
||
|
pc
|
||
|
.css('top',-(windowW/mediaAspect-windowH)/2)
|
||
|
.css('left',0)
|
||
|
.css('height',windowW/mediaAspect);
|
||
|
pc.find('.vjs-tech').css('width','100%');
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
/////////////////////////////////////
|
||
|
// - CREATE ANIMATION OBJECT - //
|
||
|
/////////////////////////////////////
|
||
|
|
||
|
function newAnimObject() {
|
||
|
var a = new Object();
|
||
|
a.x=0;
|
||
|
a.y=0;
|
||
|
a.rotationX = 0;
|
||
|
a.rotationY = 0;
|
||
|
a.rotationZ = 0;
|
||
|
a.scale = 1;
|
||
|
a.scaleX = 1;
|
||
|
a.scaleY = 1;
|
||
|
a.skewX = 0;
|
||
|
a.skewY = 0;
|
||
|
a.opacity=0;
|
||
|
a.transformOrigin = "center, center";
|
||
|
a.transformPerspective = 400;
|
||
|
a.rotation = 0;
|
||
|
return a;
|
||
|
}
|
||
|
|
||
|
///////////////////////////////////////////////////
|
||
|
// ANALYSE AND READ OUT DATAS FROM HTML CAPTIONS //
|
||
|
///////////////////////////////////////////////////
|
||
|
function getAnimDatas(frm,data) {
|
||
|
|
||
|
var customarray = data.split(';');
|
||
|
jQuery.each(customarray,function(index,param) {
|
||
|
|
||
|
param = param.split(":")
|
||
|
|
||
|
var w = param[0],
|
||
|
v = param[1];
|
||
|
if (w=="rotationX") frm.rotationX = parseInt(v,0);
|
||
|
if (w=="rotationY") frm.rotationY = parseInt(v,0);
|
||
|
if (w=="rotationZ") frm.rotationZ = parseInt(v,0);
|
||
|
if (w=="rotationZ") frm.rotation = parseInt(v,0);
|
||
|
if (w=="scaleX") frm.scaleX = parseFloat(v);
|
||
|
if (w=="scaleY") frm.scaleY = parseFloat(v);
|
||
|
if (w=="opacity") frm.opacity = parseFloat(v);
|
||
|
if (w=="skewX") frm.skewX = parseInt(v,0);
|
||
|
if (w=="skewY") frm.skewY = parseInt(v,0);
|
||
|
if (w=="x") frm.x = parseInt(v,0);
|
||
|
if (w=="y") frm.y = parseInt(v,0);
|
||
|
if (w=="z") frm.z = parseInt(v,0);
|
||
|
if (w=="transformOrigin") frm.transformOrigin = v.toString();
|
||
|
if (w=="transformPerspective") frm.transformPerspective=parseInt(v,0);
|
||
|
})
|
||
|
|
||
|
return frm;
|
||
|
}
|
||
|
///////////////////////////////////////////////////////////////////
|
||
|
// ANALYSE AND READ OUT DATAS FROM HTML CAPTIONS ANIMATION STEPS //
|
||
|
///////////////////////////////////////////////////////////////////
|
||
|
function getAnimSteps(data) {
|
||
|
|
||
|
var paramarray = data.split("animation:");
|
||
|
var params = new Object();
|
||
|
|
||
|
params.animation = getAnimDatas(newAnimObject(),paramarray[1]);
|
||
|
var customarray = paramarray[0].split(';');
|
||
|
|
||
|
jQuery.each(customarray,function(index,param) {
|
||
|
param = param.split(":")
|
||
|
var w = param[0],
|
||
|
v = param[1];
|
||
|
if (w=="typ") params.typ = v;
|
||
|
if (w=="speed") params.speed = parseInt(v,0)/1000;
|
||
|
if (w=="start") params.start = parseInt(v,0)/1000;
|
||
|
if (w=="elementdelay") params.elementdelay = parseFloat(v);
|
||
|
if (w=="ease") params.ease = v;
|
||
|
})
|
||
|
|
||
|
return params;
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
////////////////////////
|
||
|
// SHOW THE CAPTION //
|
||
|
///////////////////////
|
||
|
function animateTheCaptions(nextli, opt,recalled) {
|
||
|
|
||
|
var offsetx=0;
|
||
|
var offsety=0;
|
||
|
|
||
|
nextli.find('.tp-caption').each(function(i) {
|
||
|
|
||
|
|
||
|
offsetx = opt.width/2 - (opt.startwidth*opt.bw)/2;
|
||
|
|
||
|
|
||
|
|
||
|
var xbw = opt.bw;
|
||
|
var xbh = opt.bh;
|
||
|
|
||
|
|
||
|
if (opt.fullScreen=="on")
|
||
|
offsety = opt.height/2 - (opt.startheight*opt.bh)/2;
|
||
|
|
||
|
if (opt.autoHeight=="on")
|
||
|
offsety = opt.container.height()/2 - (opt.startheight*opt.bh)/2;;
|
||
|
|
||
|
if (offsety<0) offsety=0;
|
||
|
|
||
|
var nextcaption=jQuery(this);//nextli.find('.tp-caption:eq('+i+')');
|
||
|
|
||
|
var handlecaption=0;
|
||
|
|
||
|
// HIDE CAPTION IF RESOLUTION IS TOO LOW
|
||
|
if (opt.width<opt.hideCaptionAtLimit && nextcaption.data('captionhidden')=="on") {
|
||
|
nextcaption.addClass("tp-hidden-caption")
|
||
|
handlecaption=1;
|
||
|
} else {
|
||
|
if (opt.width<opt.hideAllCaptionAtLimit || opt.width<opt.hideAllCaptionAtLilmit) {
|
||
|
nextcaption.addClass("tp-hidden-caption")
|
||
|
handlecaption=1;
|
||
|
} else {
|
||
|
nextcaption.removeClass("tp-hidden-caption")
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
if (handlecaption==0) {
|
||
|
|
||
|
// ADD A CLICK LISTENER TO THE CAPTION
|
||
|
if (nextcaption.data('linktoslide')!=undefined && !nextcaption.hasClass("hasclicklistener")) {
|
||
|
nextcaption.addClass("hasclicklistener")
|
||
|
nextcaption.css({'cursor':'pointer'});
|
||
|
if (nextcaption.data('linktoslide')!="no") {
|
||
|
nextcaption.click(function() {
|
||
|
var nextcaption=jQuery(this);
|
||
|
var dir = nextcaption.data('linktoslide');
|
||
|
if (dir!="next" && dir!="prev") {
|
||
|
opt.container.data('showus',dir);
|
||
|
opt.container.parent().find('.tp-rightarrow').click();
|
||
|
} else
|
||
|
if (dir=="next")
|
||
|
opt.container.parent().find('.tp-rightarrow').click();
|
||
|
else
|
||
|
if (dir=="prev")
|
||
|
opt.container.parent().find('.tp-leftarrow').click();
|
||
|
});
|
||
|
}
|
||
|
}// END OF CLICK LISTENER
|
||
|
|
||
|
|
||
|
if (offsetx<0) offsetx=0;
|
||
|
|
||
|
|
||
|
// YOUTUBE AND VIMEO LISTENRES INITIALISATION
|
||
|
|
||
|
var frameID = "iframe"+Math.round(Math.random()*1000+1);
|
||
|
|
||
|
if (nextcaption.find('iframe').length>0 || nextcaption.find('video').length>0) {
|
||
|
|
||
|
if (nextcaption.data('autoplayonlyfirsttime') == true || nextcaption.data('autoplayonlyfirsttime')=="true" ) {
|
||
|
nextcaption.data('autoplay',true);
|
||
|
}
|
||
|
|
||
|
nextcaption.find('iframe').each(function() {
|
||
|
var ifr=jQuery(this);
|
||
|
|
||
|
|
||
|
// START YOUTUBE HANDLING
|
||
|
opt.nextslideatend = nextcaption.data('nextslideatend');
|
||
|
if (nextcaption.data('thumbimage')!=undefined && nextcaption.data('thumbimage').length>2 && nextcaption.data('autoplay')!=true && !recalled) {
|
||
|
nextcaption.find('.tp-thumb-image').remove();
|
||
|
nextcaption.append('<div class="tp-thumb-image" style="cursor:pointer; position:absolute;top:0px;left:0px;width:100%;height:100%;background-image:url('+nextcaption.data('thumbimage')+'); background-size:cover"></div>');
|
||
|
}
|
||
|
|
||
|
if (ifr.attr('src').toLowerCase().indexOf('youtube')>=0) {
|
||
|
|
||
|
if (!ifr.hasClass("HasListener")) {
|
||
|
try {
|
||
|
ifr.attr('id',frameID);
|
||
|
|
||
|
var player;
|
||
|
var ytint = setInterval(function() {
|
||
|
if (YT !=undefined)
|
||
|
if (typeof YT.Player != undefined && typeof YT.Player !="undefined") {
|
||
|
|
||
|
if (nextcaption.data('autoplay')==true) {
|
||
|
player = new YT.Player(frameID, {
|
||
|
events: {
|
||
|
"onStateChange": onPlayerStateChange,
|
||
|
'onReady': function(event) {
|
||
|
event.target.playVideo();
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
} else
|
||
|
player = new YT.Player(frameID, {
|
||
|
events: {
|
||
|
"onStateChange": onPlayerStateChange
|
||
|
}
|
||
|
});
|
||
|
ifr.addClass("HasListener");
|
||
|
|
||
|
nextcaption.data('player',player);
|
||
|
clearInterval(ytint);
|
||
|
}
|
||
|
}
|
||
|
, 100)
|
||
|
|
||
|
|
||
|
|
||
|
} catch(e) {}
|
||
|
} else {
|
||
|
if (nextcaption.data('autoplay')==true) {
|
||
|
var player=nextcaption.data('player');
|
||
|
nextcaption.data('timerplay',setTimeout(function() {
|
||
|
if (nextcaption.data('forcerewind')=="on")
|
||
|
player.seekTo(0);
|
||
|
player.playVideo();
|
||
|
},nextcaption.data('start')));
|
||
|
}
|
||
|
} // END YOUTUBE HANDLING
|
||
|
|
||
|
// PLAY VIDEO IF THUMBNAIL HAS BEEN CLICKED
|
||
|
nextcaption.find('.tp-thumb-image').click(function() {
|
||
|
TweenLite.to(jQuery(this),0.3,{opacity:0,ease:Power3.easeInOut,onComplete: function() {
|
||
|
nextcaption.find('.tp-thumb-image').remove();
|
||
|
}
|
||
|
})
|
||
|
var player=nextcaption.data('player');
|
||
|
player.playVideo();
|
||
|
})
|
||
|
} else {
|
||
|
// START VIMEO HANDLING
|
||
|
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];
|
||
|
var vimint = setInterval(function() {
|
||
|
if ($f !=undefined)
|
||
|
if (typeof $f(frameID).api != undefined && typeof $f(frameID).api !="undefined") {
|
||
|
$f(player).addEvent('ready', function(){
|
||
|
vimeoready_auto(frameID,nextcaption.data('autoplay'))
|
||
|
});
|
||
|
clearInterval(vimint);
|
||
|
}
|
||
|
},100);
|
||
|
|
||
|
} else {
|
||
|
if (nextcaption.data('autoplay')==true) {
|
||
|
|
||
|
var ifr = nextcaption.find('iframe');
|
||
|
var id = ifr.attr('id');
|
||
|
var vimint = setInterval(function() {
|
||
|
if ($f !=undefined)
|
||
|
if (typeof $f(id).api != undefined && typeof $f(id).api !="undefined") {
|
||
|
var froogaloop = $f(id);
|
||
|
nextcaption.data('timerplay',setTimeout(function() {
|
||
|
if (nextcaption.data('forcerewind')=="on")
|
||
|
froogaloop.api("seekTo",0);
|
||
|
froogaloop.api("play");
|
||
|
},nextcaption.data('start')));
|
||
|
clearInterval(vimint);
|
||
|
}
|
||
|
},100);
|
||
|
}
|
||
|
}// END HAS LISTENER HANDLING
|
||
|
|
||
|
// PLAY VIDEO IF THUMBNAIL HAS BEEN CLICKED
|
||
|
nextcaption.find('.tp-thumb-image').click(function() {
|
||
|
TweenLite.to(jQuery(this),0.3,{opacity:0,ease:Power3.easeInOut,onComplete: function() {
|
||
|
nextcaption.find('.tp-thumb-image').remove();
|
||
|
}
|
||
|
})
|
||
|
var ifr = nextcaption.find('iframe');
|
||
|
var id = ifr.attr('id');
|
||
|
var vimint = setInterval(function() {
|
||
|
if ($f !=undefined)
|
||
|
if (typeof $f(id).api != undefined && typeof $f(id).api !="undefined") {
|
||
|
var froogaloop = $f(id);
|
||
|
froogaloop.api("play");
|
||
|
clearInterval(vimint);
|
||
|
}
|
||
|
},100);
|
||
|
})
|
||
|
|
||
|
|
||
|
} // END OF VIMEO HANDLING
|
||
|
} // END OF CHOOSE BETWEEN YOUTUBE AND VIMEO
|
||
|
}); // END OF LOOP THROUGH IFRAMES
|
||
|
|
||
|
// START OF VIDEO JS
|
||
|
if (nextcaption.find('video').length>0) {
|
||
|
|
||
|
|
||
|
nextcaption.find('video').each(function(i) {
|
||
|
var html5vid = jQuery(this).parent();
|
||
|
|
||
|
if (nextcaption.data('dottedoverlay')!="none" && nextcaption.data('dottedoverlay')!=undefined)
|
||
|
if (nextcaption.find('.tp-dottedoverlay').length!=1)
|
||
|
html5vid.append('<div class="tp-dottedoverlay '+nextcaption.data('dottedoverlay')+'"></div>');
|
||
|
|
||
|
var mediaaspect=16/9;
|
||
|
if (nextcaption.data('aspectratio')=="4:3") mediaaspect=4/3;
|
||
|
html5vid.data('mediaAspect',mediaaspect);
|
||
|
|
||
|
|
||
|
|
||
|
if (html5vid.closest('.tp-caption').data('forcecover')==1)
|
||
|
updateHTML5Size(html5vid,opt.container);
|
||
|
|
||
|
var htmlint = setInterval(function() {
|
||
|
if (typeof videojs !=undefined && typeof videojs !="undefined")
|
||
|
var html5vid = nextcaption.find('video').parent();
|
||
|
|
||
|
if (html5vid!=undefined && html5vid.hasClass("video-js")) {
|
||
|
|
||
|
|
||
|
opt.nextslideatend = nextcaption.data('nextslideatend');
|
||
|
if (!html5vid.hasClass("HasListener")) {
|
||
|
html5vid.addClass("HasListener");
|
||
|
var videoID = "videoid_"+Math.round(Math.random()*1000+1);
|
||
|
html5vid.attr('id',videoID);
|
||
|
|
||
|
videojs(videoID).ready(function(){
|
||
|
|
||
|
html5vidready(this,videoID)
|
||
|
|
||
|
});
|
||
|
|
||
|
} else {
|
||
|
videoID = html5vid.attr('id');
|
||
|
}
|
||
|
|
||
|
|
||
|
if (nextcaption.data('autoplay')==true) {
|
||
|
|
||
|
|
||
|
var bt=jQuery('body').find('#'+opt.container.attr('id')).find('.tp-bannertimer');
|
||
|
setTimeout(function(){
|
||
|
|
||
|
opt.videoplaying=true;
|
||
|
},200);
|
||
|
|
||
|
//konsole.log("VideoPlay set to True due HTML5 VIDEO 1st/2nd load AutoPlay");
|
||
|
|
||
|
|
||
|
videojs(videoID).ready(function(){
|
||
|
var myPlayer = this;
|
||
|
|
||
|
if (html5vid.data('loadedmetadata')==1 || html5vid.data('canplay') == 1)
|
||
|
if (nextcaption.data('forcerewind')=="on")
|
||
|
myPlayer.currentTime(0);
|
||
|
|
||
|
html5vid.data('timerplay',setTimeout(function() {
|
||
|
if (html5vid.data('loadedmetadata')==1 || html5vid.data('canplay') == 1) {
|
||
|
if (nextcaption.data('forcerewind')=="on")
|
||
|
myPlayer.currentTime(0);
|
||
|
|
||
|
if (html5vid.closest('.tp-caption').data('volume')=="mute")
|
||
|
myPlayer.volume(0);
|
||
|
}
|
||
|
setTimeout(function() {
|
||
|
myPlayer.play(0);
|
||
|
html5vid.find('.vjs-poster').css({display:"none"});
|
||
|
},50);
|
||
|
},10+nextcaption.data('start')));
|
||
|
});
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
html5vid.find('.vjs-poster').css({display:"block"});
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
if (html5vid.data('ww') == undefined) html5vid.data('ww',html5vid.width());
|
||
|
if (html5vid.data('hh') == undefined) html5vid.data('hh',html5vid.height());
|
||
|
|
||
|
videojs(videoID).ready(function(){
|
||
|
if (!nextcaption.hasClass("fullscreenvideo")) {
|
||
|
var myPlayer = videojs(videoID);
|
||
|
|
||
|
try{
|
||
|
myPlayer.width(html5vid.data('ww')*opt.bw);
|
||
|
myPlayer.height(html5vid.data('hh')*opt.bh);
|
||
|
} catch(e) {}
|
||
|
}
|
||
|
});
|
||
|
|
||
|
|
||
|
|
||
|
if (html5vid.closest('.tp-caption').data('forcecover')==1) {
|
||
|
updateHTML5Size(html5vid,opt.container);
|
||
|
html5vid.addClass("fullcoveredvideo");
|
||
|
}
|
||
|
|
||
|
clearInterval(htmlint);
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
},100)
|
||
|
});
|
||
|
} // END OF VIDEO JS FUNCTIONS
|
||
|
|
||
|
// IF AUTOPLAY IS ON, WE NEED SOME STOP FUNCTION ON
|
||
|
if (nextcaption.data('autoplay')==true) {
|
||
|
var bt=jQuery('body').find('#'+opt.container.attr('id')).find('.tp-bannertimer');
|
||
|
|
||
|
setTimeout(function() {
|
||
|
|
||
|
opt.videoplaying=true;
|
||
|
|
||
|
},200)
|
||
|
opt.videoplaying=true;
|
||
|
|
||
|
if (nextcaption.data('autoplayonlyfirsttime') == true || nextcaption.data('autoplayonlyfirsttime')=="true" ) {
|
||
|
nextcaption.data('autoplay',false);
|
||
|
nextcaption.data('autoplayonlyfirsttime',false);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
// NEW ENGINE
|
||
|
//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 || nextcaption.find('.video-js').length>0) {
|
||
|
|
||
|
var im = nextcaption.find('iframe');
|
||
|
im.css({display:"block"});
|
||
|
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',
|
||
|
});
|
||
|
else {
|
||
|
offsetx=0; offsety=0;
|
||
|
nextcaption.data('x',0)
|
||
|
nextcaption.data('y',0)
|
||
|
|
||
|
var ovhh = opt.height
|
||
|
if (opt.autoHeight=="on")
|
||
|
ovhh = opt.container.height()
|
||
|
nextcaption.css({
|
||
|
|
||
|
'width':opt.width,
|
||
|
'height':ovhh
|
||
|
});
|
||
|
}
|
||
|
|
||
|
|
||
|
im.width(ww*opt.bw);
|
||
|
im.height(hh*opt.bh);
|
||
|
imw = im.width();
|
||
|
imh = im.height();
|
||
|
}
|
||
|
|
||
|
else {
|
||
|
|
||
|
|
||
|
nextcaption.find('.tp-resizeme, .tp-resizeme *').each(function() {
|
||
|
calcCaptionResponsive(jQuery(this),opt);
|
||
|
});
|
||
|
|
||
|
if (nextcaption.hasClass("tp-resizeme")) {
|
||
|
nextcaption.find('*').each(function() {
|
||
|
calcCaptionResponsive(jQuery(this),opt);
|
||
|
});
|
||
|
}
|
||
|
|
||
|
calcCaptionResponsive(nextcaption,opt);
|
||
|
|
||
|
imh=nextcaption.outerHeight(true);
|
||
|
imw=nextcaption.outerWidth(true);
|
||
|
|
||
|
// NEXTCAPTION FRONTCORNER CHANGES
|
||
|
var ncch = nextcaption.outerHeight();
|
||
|
var bgcol = nextcaption.css('backgroundColor');
|
||
|
nextcaption.find('.frontcorner').css({
|
||
|
'borderWidth':ncch+"px",
|
||
|
'left':(0-ncch)+'px',
|
||
|
'borderRight':'0px solid transparent',
|
||
|
'borderTopColor':bgcol
|
||
|
});
|
||
|
|
||
|
nextcaption.find('.frontcornertop').css({
|
||
|
'borderWidth':ncch+"px",
|
||
|
'left':(0-ncch)+'px',
|
||
|
'borderRight':'0px solid transparent',
|
||
|
'borderBottomColor':bgcol
|
||
|
});
|
||
|
|
||
|
// NEXTCAPTION BACKCORNER CHANGES
|
||
|
nextcaption.find('.backcorner').css({
|
||
|
'borderWidth':ncch+"px",
|
||
|
'right':(0-ncch)+'px',
|
||
|
'borderLeft':'0px solid transparent',
|
||
|
'borderBottomColor':bgcol
|
||
|
});
|
||
|
|
||
|
// NEXTCAPTION BACKCORNER CHANGES
|
||
|
nextcaption.find('.backcornertop').css({
|
||
|
'borderWidth':ncch+"px",
|
||
|
'right':(0-ncch)+'px',
|
||
|
'borderLeft':'0px solid transparent',
|
||
|
'borderTopColor':bgcol
|
||
|
});
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
if (opt.fullScreenAlignForce == "on") {
|
||
|
xbw = 1;
|
||
|
xbh = 1;
|
||
|
offsetx=0;
|
||
|
offsety=0;
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
if (nextcaption.data('voffset')==undefined) nextcaption.data('voffset',0);
|
||
|
if (nextcaption.data('hoffset')==undefined) nextcaption.data('hoffset',0);
|
||
|
|
||
|
var vofs= nextcaption.data('voffset')*xbw;
|
||
|
var hofs= nextcaption.data('hoffset')*xbw;
|
||
|
|
||
|
var crw = opt.startwidth*xbw;
|
||
|
var crh = opt.startheight*xbw;
|
||
|
|
||
|
if (opt.fullScreenAlignForce == "on") {
|
||
|
crw = opt.container.width();
|
||
|
crh = opt.container.height();
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
// CENTER THE CAPTION HORIZONTALLY
|
||
|
if (nextcaption.data('x')=="center" || nextcaption.data('xcenter')=='center') {
|
||
|
nextcaption.data('xcenter','center');
|
||
|
//nextcaption.data('x',(crw/2 - nextcaption.outerWidth(true)/2)/xbw+ hofs);
|
||
|
nextcaption.data('x',(crw/2 - nextcaption.outerWidth(true)/2) + hofs);
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
// ALIGN LEFT THE CAPTION HORIZONTALLY
|
||
|
if (nextcaption.data('x')=="left" || nextcaption.data('xleft')=='left') {
|
||
|
nextcaption.data('xleft','left');
|
||
|
nextcaption.data('x',(0)/xbw+hofs);
|
||
|
|
||
|
}
|
||
|
|
||
|
// ALIGN RIGHT THE CAPTION HORIZONTALLY
|
||
|
if (nextcaption.data('x')=="right" || nextcaption.data('xright')=='right') {
|
||
|
nextcaption.data('xright','right');
|
||
|
nextcaption.data('x',((crw - nextcaption.outerWidth(true))+hofs)/xbw);
|
||
|
//konsole.log("crw:"+crw+" width:"+nextcaption.outerWidth(true)+" xbw:"+xbw);
|
||
|
//konsole.log("x-pos:"+nextcaption.data('x'))
|
||
|
}
|
||
|
|
||
|
|
||
|
// CENTER THE CAPTION VERTICALLY
|
||
|
if (nextcaption.data('y')=="center" || nextcaption.data('ycenter')=='center') {
|
||
|
nextcaption.data('ycenter','center');
|
||
|
nextcaption.data('y',(crh/2 - nextcaption.outerHeight(true)/2) + vofs);
|
||
|
}
|
||
|
|
||
|
// ALIGN TOP THE CAPTION VERTICALLY
|
||
|
if (nextcaption.data('y')=="top" || nextcaption.data('ytop')=='top') {
|
||
|
nextcaption.data('ytop','top');
|
||
|
nextcaption.data('y',(0)/opt.bh+vofs);
|
||
|
|
||
|
}
|
||
|
|
||
|
// ALIGN BOTTOM THE CAPTION VERTICALLY
|
||
|
if (nextcaption.data('y')=="bottom" || nextcaption.data('ybottom')=='bottom') {
|
||
|
nextcaption.data('ybottom','bottom');
|
||
|
nextcaption.data('y',((crh - nextcaption.outerHeight(true))+vofs)/xbw);
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
// THE TRANSITIONS OF CAPTIONS
|
||
|
// MDELAY AND MSPEED
|
||
|
if (nextcaption.data('start') == undefined) nextcaption.data('start',1000);
|
||
|
|
||
|
|
||
|
|
||
|
var easedata=nextcaption.data('easing');
|
||
|
if (easedata==undefined) easedata="Power1.easeOut";
|
||
|
|
||
|
|
||
|
var mdelay = nextcaption.data('start')/1000;
|
||
|
var mspeed = nextcaption.data('speed')/1000;
|
||
|
|
||
|
|
||
|
if (nextcaption.data('x')=="center" || nextcaption.data('xcenter')=='center')
|
||
|
var calcx = (nextcaption.data('x')+offsetx);
|
||
|
else
|
||
|
var calcx = (xbw*nextcaption.data('x')+offsetx);
|
||
|
|
||
|
|
||
|
if (nextcaption.data('y')=="center" || nextcaption.data('ycenter')=='center')
|
||
|
var calcy = (nextcaption.data('y')+offsety);
|
||
|
else
|
||
|
var calcy = (opt.bh*nextcaption.data('y')+offsety);
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
TweenLite.set(nextcaption,{top:calcy,left:calcx,overwrite:"auto"});
|
||
|
|
||
|
if (!recalled) {
|
||
|
|
||
|
|
||
|
|
||
|
// CLEAR THE TIMELINE, SINCE IT CAN BE DAMAGED, OR PAUSED AT A FEW PART
|
||
|
if (nextcaption.data('timeline')!=undefined)
|
||
|
nextcaption.data('timeline').clear();
|
||
|
|
||
|
// MAKE SURE THE ANIMATION ENDS WITH A CLEANING ON MOZ TRANSFORMS
|
||
|
function animcompleted() {
|
||
|
setTimeout(function() {
|
||
|
nextcaption.css({transform:"none",'-moz-transform':'none','-webkit-transform':'none'});
|
||
|
},100)
|
||
|
}
|
||
|
|
||
|
|
||
|
function tlstart() {
|
||
|
nextcaption.data('timer',setTimeout(function() {
|
||
|
if (nextcaption.hasClass("fullscreenvideo"))
|
||
|
nextcaption.css({'display':'block'});
|
||
|
|
||
|
},nextcaption.data('start')));
|
||
|
}
|
||
|
|
||
|
var tl = new TimelineLite({smoothChildTiming:true,onStart:tlstart});
|
||
|
|
||
|
|
||
|
|
||
|
if (opt.fullScreenAlignForce == "on")
|
||
|
calcy = nextcaption.data('y')+offsety;
|
||
|
|
||
|
var animobject = nextcaption;
|
||
|
if (nextcaption.data('mySplitText') !=undefined) nextcaption.data('mySplitText').revert();
|
||
|
|
||
|
|
||
|
if (nextcaption.data('splitin') == "chars" || nextcaption.data('splitin') == "words" || nextcaption.data('splitin') == "lines" || nextcaption.data('splitout') == "chars" || nextcaption.data('splitout') == "words" || nextcaption.data('splitout') == "lines") {
|
||
|
if (nextcaption.find('a').length>0)
|
||
|
nextcaption.data('mySplitText',new SplitText(nextcaption.find('a'),{type:"lines,words,chars",charsClass:"tp-splitted",wordsClass:"tp-splitted",linesClass:"tp-splitted"}));
|
||
|
else
|
||
|
nextcaption.data('mySplitText',new SplitText(nextcaption,{type:"lines,words,chars",charsClass:"tp-splitted",wordsClass:"tp-splitted",linesClass:"tp-splitted"}));
|
||
|
|
||
|
nextcaption.addClass("splitted");
|
||
|
}
|
||
|
|
||
|
if (nextcaption.data('splitin') == "chars")
|
||
|
animobject = nextcaption.data('mySplitText').chars;
|
||
|
|
||
|
|
||
|
if (nextcaption.data('splitin') == "words")
|
||
|
animobject = nextcaption.data('mySplitText').words;
|
||
|
|
||
|
|
||
|
if (nextcaption.data('splitin') == "lines")
|
||
|
animobject = nextcaption.data('mySplitText').lines;
|
||
|
|
||
|
|
||
|
|
||
|
var frm = newAnimObject();
|
||
|
var endfrm = newAnimObject();
|
||
|
|
||
|
|
||
|
if (nextcaption.data('repeat')!=undefined) repeatV = nextcaption.data('repeat');
|
||
|
if (nextcaption.data('yoyo')!=undefined) yoyoV = nextcaption.data('yoyo');
|
||
|
if (nextcaption.data('repeatdelay')!=undefined) repeatdelayV = nextcaption.data('repeatdelay');
|
||
|
|
||
|
// WHICH ANIMATION TYPE SHOULD BE USED
|
||
|
if (nextcaption.hasClass("customin")) frm = getAnimDatas(frm,nextcaption.data('customin'));
|
||
|
else
|
||
|
if (nextcaption.hasClass("randomrotate")) {
|
||
|
|
||
|
frm.scale = Math.random()*3+1;
|
||
|
frm.rotation = Math.round(Math.random()*200-100);
|
||
|
frm.x = Math.round(Math.random()*200-100);
|
||
|
frm.y = Math.round(Math.random()*200-100);
|
||
|
}
|
||
|
else
|
||
|
if (nextcaption.hasClass('lfr') || nextcaption.hasClass('skewfromright')) frm.x = 15+opt.width;
|
||
|
else
|
||
|
if (nextcaption.hasClass('lfl') || nextcaption.hasClass('skewfromleft')) frm.x = -15-imw;
|
||
|
else
|
||
|
if (nextcaption.hasClass('sfl') | nextcaption.hasClass('skewfromleftshort')) frm.x = -50;
|
||
|
else
|
||
|
if (nextcaption.hasClass('sfr') | nextcaption.hasClass('skewfromrightshort')) frm.x = 50;
|
||
|
else
|
||
|
if (nextcaption.hasClass('lft')) frm.y = -25 - imh;
|
||
|
else
|
||
|
if (nextcaption.hasClass('lfb')) frm.y = 25 + opt.height;
|
||
|
else
|
||
|
if (nextcaption.hasClass('sft')) frm.y = -50;
|
||
|
else
|
||
|
if (nextcaption.hasClass('sfb')) frm.y = 50;
|
||
|
|
||
|
|
||
|
if (nextcaption.hasClass('skewfromright') || nextcaption.hasClass('skewfromrightshort')) frm.skewX = -85
|
||
|
else
|
||
|
if (nextcaption.hasClass('skewfromleft') || nextcaption.hasClass('skewfromleftshort')) frm.skewX = 85
|
||
|
|
||
|
|
||
|
// FOR SAFARI WE NEED TO REMOVE 3D ROTATIONS
|
||
|
if (get_browser().toLowerCase()=="safari") {
|
||
|
frm.rotationX=0;frm.rotationY=0;
|
||
|
}
|
||
|
|
||
|
var elemdelay = (nextcaption.data('elementdelay') == undefined) ? 0 : nextcaption.data('elementdelay');
|
||
|
endfrm.ease = frm.ease = (nextcaption.data('easing') == undefined) ? Power1.easeInOut : nextcaption.data('easing');
|
||
|
|
||
|
|
||
|
// DISTANCES SHOULD BE RESIZED ALSO
|
||
|
|
||
|
frm.data = new Object();
|
||
|
frm.data.oldx = frm.x;
|
||
|
frm.data.oldy = frm.y;
|
||
|
|
||
|
endfrm.data = new Object();
|
||
|
endfrm.data.oldx = endfrm.x;
|
||
|
endfrm.data.oldy = endfrm.y;
|
||
|
|
||
|
frm.x = frm.x * xbw;
|
||
|
frm.y = frm.y * xbw;
|
||
|
|
||
|
var newtl = new TimelineLite();
|
||
|
|
||
|
|
||
|
|
||
|
// CHANGE to TweenLite. if Yoyo and Repeat is used. Dont forget to laod the Right Tools for it !!
|
||
|
if (nextcaption.hasClass("customin")) {
|
||
|
if (animobject != nextcaption)
|
||
|
tl.add(TweenLite.set(nextcaption, { opacity:1,scaleX:1,scaleY:1,rotationX:0,rotationY:0,rotationZ:0,skewX:0,skewY:0,z:0,x:0,y:0,visibility:'visible',opacity:1,delay:0,overwrite:"all"}));
|
||
|
frm.visibility = "hidden";
|
||
|
endfrm.visibility = "visible";
|
||
|
endfrm.overwrite = "all";
|
||
|
endfrm.opacity = 1;
|
||
|
endfrm.onComplete = animcompleted();
|
||
|
endfrm.delay = mdelay;
|
||
|
|
||
|
tl.add(newtl.staggerFromTo(animobject,mspeed,frm,endfrm,elemdelay),"frame0");
|
||
|
|
||
|
} else {
|
||
|
frm.visibility = "visible";
|
||
|
frm.transformPerspective = 600;
|
||
|
if (animobject != nextcaption)
|
||
|
tl.add(TweenLite.set(nextcaption, { opacity:1,scaleX:1,scaleY:1,rotationX:0,rotationY:0,rotationZ:0,skewX:0,skewY:0,z:0,x:0,y:0,visibility:'visible',opacity:1,delay:0,overwrite:"all"}));
|
||
|
|
||
|
endfrm.visibility = "visible";
|
||
|
endfrm.delay = mdelay;
|
||
|
endfrm.onComplete = animcompleted();
|
||
|
endfrm.opacity = 1;
|
||
|
if (nextcaption.hasClass("randomrotate") && animobject != nextcaption) {
|
||
|
|
||
|
for (var i=0;i<animobject.length;i++) {
|
||
|
var obj =new Object();
|
||
|
var endobj = new Object();
|
||
|
jQuery.extend(obj,frm);
|
||
|
jQuery.extend(endobj,endfrm);
|
||
|
frm.scale = Math.random()*3+1;
|
||
|
frm.rotation = Math.round(Math.random()*200-100);
|
||
|
frm.x = Math.round(Math.random()*200-100);
|
||
|
frm.y = Math.round(Math.random()*200-100);
|
||
|
|
||
|
if (i!=0) endobj.delay = mdelay + (i*elemdelay);
|
||
|
|
||
|
|
||
|
tl.append(TweenLite.fromTo(animobject[i],mspeed,obj,endobj),"frame0");
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
} else
|
||
|
tl.add(newtl.staggerFromTo(animobject,mspeed,frm,endfrm,elemdelay),"frame0");
|
||
|
//tl.add(TweenLite.fromTo(nextcaption,mspeed,frm,endfrm),"frame0");
|
||
|
}
|
||
|
|
||
|
// SAVE IT TO NCAPTION BEFORE NEW STEPS WILL BE ADDED
|
||
|
nextcaption.data('timeline',tl);
|
||
|
|
||
|
// FURTHER ANIMATIONS IN CASE THERE ARE MORE THAN ONE STEP IN THE ANIMATION CHAIN
|
||
|
var frames = new Array();
|
||
|
if (nextcaption.data('frames')!=undefined) {
|
||
|
var rowtext = nextcaption.data('frames');
|
||
|
rowtext = rowtext.replace(/\s+/g, '');
|
||
|
rowtext = rowtext.replace("{","");
|
||
|
var spframes = rowtext.split('}');
|
||
|
jQuery.each(spframes,function(index,spframe){
|
||
|
if (spframe.length>0) {
|
||
|
var params = getAnimSteps(spframe);
|
||
|
|
||
|
addMoveCaption(nextcaption,opt,params,"frame"+(index+10),xbw)
|
||
|
|
||
|
}
|
||
|
})
|
||
|
} // END OF ANIMATION STEPS
|
||
|
|
||
|
tl = nextcaption.data('timeline');
|
||
|
|
||
|
// IF THERE IS ANY EXIT ANIM DEFINED
|
||
|
if (nextcaption.data('end')!=undefined) {
|
||
|
|
||
|
endMoveCaption(nextcaption,opt,nextcaption.data('end')/1000,frm,"frame99",xbw);
|
||
|
} else {
|
||
|
endMoveCaption(nextcaption,opt,999999,frm,"frame99",xbw);
|
||
|
}
|
||
|
|
||
|
// SAVE THE TIMELINE IN DOM ELEMENT
|
||
|
tl = nextcaption.data('timeline');
|
||
|
nextcaption.data('timeline',tl);
|
||
|
|
||
|
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if (recalled) {
|
||
|
if (nextcaption.data('timeline') != undefined) {
|
||
|
var tweens = nextcaption.data('timeline').getTweensOf();
|
||
|
jQuery.each(tweens,function(index,tween) {
|
||
|
if (tween.vars.data != undefined) {
|
||
|
var newx = tween.vars.data.oldx * xbw;
|
||
|
var newy = tween.vars.data.oldy * xbw;
|
||
|
if (tween.progress() !=1 && tween.progress()!=0) {
|
||
|
try{
|
||
|
//tween.updateTo({x:newx, y:newy},true);
|
||
|
tween.vars.x = newx;
|
||
|
tween.vary.y = newy;
|
||
|
} catch(e) {
|
||
|
|
||
|
}
|
||
|
} else {
|
||
|
if (tween.progress()==1) {
|
||
|
TweenLite.set(tween.target,{x:newx,y:newy});
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
})
|
||
|
}
|
||
|
}
|
||
|
})
|
||
|
|
||
|
var bt=jQuery('body').find('#'+opt.container.attr('id')).find('.tp-bannertimer');
|
||
|
bt.data('opt',opt);
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
function get_browser(){
|
||
|
var N=navigator.appName, ua=navigator.userAgent, tem;
|
||
|
var M=ua.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i);
|
||
|
if(M && (tem= ua.match(/version\/([\.\d]+)/i))!= null) M[2]= tem[1];
|
||
|
M=M? [M[1], M[2]]: [N, navigator.appVersion, '-?'];
|
||
|
return M[0];
|
||
|
}
|
||
|
function get_browser_version(){
|
||
|
var N=navigator.appName, ua=navigator.userAgent, tem;
|
||
|
var M=ua.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i);
|
||
|
if(M && (tem= ua.match(/version\/([\.\d]+)/i))!= null) M[2]= tem[1];
|
||
|
M=M? [M[1], M[2]]: [N, navigator.appVersion, '-?'];
|
||
|
return M[1];
|
||
|
}
|
||
|
|
||
|
/////////////////////////////////////////////////////////////////
|
||
|
// - CALCULATE THE RESPONSIVE SIZES OF THE CAPTIONS - //
|
||
|
/////////////////////////////////////////////////////////////////
|
||
|
function calcCaptionResponsive(nc,opt) {
|
||
|
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('borderTopWidth'),0) || 0);
|
||
|
if (nc.data('bb') == undefined) nc.data('bb',parseInt(nc.css('borderBottomWidth'),0) || 0);
|
||
|
if (nc.data('bl') == undefined) nc.data('bl',parseInt(nc.css('borderLeftWidth'),0) || 0);
|
||
|
if (nc.data('br') == undefined) nc.data('br',parseInt(nc.css('borderRightWidth'),0) || 0);
|
||
|
|
||
|
if (nc.data('ls') == undefined) nc.data('ls',parseInt(nc.css('letterSpacing'),0) || 0);
|
||
|
|
||
|
if (nc.data('lh') == undefined) nc.data('lh',parseInt(nc.css('lineHeight'),0) || 0);
|
||
|
if (nc.data('minwidth') == undefined) nc.data('minwidth',parseInt(nc.css('minWidth'),0) || 0);
|
||
|
if (nc.data('minheight') == undefined) nc.data('minheight',parseInt(nc.css('minHeight'),0) || 0);
|
||
|
if (nc.data('maxwidth') == undefined) nc.data('maxwidth',parseInt(nc.css('maxWidth'),0) || "none");
|
||
|
if (nc.data('maxheight') == undefined) nc.data('maxheight',parseInt(nc.css('maxHeight'),0) || "none");
|
||
|
|
||
|
if (nc.data('wan') == undefined) nc.data('wan',nc.css("-webkit-transition"));
|
||
|
if (nc.data('moan') == undefined) nc.data('moan',nc.css("-moz-animation-transition"));
|
||
|
if (nc.data('man') == undefined) nc.data('man',nc.css("-ms-animation-transition"));
|
||
|
if (nc.data('ani') == undefined) nc.data('ani',nc.css("transition"));
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
if (!nc.hasClass("tp-splitted")) {
|
||
|
|
||
|
|
||
|
nc.css("-webkit-transition", "none");
|
||
|
nc.css("-moz-transition", "none");
|
||
|
nc.css("-ms-transition", "none");
|
||
|
nc.css("transition", "none");
|
||
|
|
||
|
TweenLite.set(nc,{
|
||
|
fontSize: Math.round((nc.data('fsize') * opt.bw))+"px",
|
||
|
|
||
|
letterSpacing:Math.floor((nc.data('ls') * opt.bw))+"px",
|
||
|
|
||
|
paddingTop: Math.round((nc.data('pt') * opt.bh)) + "px",
|
||
|
paddingBottom: Math.round((nc.data('pb') * opt.bh)) + "px",
|
||
|
paddingLeft: Math.round((nc.data('pl') * opt.bw)) + "px",
|
||
|
paddingRight: Math.round((nc.data('pr') * opt.bw)) + "px",
|
||
|
|
||
|
marginTop: (nc.data('mt') * opt.bh) + "px",
|
||
|
marginBottom: (nc.data('mb') * opt.bh) + "px",
|
||
|
marginLeft: (nc.data('ml') * opt.bw) + "px",
|
||
|
marginRight: (nc.data('mr') * opt.bw) + "px",
|
||
|
|
||
|
borderTopWidth: Math.round((nc.data('bt') * opt.bh)) + "px",
|
||
|
borderBottomWidth: Math.round((nc.data('bb') * opt.bh)) + "px",
|
||
|
borderLeftWidth: Math.round((nc.data('bl') * opt.bw)) + "px",
|
||
|
borderRightWidth: Math.round((nc.data('br') * opt.bw)) + "px",
|
||
|
|
||
|
lineHeight: Math.round((nc.data('lh') * opt.bh)) + "px",
|
||
|
minWidth:(nc.data('minwidth') * opt.bw) + "px",
|
||
|
minHeight:(nc.data('minheight') * opt.bh) + "px",
|
||
|
overwrite:"auto"
|
||
|
});
|
||
|
setTimeout(function() {
|
||
|
nc.css("-webkit-transition", nc.data('wan'));
|
||
|
nc.css("-moz-transition", nc.data('moan'));
|
||
|
nc.css("-ms-transition", nc.data('man'));
|
||
|
nc.css("transition", nc.data('ani'));
|
||
|
|
||
|
},30);
|
||
|
|
||
|
//konsole.log(nc.data('maxwidth')+" "+nc.data('maxheight'));
|
||
|
if (nc.data('maxheight')!='none')
|
||
|
nc.css({'maxHeight':(nc.data('maxheight') * opt.bh) + "px"});
|
||
|
|
||
|
|
||
|
if (nc.data('maxwidth')!='none')
|
||
|
nc.css({'maxWidth':(nc.data('maxwidth') * opt.bw) + "px"});
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
//////////////////////////
|
||
|
// REMOVE THE CAPTIONS //
|
||
|
/////////////////////////
|
||
|
function removeTheCaptions(actli,opt) {
|
||
|
|
||
|
|
||
|
actli.find('.tp-caption').each(function(i) {
|
||
|
var nextcaption=jQuery(this); //actli.find('.tp-caption:eq('+i+')');
|
||
|
|
||
|
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");
|
||
|
clearTimeout(nextcaption.data('timerplay'));
|
||
|
} catch(e) {}
|
||
|
//YOU TUBE PAUSE
|
||
|
try {
|
||
|
var player=nextcaption.data('player');
|
||
|
player.stopVideo();
|
||
|
clearTimeout(nextcaption.data('timerplay'));
|
||
|
} catch(e) {}
|
||
|
}
|
||
|
|
||
|
// IF HTML5 VIDEO IS EMBEDED
|
||
|
if (nextcaption.find('video').length>0) {
|
||
|
try{
|
||
|
nextcaption.find('video').each(function(i) {
|
||
|
var html5vid = jQuery(this).parent();
|
||
|
var videoID =html5vid.attr('id');
|
||
|
clearTimeout(html5vid.data('timerplay'));
|
||
|
videojs(videoID).ready(function(){
|
||
|
var myPlayer = this;
|
||
|
myPlayer.pause();
|
||
|
});
|
||
|
})
|
||
|
}catch(e) {}
|
||
|
} // END OF VIDEO JS FUNCTIONS
|
||
|
try {
|
||
|
|
||
|
//var tl = TimelineLite.exportRoot();
|
||
|
var tl = nextcaption.data('timeline');
|
||
|
var endstarts = tl.getLabelTime("frame99");
|
||
|
var curtime = tl.time();
|
||
|
if (endstarts>curtime) {
|
||
|
|
||
|
// WE NEED TO STOP ALL OTHER NIMATIONS
|
||
|
var tweens = tl.getTweensOf(nextcaption);
|
||
|
jQuery.each(tweens,function(index,tw) {
|
||
|
|
||
|
if (index!=0)
|
||
|
tw.pause();
|
||
|
});
|
||
|
tl.play("frame99");
|
||
|
}
|
||
|
|
||
|
} catch(e) {}
|
||
|
|
||
|
|
||
|
|
||
|
});
|
||
|
}
|
||
|
|
||
|
//////////////////////////////
|
||
|
// MOVE THE CAPTIONS //
|
||
|
////////////////////////////
|
||
|
function addMoveCaption(nextcaption,opt,params,frame,downscale) {
|
||
|
var tl = nextcaption.data('timeline');
|
||
|
|
||
|
var newtl = new TimelineLite();
|
||
|
|
||
|
var animobject = nextcaption;
|
||
|
|
||
|
if (params.typ == "chars") animobject = nextcaption.data('mySplitText').chars;
|
||
|
else
|
||
|
if (params.typ == "words") animobject = nextcaption.data('mySplitText').words;
|
||
|
else
|
||
|
if (params.typ == "lines") animobject = nextcaption.data('mySplitText').lines;
|
||
|
params.animation.ease = params.ease;
|
||
|
|
||
|
if (params.animation.rotationZ !=undefined) params.animation.rotation = params.animation.rotationZ;
|
||
|
params.animation.data = new Object();
|
||
|
params.animation.data.oldx = params.animation.x;
|
||
|
params.animation.data.oldy = params.animation.y;
|
||
|
|
||
|
params.animation.x = params.animation.x * downscale;
|
||
|
params.animation.y = params.animation.y * downscale;
|
||
|
|
||
|
|
||
|
tl.add(newtl.staggerTo(animobject,params.speed,params.animation,params.elementdelay),params.start);
|
||
|
tl.addLabel(frame,params.start);
|
||
|
|
||
|
nextcaption.data('timeline',tl);
|
||
|
|
||
|
}
|
||
|
//////////////////////////////
|
||
|
// MOVE OUT THE CAPTIONS //
|
||
|
////////////////////////////
|
||
|
function endMoveCaption(nextcaption,opt,mdelay,backwards,frame,downscale) {
|
||
|
|
||
|
var tl = nextcaption.data('timeline');
|
||
|
var newtl = new TimelineLite();
|
||
|
|
||
|
var frm = newAnimObject();
|
||
|
var mspeed= (nextcaption.data('endspeed') == undefined) ? nextcaption.data('speed') : nextcaption.data('endspeed');
|
||
|
frm.ease = (nextcaption.data('endeasing') == undefined) ? Power1.easeInOut : nextcaption.data('endeasing');
|
||
|
|
||
|
mspeed = mspeed/1000;
|
||
|
|
||
|
|
||
|
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') ||
|
||
|
nextcaption.hasClass('skewtoright') ||
|
||
|
nextcaption.hasClass('skewtorightshort') ||
|
||
|
nextcaption.hasClass('skewtoleft') ||
|
||
|
nextcaption.hasClass('skewtoleftshort') ||
|
||
|
nextcaption.hasClass('fadeout') ||
|
||
|
nextcaption.hasClass("randomrotateout"))
|
||
|
{
|
||
|
|
||
|
if (nextcaption.hasClass('skewtoright') || nextcaption.hasClass('skewtorightshort')) frm.skewX = 35
|
||
|
else
|
||
|
if (nextcaption.hasClass('skewtoleft') || nextcaption.hasClass('skewtoleftshort')) frm.skewX = -35
|
||
|
|
||
|
|
||
|
if (nextcaption.hasClass('ltr') || nextcaption.hasClass('skewtoright'))
|
||
|
frm.x=opt.width+60;
|
||
|
else if (nextcaption.hasClass('ltl') || nextcaption.hasClass('skewtoleft'))
|
||
|
frm.x=0-(opt.width+60);
|
||
|
else if (nextcaption.hasClass('ltt'))
|
||
|
frm.y=0-(opt.height+60);
|
||
|
else if (nextcaption.hasClass('ltb'))
|
||
|
frm.y=opt.height+60;
|
||
|
else if (nextcaption.hasClass('str') || nextcaption.hasClass('skewtorightshort')) {
|
||
|
frm.x=50;frm.opacity=0;
|
||
|
} else if (nextcaption.hasClass('stl') || nextcaption.hasClass('skewtoleftshort')) {
|
||
|
frm.x=-50;frm.opacity=0;
|
||
|
} else if (nextcaption.hasClass('stt')) {
|
||
|
frm.y=-50;frm.opacity=0;
|
||
|
} else if (nextcaption.hasClass('stb')) {
|
||
|
frm.y=50;frm.opacity=0;
|
||
|
} else if (nextcaption.hasClass("randomrotateout")) {
|
||
|
frm.x = Math.random()*opt.width;
|
||
|
frm.y = Math.random()*opt.height;
|
||
|
frm.scale = Math.random()*2+0.3;
|
||
|
frm.rotation = Math.random()*360-180;
|
||
|
frm.opacity = 0;
|
||
|
} else if (nextcaption.hasClass('fadeout')) {
|
||
|
frm.opacity = 0;
|
||
|
}
|
||
|
|
||
|
if (nextcaption.hasClass('skewtorightshort')) frm.x = 270;
|
||
|
else
|
||
|
if (nextcaption.hasClass('skewtoleftshort')) frm.x = -270
|
||
|
frm.data = new Object();
|
||
|
frm.data.oldx = frm.x;
|
||
|
frm.data.oldy = frm.y;
|
||
|
frm.x = frm.x * downscale;
|
||
|
frm.y = frm.y * downscale;
|
||
|
|
||
|
frm.overwrite="auto";
|
||
|
var animobject = nextcaption;
|
||
|
var animobject = nextcaption;
|
||
|
if (nextcaption.data('splitout') == "chars") animobject = nextcaption.data('mySplitText').chars;
|
||
|
else
|
||
|
if (nextcaption.data('splitout') == "words") animobject = nextcaption.data('mySplitText').words;
|
||
|
else
|
||
|
if (nextcaption.data('splitout') == "lines") animobject = nextcaption.data('mySplitText').lines;
|
||
|
var elemdelay = (nextcaption.data('endelementdelay') == undefined) ? 0 : nextcaption.data('endelementdelay');
|
||
|
//tl.add(TweenLite.to(nextcaption,mspeed,frm),mdelay);
|
||
|
tl.add(newtl.staggerTo(animobject,mspeed,frm,elemdelay),mdelay);
|
||
|
|
||
|
}
|
||
|
|
||
|
else
|
||
|
|
||
|
if (nextcaption.hasClass("customout")) {
|
||
|
|
||
|
frm = getAnimDatas(frm,nextcaption.data('customout'));
|
||
|
var animobject = nextcaption;
|
||
|
if (nextcaption.data('splitout') == "chars") animobject = nextcaption.data('mySplitText').chars;
|
||
|
else
|
||
|
if (nextcaption.data('splitout') == "words") animobject = nextcaption.data('mySplitText').words;
|
||
|
else
|
||
|
if (nextcaption.data('splitout') == "lines") animobject = nextcaption.data('mySplitText').lines;
|
||
|
|
||
|
var elemdelay = (nextcaption.data('endelementdelay') == undefined) ? 0 : nextcaption.data('endelementdelay');
|
||
|
frm.onStart = function() {
|
||
|
|
||
|
TweenLite.set(nextcaption,{
|
||
|
transformPerspective:frm.transformPerspective,
|
||
|
transformOrigin:frm.transformOrigin,
|
||
|
overwrite:"auto"
|
||
|
});
|
||
|
}
|
||
|
|
||
|
frm.data = new Object();
|
||
|
frm.data.oldx = frm.x;
|
||
|
frm.data.oldy = frm.y;
|
||
|
|
||
|
frm.x = frm.x * downscale;
|
||
|
frm.y = frm.y * downscale;
|
||
|
|
||
|
tl.add(newtl.staggerTo(animobject,mspeed,frm,elemdelay),mdelay);
|
||
|
}
|
||
|
|
||
|
else {
|
||
|
backwards.delay = 0;
|
||
|
tl.add(TweenLite.to(nextcaption,mspeed,backwards),mdelay);
|
||
|
}
|
||
|
|
||
|
|
||
|
tl.addLabel(frame,mdelay);
|
||
|
nextcaption.data('timeline',tl);
|
||
|
}
|
||
|
|
||
|
///////////////////////////
|
||
|
// REMOVE THE LISTENERS //
|
||
|
///////////////////////////
|
||
|
function removeAllListeners(container,opt) {
|
||
|
container.children().each(function() {
|
||
|
try{ jQuery(this).die('click'); } catch(e) {}
|
||
|
try{ jQuery(this).die('mouseenter');} catch(e) {}
|
||
|
try{ jQuery(this).die('mouseleave');} catch(e) {}
|
||
|
try{ jQuery(this).unbind('hover');} catch(e) {}
|
||
|
})
|
||
|
try{ container.die('click','mouseenter','mouseleave');} catch(e) {}
|
||
|
clearInterval(opt.cdint);
|
||
|
container=null;
|
||
|
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
///////////////////////////
|
||
|
// - 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;
|
||
|
|
||
|
opt.stopLoop="off";
|
||
|
|
||
|
if (opt.looptogo==0) opt.stopLoop="on";
|
||
|
|
||
|
if (opt.slideamount >1 && !(opt.stopAfterLoops==0 && opt.stopAtSlide==1) ) {
|
||
|
var bt=container.find('.tp-bannertimer');
|
||
|
|
||
|
bt.data('opt',opt);
|
||
|
opt.cdint=setInterval(function() {
|
||
|
|
||
|
if (jQuery('body').find(container).length==0) {
|
||
|
removeAllListeners(container,opt);
|
||
|
clearInterval(opt.cdint);
|
||
|
}
|
||
|
|
||
|
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.bannertimeronpause != true && opt.overnav !=true)
|
||
|
opt.cd=opt.cd+50;
|
||
|
|
||
|
|
||
|
TweenLite.to(bt,0.3,{width:(opt.cd / opt.delay)*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.looptogo<=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);
|
||
|
}
|
||
|
|
||
|
},50);
|
||
|
|
||
|
|
||
|
container.hover(
|
||
|
function() {
|
||
|
|
||
|
if (opt.onHoverStop=="on") {
|
||
|
opt.conthover=1;
|
||
|
|
||
|
container.trigger('revolution.slide.onpause');
|
||
|
var nextsh = container.find('>ul >li:eq('+opt.next+') .slotholder');
|
||
|
nextsh.find('.defaultimg').each(function() {
|
||
|
var dimg = jQuery(this);
|
||
|
if (dimg.data('kenburn')!=undefined)
|
||
|
dimg.data('kenburn').pause();
|
||
|
});
|
||
|
}
|
||
|
},
|
||
|
function() {
|
||
|
if (container.data('conthover')!=1) {
|
||
|
container.trigger('revolution.slide.onresume');
|
||
|
opt.conthover=0;
|
||
|
|
||
|
var nextsh = container.find('>ul >li:eq('+opt.next+') .slotholder');
|
||
|
nextsh.find('.defaultimg').each(function() {
|
||
|
var dimg = jQuery(this);
|
||
|
if (dimg.data('kenburn')!=undefined)
|
||
|
dimg.data('kenburn').play();
|
||
|
});
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
})(jQuery);
|
||
|
|
||
|
|
||
|
// SOME ERROR MESSAGES IN CASE THE PLUGIN CAN NOT BE LOADED
|
||
|
function revslider_showDoubleJqueryError(sliderID) {
|
||
|
var errorMessage = "Revolution Slider Error: You have some jquery.js library include that comes after the revolution files js include.";
|
||
|
errorMessage += "<br> This includes make eliminates the revolution slider libraries, and make it not work.";
|
||
|
errorMessage += "<br><br> To fix it you can:<br> 1. In the Slider Settings -> Troubleshooting set option: <strong><b>Put JS Includes To Body</b></strong> option to true.";
|
||
|
errorMessage += "<br> 2. Find the double jquery.js include and remove it.";
|
||
|
errorMessage = "<span style='font-size:16px;color:#BC0C06;'>" + errorMessage + "</span>"
|
||
|
jQuery(sliderID).show().html(errorMessage);
|
||
|
}
|
||
|
|
||
|
/*!
|
||
|
* VERSION: beta 0.2.3
|
||
|
* DATE: 2013-07-10
|
||
|
* UPDATES AND DOCS AT: http://www.greensock.com
|
||
|
*
|
||
|
* @license Copyright (c) 2008-2013, GreenSock. All rights reserved.
|
||
|
* SplitText is a Club GreenSock membership benefit; You must have a valid membership to use
|
||
|
* this code without violating the terms of use. Visit http://www.greensock.com/club/ to sign up or get more details.
|
||
|
* This work is subject to the software agreement that was issued with your membership.
|
||
|
*
|
||
|
* @author: Jack Doyle, jack@greensock.com
|
||
|
*/
|
||
|
(function(t){"use strict";var e=t.GreenSockGlobals||t,i=function(t){var i,s=t.split("."),r=e;for(i=0;s.length>i;i++)r[s[i]]=r=r[s[i]]||{};return r},s=i("com.greensock.utils"),r=function(t){var e=t.nodeType,i="";if(1===e||9===e||11===e){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)i+=r(t)}else if(3===e||4===e)return t.nodeValue;return i},n=document,a=n.defaultView?n.defaultView.getComputedStyle:function(){},o=/([A-Z])/g,h=function(t,e,i,s){var r;return(i=i||a(t,null))?(t=i.getPropertyValue(e.replace(o,"-$1").toLowerCase()),r=t||i.length?t:i[e]):t.currentStyle&&(i=t.currentStyle,r=i[e]),s?r:parseInt(r,10)||0},l=function(t){return t.length&&t[0]&&(t[0].nodeType&&t[0].style&&!t.nodeType||t[0].length&&t[0][0])?!0:!1},_=function(t){var e,i,s,r=[],n=t.length;for(e=0;n>e;e++)if(i=t[e],l(i))for(s=i.length,s=0;i.length>s;s++)r.push(i[s]);else r.push(i);return r},u=")eefec303079ad17405c",c=/(?:<br>|<br\/>|<br \/>)/gi,p=n.all&&!n.addEventListener,f="<div style='position:relative;display:inline-block;"+(p?"*display:inline;*zoom:1;'":"'"),m=function(t){t=t||"";var e=-1!==t.indexOf("++"),i=1;return e&&(t=t.split("++").join("")),function(){return f+(t?" class='"+t+(e?i++:"")+"'>":">")}},d=s.SplitText=e.SplitText=function(t,e){if("string"==typeof t&&(t=d.selector(t)),!t)throw"cannot split a null element.";this.elements=l(t)?_(t):[t],this.chars=[],this.words=[],this.lines=[],this._originals=[],this.vars=e||{},this.split(e)},g=function(t,e,i,s,o){c.test(t.innerHTML)&&(t.innerHTML=t.innerHTML.replace(c,u));var l,_,p,f,d,g,v,y,T,w,b,x,P,S=r(t),C=e.type||e.split||"chars,words,lines",k=-1!==C.indexOf("lines")?[]:null,R=-1!==C.indexOf("words"),A=-1!==C.indexOf("chars"),D="absolute"===e.position||e.absolute===!0,O=D?"­ ":" ",M=-999,L=a(t),I=h(t,"paddingLeft",L),E=h(t,"borderBottomWidth",L)+h(t,"borderTopWidth",L),N=h(t,"borderLeftWidth",L)+h(t,"borderRightWidth",L),F=h(t,"paddingTop",L)+h(t,"paddingBottom",L),U=h(t,"paddingLeft",L)+h(t,"paddingRight",L),X=h(t,"textAlign",L,!0),z=t.clientHeight,B=t.clientWidth,j=S.length,Y="</div>",q=m(e.wordsClass),V=m(e.charsClass),Q=-1!==(e.linesClass||"").indexOf("++"),G=e.linesClass;for(Q&&(G=G.split("++").join("")),p=q(),f=0;j>f;f++)g=S.charAt(f),")"===g&&S.substr(f,20)===u?(p+=Y+"<BR/>",f!==j-1&&(p+=" "+q()),f+=19):" "===g&&" "!==S.charAt(f-1)&&f!==j-1?(p+=Y,f!==j-1&&(p+=O+q())):p+=A&&" "!==g?V()+g+"</div>":g;for(t.innerHTML=p+Y,d=t.getElementsByTagName("*"),j=d.length,v=[],f=0;j>f;f++)v[f]=d[f];if(k||D)for(f=0;j>f;f++)y=v[f],_=y.parentNode===t,(_||D||A&&!R)&&(T=y.offsetTop,k&&_&&T!==M&&"BR"!==y.nodeName&&(l=[],k.push(l),M=T),D&&(y._x=y.offsetLeft,y._y=T,y._w=y.offsetWidth,y._h=y.offsetHeight),k&&(R!==_&&A||(l.push(y),y._x-=I),_&&f&&(v[f-1]._wordEnd=!0)));for(f=0;j>f;f++)y=v[f],_=y.parentNode===t,"BR"!==y.nodeName?(D&&(b=y.style,R||_||(y._x+=y.parentNode._x,y._y+=y.parentNode._y),b.left=y._x+"px",b.top=y._y+"px",b.position="absolute",b.display="block",b.width=y._w+1+"px",b.height=y._h+"px"),R?_?s.push(y):A&&i.push(y):_?(t.removeChild(y),v.splice(f--,1),j--):!_&&A&&(T=!k&&!D&&y.nextSibling,t.appendChild(y),T||t.appendChild(n.createTextNode(" ")),i.push(y))):k||D?(t.removeChild(y),v.splice(f--,1),j--):R||t.appendChild(y);if(k){for(D&&(w=n.createElement("div"),t.appendChild(w),x=w.offsetWidth+"px",T=w.offsetParent===t?0:t.offsetLeft,t.removeChild(w)),b=t.style.cssText,t.style.cssText="display:none;";t.firstChild;)t.removeChild(t.firstChild);for(P=!D||!R&&!A,f=0;k.length>f;f++){for(l=k[f],w=n.createElement("div"),w.style.cssText="display:block;text-align:"+X+";position:"+(D?"absolute;":"relative;"),G&&(w.className=G+(Q?f+1:"")),o.push(w),j=l.length,d=0;j>d;d++)"BR"!==l[d].nodeName&&(y=l[d],w.appendChild(y),P&&(y._wordEnd||R)&&w.appendChild(n.createTextNode(" ")),D&&(0===d&&(w.style.top=y._y+"px",w.style.left=I+T+"px"),y.style.top="0px",T&&(y.style.left=y._x-T+"px")));R||A||(w.innerHTML=r(w).split(String.fromCharCode(160)).join(" ")),D&&(w.style.width=x,w.style.height=y._h+"px"),t.appendChild(w)}t.style.cssText=b}D&&(z>t.clientHeight&&(t.style.height=z-F+"px"
|
||
|
|