1/************************************************************************** 2 * jquery.themepunch.revolution.js - jQuery Plugin for Revolution Slider 3 * @version: 4.6.0 (15.07.2013) 4 * @requires jQuery v1.7 or later (tested on 1.9) 5 * @author ThemePunch 6**************************************************************************/ 7(function(jQuery,undefined){ 8 9 10 11 12 //////////////////////////////////////// 13 // THE REVOLUTION PLUGIN STARTS HERE // 14 /////////////////////////////////////// 15 16 jQuery.fn.extend({ 17 18 // OUR PLUGIN HERE :) 19 revolution: function(options) { 20 21 22 23 //////////////////////////////// 24 // SET DEFAULT VALUES OF ITEM // 25 //////////////////////////////// 26 defaults = { 27 delay:9000, 28 startheight:500, 29 startwidth:960, 30 fullScreenAlignForce:"off", 31 autoHeight:"off", 32 hideTimerBar:"off", 33 hideThumbs:200, 34 heightfix: false, 35 hideNavDelayOnMobile:1500, 36 37 thumbWidth:100, // Thumb With and Height and Amount (only if navigation Tyope set to thumb !) 38 thumbHeight:50, 39 thumbAmount:3, 40 41 navigationType:"bullet", // bullet, thumb, none 42 navigationArrows:"solo", // nextto, solo, none 43 navigationInGrid:"off", // on/off 44 45 hideThumbsOnMobile:"off", 46 hideBulletsOnMobile:"off", 47 hideArrowsOnMobile:"off", 48 hideThumbsUnderResoluition:0, 49 50 navigationStyle:"round", // round,square,navbar,round-old,square-old,navbar-old, or any from the list in the docu (choose between 50+ different item), 51 52 navigationHAlign:"center", // Vertical Align top,center,bottom 53 navigationVAlign:"bottom", // Horizontal Align left,center,right 54 navigationHOffset:0, 55 navigationVOffset:20, 56 navArrowWidth:40, 57 navArrowHeight:40, 58 59 soloArrowLeftHalign:"left", 60 soloArrowLeftValign:"center", 61 soloArrowLeftHOffset:20, 62 soloArrowLeftVOffset:0, 63 soloArrowLeftHasImg:"", 64 soloArrowLeftImgSrc:"", 65 66 soloArrowRightHalign:"right", 67 soloArrowRightValign:"center", 68 soloArrowRightHOffset:20, 69 soloArrowRightVOffset:0, 70 soloArrowLeftHasImg:"", 71 soloArrowRightImgSrc:"", 72 73 keyboardNavigation:"on", 74 75 touchenabled:"on", // Enable Swipe Function : on/off 76 onHoverStop:"on", // Stop Banner Timet at Hover on Slide on/off 77 hideOnFirstLast:"off", 78 79 80 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. 81 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 82 83 hideCaptionAtLimit:0, // It Defines if a caption should be shown under a Screen Resolution ( Basod on The Width of Browser) 84 hideAllCaptionAtLimit:0, // Hide all The Captions if Width of Browser is less then this value 85 hideSliderAtLimit:0, // Hide the whole slider, and stop also functions if Width of Browser is less than this value 86 87 shadow:0, //0 = no Shadow, 1,2,3 = 3 Different Art of Shadows (No Shadow in Fullwidth Version !) 88 fullWidth:"off", // Turns On or Off the Fullwidth Image Centering in FullWidth Modus 89 fullScreen:"off", 90 minFullScreenHeight:0, // The Minimum FullScreen Height 91 fullScreenOffsetContainer:"", // Size for FullScreen Slider minimising Calculated on the Container sizes 92 fullScreenOffset:"0", // Size for FullScreen Slider minimising 93 dottedOverlay:"none", //twoxtwo, threexthree, twoxtwowhite, threexthreewhite 94 95 forceFullWidth:"off", // Force The FullWidth 96 97 spinner:"spinner0", 98 99 swipe_velocity : 0.4, // Touch Sensibility between 0 - 1. Less the number is, higher the sensibility 100 swipe_max_touches : 1, // Max Finger (touch) used for swipe 101 swipe_min_touches : 1, // Min Finger (touch) used for swipe 102 drag_block_vertical:false, // Prevent Vertical Scroll during Swipe 103 isJoomla:false, 104 parallax:"off", 105 parallaxLevels: [10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85], 106 parallaxBgFreeze: "off", 107 parallaxOpacity:"on", 108 parallaxDisableOnMobile:"off" 109 110 111 }; 112 113 options = jQuery.extend({}, defaults, options); 114 115 return this.each(function() { 116 117 // REPORT SOME IMPORTAN INFORMATION ABOUT THE SLIDER 118 try{ 119// console.groupCollapsed("Slider Revolution 4.5.7 Initialisation on "+jQuery(this).attr('id')); 120// console.groupCollapsed("Used Options:"); 121// console.info(options); 122// console.groupEnd(); 123// console.groupCollapsed("Tween Engine:") 124 } catch(e) {} 125 126 // CHECK IF TweenLite IS LOADED AT ALL 127 if (punchgs.TweenLite==undefined) { 128 try{ console.error("GreenSock Engine Does not Exist!"); 129 } catch(e) {} 130 return false;
131 } 132 133 punchgs.force3D = true; 134 135 try{ 136 //console.info("GreenSock Engine Version in Slider Revolution:"+punchgs.TweenLite.version); 137 } catch(e) { 138 139 } 140 141 punchgs.TweenLite.lagSmoothing(1000,16); 142 punchgs.force3D = "true"; 143 144 initSlider(jQuery(this),options) 145 146 try{ 147 console.groupEnd(); 148 console.groupEnd(); 149 } catch(e) {} 150 151 }) 152 }, 153 154 155 // METHODE PAUSE 156 revscroll: function(oy) { 157 return this.each(function() { 158 var container=jQuery(this); 159 jQuery('body,html').animate( 160 {scrollTop:(container.offset().top+(container.find('>ul >li').height())-oy)+"px"},{duration:400}); 161 }) 162 }, 163 164 // METHODE PAUSE 165 revredraw: function(oy) { 166 return this.each(function() { 167 var container=jQuery(this); 168 var bt = container.parent().find('.tp-bannertimer'); 169 var opt = bt.data('opt'); 170 containerResized(container,opt); 171 172 }) 173 }, 174 175 // METHODE PAUSE 176 revpause: function(options) { 177 178 return this.each(function() { 179 var container=jQuery(this); 180 container.data('conthover',1); 181 container.data('conthover-changed',1); 182 container.trigger('revolution.slide.onpause'); 183 var bt = container.parent().find('.tp-bannertimer'); 184 var opt = bt.data('opt'); 185 opt.bannertimeronpause = true; 186 container.trigger('stoptimer'); 187 188 }) 189 190 191 }, 192 193 // METHODE RESUME 194 revresume: function(options) { 195 return this.each(function() { 196 var container=jQuery(this); 197 container.data('conthover',0); 198 container.data('conthover-changed',1); 199 container.trigger('revolution.slide.onresume'); 200 var bt = container.parent().find('.tp-bannertimer'); 201 var opt = bt.data('opt'); 202 opt.bannertimeronpause = false; 203 container.trigger('starttimer'); 204 205 }) 206 207 }, 208 209 // METHODE NEXT 210 revnext: function(options) { 211 return this.each(function() { 212 // CATCH THE CONTAINER 213 var container=jQuery(this); 214 container.parent().find('.tp-rightarrow').click(); 215 216 }) 217 218 }, 219 220 // METHODE RESUME 221 revprev: function(options) { 222 return this.each(function() { 223 // CATCH THE CONTAINER 224 var container=jQuery(this); 225 container.parent().find('.tp-leftarrow').click(); 226 }) 227 228 }, 229 230 // METHODE LENGTH 231 revmaxslide: function(options) { 232 // CATCH THE CONTAINER 233 return jQuery(this).find('>ul:first-child >li').length; 234 }, 235 236 237 // METHODE CURRENT 238 revcurrentslide: function(options) { 239 // CATCH THE CONTAINER 240 var container=jQuery(this); 241 var bt = container.parent().find('.tp-bannertimer'); 242 var opt = bt.data('opt'); 243 return opt.act; 244 }, 245 246 // METHODE CURRENT 247 revlastslide: function(options) { 248 // CATCH THE CONTAINER 249 var container=jQuery(this); 250 var bt = container.parent().find('.tp-bannertimer'); 251 var opt = bt.data('opt'); 252 return opt.lastslide; 253 }, 254 255 256 // METHODE JUMP TO SLIDE 257 revshowslide: function(slide) { 258 return this.each(function() { 259 // CATCH THE CONTAINER 260 var container=jQuery(this); 261 container.data('showus',slide); 262 container.parent().find('.tp-rightarrow').click(); 263 }) 264 265 } 266 267 268}) 269 270 function initSlider(container,opt) { 271 if (opt.navigationStyle=="preview1" || opt.navigationStyle=="preview3" || opt.navigationStyle=="preview4") { 272 opt.soloArrowLeftHalign="left"; 273 opt.soloArrowLeftValign="center"; 274 opt.soloArrowLeftHOffset=0; 275 opt.soloArrowLeftVOffset=0; 276 opt.soloArrowRightHalign="right"; 277 opt.soloArrowRightValign="center"; 278 opt.soloArrowRightHOffset=0; 279 opt.soloArrowRightVOffset=0; 280 opt.navigationArrows="solo"; 281 } 282 283 284 285 opt.desktop = !navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry|BB10|mobi|tablet|opera mini|nexus 7)/i); 286 287 if (opt.fullWidth!="on" && opt.fullScreen!="on") opt.autoHeight = "off"; 288 if (opt.fullScreen=="on") opt.autoHeight = "on"; 289 if (opt.fullWidth!="on" && opt.fullScreen!="on") forceFulWidth="off"; 290 291 if (opt.fullWidth=="on" && opt.autoHeight=="off")
292 container.css({maxHeight:opt.startheight+"px"}); 293 294 if (is_mobile() && opt.hideThumbsOnMobile=="on" && opt.navigationType=="thumb") 295 opt.navigationType = "none" 296 297 if (is_mobile() && opt.hideBulletsOnMobile=="on" && opt.navigationType=="bullet") 298 opt.navigationType = "none" 299 300 if (is_mobile() && opt.hideBulletsOnMobile=="on" && opt.navigationType=="both") 301 opt.navigationType = "none" 302 303 if (is_mobile() && opt.hideArrowsOnMobile=="on") 304 opt.navigationArrows = "none" 305 306 if (opt.forceFullWidth=="on" && container.closest('.forcefullwidth_wrapper_tp_banner').length==0) { 307 308 var loff = container.parent().offset().left; 309 var mb = container.parent().css('marginBottom'); 310 var mt = container.parent().css('marginTop'); 311 if (mb==undefined) mb=0; 312 if (mt==undefined) mt=0; 313 314 container.parent().wrap('<div style="position:relative;width:100%;height:auto;margin-top:'+mt+';margin-bottom:'+mb+'" class="forcefullwidth_wrapper_tp_banner"></div>'); 315 container.closest('.forcefullwidth_wrapper_tp_banner').append('<div class="tp-fullwidth-forcer" style="width:100%;height:'+container.height()+'px"></div>'); 316 container.css({'backgroundColor':container.parent().css('backgroundColor'),'backgroundImage':container.parent().css('backgroundImage')}); 317 //container.parent().css({'position':'absolute','width':jQuery(window).width()}); 318 container.parent().css({'left':(0-loff)+"px",position:'absolute','width':jQuery(window).width()}); 319 opt.width=jQuery(window).width(); 320 } 321 322 // HIDE THUMBS UNDER RESOLUTION 323 try{ 324 if (opt.hideThumbsUnderResolution>jQuery(window).width() && opt.hideThumbsUnderResolution!=0) { 325 container.parent().find('.tp-bullets.tp-thumbs').css({display:"none"}); 326 } else { 327 container.parent().find('.tp-bullets.tp-thumbs').css({display:"block"}); 328 } 329 } catch(e) {} 330 331 if (!container.hasClass("revslider-initialised")) { 332 333 container.addClass("revslider-initialised"); 334 if (container.attr('id')==undefined) container.attr('id',"revslider-"+Math.round(Math.random()*1000+5)); 335 336 // CHECK IF FIREFOX 13 IS ON WAY.. IT HAS A STRANGE BUG, CSS ANIMATE SHOULD NOT BE USED 337 338 339 340 opt.firefox13 = false; 341 opt.ie = !jQuery.support.opacity; 342 opt.ie9 = (document.documentMode == 9); 343 344 opt.origcd=opt.delay; 345 346 // CHECK THE jQUERY VERSION 347 var version = jQuery.fn.jquery.split('.'), 348 versionTop = parseFloat(version[0]), 349 versionMinor = parseFloat(version[1]), 350 versionIncrement = parseFloat(version[2] || '0'); 351 352 if (versionTop==1 && versionMinor < 7) { 353 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>'); 354 } 355 356 if (versionTop>1) opt.ie=false; 357 358 359 // Delegate .transition() calls to .animate() 360 // if the browser can't do CSS transitions. 361 if (!jQuery.support.transition) 362 jQuery.fn.transition = jQuery.fn.animate; 363 364 // CATCH THE CONTAINER 365 366 367 // LOAD THE YOUTUBE API IF NECESSARY 368 369 container.find('.caption').each(function() { jQuery(this).addClass('tp-caption')}); 370 371 if (is_mobile()) { 372 container.find('.tp-caption').each(function() { 373 if (jQuery(this).data('autoplay')==true) 374 jQuery(this).data('autoplay',false); 375 // && jQuery(this).data('forcecover')!=1) 376 }) 377 } 378 379 380 var addedyt=0; 381 var addedvim=0; 382 var addedvid=0; 383 var httpprefix = "http"; 384 385 if (location.protocol === 'https:') { 386 httpprefix = "https"; 387 } 388 container.find('.tp-caption iframe').each(function(i) { 389 try { 390 391 if (jQuery(this).attr('src').indexOf('you')>0 && addedyt==0) { 392 addedyt=1; 393 var s = document.createElement("script"); 394 var httpprefix2 = "https"; 395 s.src = httpprefix2+"://www.youtube.com/iframe_api"; /* Load Player API*/ 396 397 var before = document.getElementsByTagName("script")[0]; 398 var loadit = true; 399 jQuery('head').find('*').each(function(){ 400 if (jQuery(this).attr('src') == httpprefix2+"://www.youtube.com/iframe_api") 401 loadit = false;
402 }); 403 if (loadit) { 404 before.parentNode.insertBefore(s, before); 405 406 407 } 408 } 409 } catch(e) {} 410 }); 411 412 413 414 // LOAD THE VIMEO API 415 container.find('.tp-caption iframe').each(function(i) { 416 try{ 417 if (jQuery(this).attr('src').indexOf('vim')>0 && addedvim==0) { 418 addedvim=1; 419 var f = document.createElement("script"); 420 f.src = httpprefix+"://f.vimeocdn.com/js/froogaloop2.min.js"; /* Load Player API*/ 421 var before = document.getElementsByTagName("script")[0]; 422 423 var loadit = true; 424 jQuery('head').find('*').each(function(){ 425 if (jQuery(this).attr('src') == httpprefix+"://f.vimeocdn.com/js/froogaloop2.min.js") 426 loadit = false; 427 }); 428 if (loadit) 429 before.parentNode.insertBefore(f, before); 430 } 431 } catch(e) {} 432 }); 433 434 435 436 437 438 // LOAD THE VIDEO.JS API IF NEEDED 439 container.find('.tp-caption video').each(function(i) { 440 jQuery(this).removeClass("video-js").removeClass("vjs-default-skin"); 441 jQuery(this).attr("preload",""); 442 jQuery(this).css({display:"none"}); 443 }); 444 445 // SHUFFLE MODE 446 if (opt.shuffle=="on") { 447 for (var u=0;u<container.find('>ul:first-child >li').length;u++) { 448 var it = Math.round(Math.random()*container.find('>ul:first-child >li').length); 449 container.find('>ul:first-child >li:eq('+it+')').prependTo(container.find('>ul:first-child')); 450 } 451 } 452 453 454 // CREATE SOME DEFAULT OPTIONS FOR LATER 455 opt.slots=4; 456 opt.act=-1; 457 opt.next=0; 458 459 // IF START SLIDE IS SET 460 if (opt.startWithSlide !=undefined) opt.next=opt.startWithSlide; 461 462 // IF DEEPLINK HAS BEEN SET 463 var deeplink = getUrlVars("#")[0]; 464 if (deeplink.length<9) { 465 if (deeplink.split('slide').length>1) { 466 var dslide=parseInt(deeplink.split('slide')[1],0); 467 if (dslide<1) dslide=1; 468 if (dslide>container.find('>ul:first >li').length) dslide=container.find('>ul:first >li').length; 469 opt.next=dslide-1; 470 } 471 } 472 473 474 opt.firststart=1; 475 476 // BASIC OFFSET POSITIONS OF THE BULLETS 477 if (opt.navigationHOffset==undefined) opt.navOffsetHorizontal=0; 478 if (opt.navigationVOffset==undefined) opt.navOffsetVertical=0; 479 480 481 482 container.append('<div class="tp-loader '+opt.spinner+'">'+ 483 '<div class="dot1"></div>'+ 484 '<div class="dot2"></div>'+ 485 '<div class="bounce1"></div>'+ 486 '<div class="bounce2"></div>'+ 487 '<div class="bounce3"></div>'+ 488 '</div>'); 489 490 // RESET THE TIMER 491 if (container.find('.tp-bannertimer').length==0) container.append('<div class="tp-bannertimer" style="visibility:hidden"></div>'); 492 var bt=container.find('.tp-bannertimer'); 493 if (bt.length>0) { 494 bt.css({'width':'0%'}); 495 }; 496 497 498 // WE NEED TO ADD A BASIC CLASS FOR SETTINGS.CSS 499 container.addClass("tp-simpleresponsive"); 500 opt.container=container; 501 502 //if (container.height()==0) container.height(opt.startheight); 503 504 // AMOUNT OF THE SLIDES 505 opt.slideamount = container.find('>ul:first >li').length; 506 507 508 // A BASIC GRID MUST BE DEFINED. IF NO DEFAULT GRID EXIST THAN WE NEED A DEFAULT VALUE, ACTUAL SIZE OF CONAINER 509 if (container.height()==0) container.height(opt.startheight); 510 if (opt.startwidth==undefined || opt.startwidth==0) opt.startwidth=container.width(); 511 if (opt.startheight==undefined || opt.startheight==0) opt.startheight=container.height(); 512 513 // OPT WIDTH && HEIGHT SHOULD BE SET 514 opt.width=container.width(); 515 opt.height=container.height(); 516 517 518 // DEFAULT DEPENDECIES 519 opt.bw= opt.startwidth / container.width(); 520 opt.bh = opt.startheight / container.height(); 521 522 // IF THE ITEM ALREADY IN A RESIZED FORM 523 if (opt.width!=opt.startwidth) { 524 525 opt.height = Math.round(opt.startheight * (opt.width/opt.
525startwidth)); 526 527 container.height(opt.height); 528 529 } 530 531 // LETS SEE IF THERE IS ANY SHADOW 532 if (opt.shadow!=0) { 533 container.parent().append('<div class="tp-bannershadow tp-shadow'+opt.shadow+'"></div>'); 534 var loff=0; 535 if (opt.forceFullWidth=="on") 536 loff = 0-opt.container.parent().offset().left; 537 container.parent().find('.tp-bannershadow').css({'width':opt.width,'left':loff}); 538 } 539 540 541 container.find('ul').css({'display':'none'}); 542 543 var fliparent = container; 544 545 546 // PREPARE THE SLIDES 547 container.find('ul').css({'display':'block'}); 548 prepareSlides(container,opt); 549 if (opt.parallax!="off") checkForParallax(container,opt); 550 551 // CREATE BULLETS 552 if (opt.slideamount >1) createBullets(container,opt); 553 554 if (opt.slideamount >1 && opt.navigationType=="thumb") createThumbs(container,opt); 555 if (opt.slideamount >1) createArrows(container,opt); 556 if (opt.keyboardNavigation=="on") createKeyboard(container,opt); 557 558 try{ 559 swipeAction(container,opt); 560 } catch(e) {} 561 562 if (opt.hideThumbs>0) hideThumbs(container,opt); 563 564 swapSlide(container,opt); 565 // START COUNTDOWN 566 if (opt.slideamount >1) countDown(container,opt); 567 setTimeout(function() { 568 container.trigger('revolution.slide.onloaded'); 569 },500); 570 571 572 573 /****************************** 574 - FULLSCREEN CHANGE - 575 ********************************/ 576 // FULLSCREEN MODE TESTING 577 jQuery("body").data('rs-fullScreenMode',false); 578 jQuery(window).on ('mozfullscreenchange webkitfullscreenchange fullscreenchange',function(){ 579 jQuery("body").data('rs-fullScreenMode',!jQuery("body").data('rs-fullScreenMode')); 580 if (jQuery("body").data('rs-fullScreenMode')) { 581 setTimeout(function() { 582 jQuery(window).trigger("resize"); 583 584 },200); 585 } 586 }) 587 588 589 // IF RESIZED, NEED TO STOP ACTUAL TRANSITION AND RESIZE ACTUAL IMAGES 590 jQuery(window).resize(function() { 591 if (jQuery('body').find(container)!=0) 592 if (opt.forceFullWidth=="on" ) { 593 594 var loff = opt.container.closest('.forcefullwidth_wrapper_tp_banner').offset().left; 595 //opt.container.parent().css({'width':jQuery(window).width()}); 596 opt.container.parent().css({'left':(0-loff)+"px",'width':jQuery(window).width()}); 597 } 598 599 if (container.outerWidth(true)!=opt.width || container.is(":hidden")) { 600 containerResized(container,opt); 601 } 602 603 604 605 606 }); 607 608 // HIDE THUMBS UNDER SIZE... 609 try{ 610 if (opt.hideThumbsUnderResoluition!=0 && opt.navigationType=="thumb") { 611 if (opt.hideThumbsUnderResoluition>jQuery(window).width()) 612 jQuery('.tp-bullets').css({display:"none"}); 613 else 614 jQuery('.tp-bullets').css({display:"block"}); 615 } 616 } catch(e) {} 617 618 619 620 // CHECK IF THE CAPTION IS A "SCROLL ME TO POSITION" CAPTION IS 621 //if (opt.fullScreen=="on") { 622 container.find('.tp-scrollbelowslider').on('click',function() { 623 var off=0; 624 try{ 625 off = jQuery('body').find(opt.fullScreenOffsetContainer).height(); 626 } catch(e) {} 627 try{ 628 off = off - jQuery(this).data('scrolloffset'); 629 } catch(e) {} 630 631 632 jQuery('body,html').animate( 633 {scrollTop:(container.offset().top+(container.find('>ul >li').height())-off)+"px"},{duration:400}); 634 }); 635 //} 636 637 638 // FIRST TIME STOP/START HIDE / SHOW SLIDER 639 //REMOVE AND SHOW SLIDER ON DEMAND 640 var contpar= container.parent(); 641 if (jQuery(window).width()<opt.hideSliderAtLimit) { 642 container.trigger('stoptimer'); 643 if (contpar.css('display')!="none") 644 contpar.data('olddisplay',contpar.css('display')); 645 contpar.css({display:"none"}); 646 } 647 } 648 649 } 650 651 652 653/****************************** 654 - MODULES - 655********************************/ 656 657 658 659 /////////////////////////// 660 // GET THE URL PARAMETER // 661 /////////////////////////// 662 var getUrlVars = function (hashdivider) 663 { 664 var vars = [], hash; 665 var hashes = window.location.href.slice(window.location.href.indexOf(hashdivider) + 1).split('_'); 666 for(var i = 0; i < hashes.length; i++) 667 { 668 hashes[i] = hashes[i].replace('%3D',"="); 669 hash = hashes[i].split('='); 670 vars.push(hash[0]); 671 vars[hash[0]] = hash[1]; 672 } 673 return vars; 674 } 675 676 ////////////////////////// 677 // CONTAINER RESIZED // 678 ///////////////////////// 679 var containerResized = function (container,opt) { 680 681 // HIDE THUMBS UNDER SIZE... 682 try{ 683 if (opt.hideThumbsUnderResoluition!=0 && opt.navigationType=="thumb") { 684 if (opt.hideThumbsUnderResoluition>jQuery(window).width()) 685 jQuery('.tp-bullets').css({display:"none"}); 686 else 687 jQuery('.tp-bullets').css({display:"block"}); 688 } 689 } catch(e) {} 690 691 692 693 container.find('.defaultimg').each(function(i) { 694 setSize(jQuery(this),opt); 695 }); 696 697 698 //REMOVE AND SHOW SLIDER ON DEMAND 699 var contpar= container.parent(); 700 if (jQuery(window).width()<opt.hideSliderAtLimit) { 701 container.trigger('stoptimer'); 702 if (contpar.css('display')!="none") 703 contpar.data('olddisplay',contpar.css('display')); 704 contpar.css({display:"none"}); 705 706 } else { 707 708 if (container.is(":hidden")) { 709 if (contpar.data('olddisplay')!=undefined && contpar.data('olddisplay')!="undefined" && contpar.data('olddisplay') != "none") 710 contpar.css({display:contpar.data('olddisplay')}); 711 else 712 contpar.css({display:"block"}); 713 container.trigger('restarttimer'); 714 setTimeout(function() { 715 containerResized(container,opt); 716 },150) 717 } 718 } 719 720 721 var loff=0; 722 if (opt.forceFullWidth=="on") 723 loff = 0-opt.container.parent().offset().left; 724 try{ 725 container.parent().find('.tp-bannershadow').css({'width':opt.width,'left':loff}); 726 } catch(e) {} 727 728 var actsh = container.find('>ul >li:eq('+opt.act+') .slotholder'); 729 var nextsh = container.find('>ul >li:eq('+opt.next+') .slotholder'); 730 removeSlots(container,opt,container); 731 punchgs.TweenLite.set(nextsh.find('.defaultimg'),{opacity:0}
731); 732 actsh.find('.defaultimg').css({'opacity':1}); 733 734 nextsh.find('.defaultimg').each(function() { 735 var dimg = jQuery(this); 736 if (dimg.data('kenburn')!=undefined) { 737 dimg.data('kenburn').restart(); 738 startKenBurn(container,opt,true) 739 } 740 }); 741 742 var nextli = container.find('>ul >li:eq('+opt.next+')'); 743 744 745 746 var arr = container.parent().find('.tparrows'); 747 if (arr.hasClass("preview2")) 748 arr.css({width:(parseInt(arr.css('minWidth'),0))}); 749 750 751 animateTheCaptions(nextli, opt,true); 752 //restartBannerTimer(opt,container); 753 setBulPos(container,opt); 754 755 } 756 757 758 759 760 /********************************* 761 - CHECK IF BROWSER IS IE - 762 ********************************/ 763 var isIE = function( version, comparison ){ 764 var $div = jQuery('<div style="display:none;"/>').appendTo(jQuery('body')); 765 $div.html('<!--[if '+(comparison||'')+' IE '+(version||'')+']><a> </a><![endif]-->'); 766 var ieTest = $div.find('a').length; 767 $div.remove(); 768 return ieTest; 769 } 770 771 772 var callingNewSlide = function(opt,container) { 773 774 swapSlide(container,opt); 775 776 } 777 778 779 780 781 782 783 //////////////////////////////// 784 // - CREATE THE BULLETS - // 785 //////////////////////////////// 786 var createBullets = function(container,opt) { 787 var starthidebullets = "hidebullets"; 788 if (opt.hideThumbs==0) starthidebullets = ""; 789 790 if (opt.navigationType=="bullet" || opt.navigationType=="both") { 791 container.parent().append('<div class="tp-bullets '+starthidebullets+' simplebullets '+opt.navigationStyle+'"></div>'); 792 } 793 794 795 var bullets = container.parent().find('.tp-bullets'); 796 797 container.find('>ul:first >li').each(function(i) { 798 var src=container.find(">ul:first >li:eq("+i+") img:first").attr('src'); 799 bullets.append('<div class="bullet"></div>'); 800 var bullet= bullets.find('.bullet:first'); 801 802 803 }); 804 805 // ADD THE BULLET CLICK FUNCTION HERE 806 bullets.find('.bullet').each(function(i) { 807 var bul = jQuery(this); 808 if (i==opt.slideamount-1) bul.addClass('last'); 809 if (i==0) bul.addClass('first'); 810 811 bul.click(function() { 812 var sameslide = false; 813 if (opt.navigationArrows=="withbullet" || opt.navigationArrows=="nexttobullets") { 814 if (bul.index()-1 == opt.act) sameslide=true; 815 } else { 816 if (bul.index() == opt.act) sameslide=true; 817 } 818 819 if (opt.transition==0 && !sameslide) { 820 821 if (opt.navigationArrows=="withbullet" || opt.navigationArrows=="nexttobullets") { 822 opt.next = bul.index()-1; 823 } else { 824 opt.next = bul.index(); 825 } 826 827 callingNewSlide(opt,container); 828 } 829 }); 830 831 }); 832 833 bullets.append('<div class="tpclear"></div>'); 834 835 836 837 setBulPos(container,opt); 838 839 840 841 842 843 } 844 845 ////////////////////// 846 // CREATE ARROWS // 847 ///////////////////// 848 var createArrows = function(container,opt) { 849 850 var bullets = container.find('.tp-bullets'); 851 852 var hidden="", 853 starthidearrows = "hidearrows"; 854 855 if (opt.hideThumbs==0) starthidearrows = ""; 856 857 var arst= opt.navigationStyle; 858 if (opt.navigationArrows=="none") hidden="visibility:hidden;display:none"; 859 opt.soloArrowStyle = "default"+" "+opt.navigationStyle; 860 861 if (opt.navigationArrows!="none" && opt.navigationArrows!="nexttobullets") arst = opt.soloArrowStyle; 862 863 function aArrow(dir) { 864 container.parent().append('<div style="'+hidden+'" class="tp-'+dir+'arrow '+starthidearrows+' tparrows '+arst+'"><div class="tp-arr-allwrapper"><div class="tp-arr-iwrapper"><div class="tp-arr-imgholder"></div><div class="tp-arr-imgholder2"></div><div class="tp-arr-titleholder"></div><div class="tp-arr-subtitleholder"></div></div></div></div>'); 865 } 866 aArrow("left"); 867 aArrow("right"); 868 869 // THE LEFT / RIGHT BUTTON CLICK ! // 870 container.parent().find('.tp-rightarrow').click(function() { 871 872 if (opt.transition==0) { 873 if (container.data('showus') !=undefined && container.data('showus') != -1) 874 opt.next = container.data('showus')-1; 875 else 876 opt.next = opt.next+1; 877 container.data('showus',-1); 878 if (opt.next >= opt.slideamount) opt.next=0; 879 if (opt.next<0) opt.next=0; 880 881 if (opt.act !=opt.next) 882 callingNewSlide(opt,container); 883 } 884 }); 885 886 container.parent().find('.tp-leftarrow').click(function() { 887 if (opt.transition==0) { 888 opt.next = opt.next-1; 889 opt.leftarrowpressed=1;
890 if (opt.next < 0) opt.next=opt.slideamount-1; 891 callingNewSlide(opt,container); 892 } 893 }); 894 895 setBulPos(container,opt); 896 897 } 898 899 ////////////////////// 900 // CREATE ARROWS // 901 ///////////////////// 902 var createKeyboard = function(container,opt) { 903 904 905 // THE LEFT / RIGHT BUTTON CLICK ! // 906 jQuery(document).keydown(function(e){ 907 if (opt.transition==0 && e.keyCode == 39) { 908 if (container.data('showus') !=undefined && container.data('showus') != -1) 909 opt.next = container.data('showus')-1; 910 else 911 opt.next = opt.next+1; 912 container.data('showus',-1); 913 if (opt.next >= opt.slideamount) opt.next=0; 914 if (opt.next<0) opt.next=0; 915 916 if (opt.act !=opt.next) 917 callingNewSlide(opt,container); 918 } 919 920 if (opt.transition==0 && e.keyCode == 37) { 921 opt.next = opt.next-1; 922 opt.leftarrowpressed=1; 923 if (opt.next < 0) opt.next=opt.slideamount-1; 924 callingNewSlide(opt,container); 925 } 926 }); 927 928 setBulPos(container,opt); 929 930 } 931 932 //////////////////////////// 933 // SET THE SWIPE FUNCTION // 934 //////////////////////////// 935 var swipeAction = function(container,opt) { 936 // TOUCH ENABLED SCROLL 937 938 if (opt.touchenabled=="on") { 939 try { 940 var hammertime = Hammer(container, { 941 drag_block_vertical : opt.drag_block_vertical, 942 drag_lock_to_axis: true, 943 swipe_velocity : opt.swipe_velocity, 944 swipe_max_touches : opt.swipe_max_touches, 945 swipe_min_touches : opt.swipe_min_touches, 946 prevent_default:false 947 }); 948 949 950 951 hammertime.on("swipeleft", function() { 952 if (opt.transition==0) { 953 opt.next = opt.next+1; 954 if (opt.next == opt.slideamount) opt.next=0; 955 callingNewSlide(opt,container); 956 } 957 }); 958 hammertime.on("swiperight", function() { 959 if (opt.transition==0) { 960 opt.next = opt.next-1; 961 opt.leftarrowpressed=1; 962 if (opt.next < 0) opt.next=opt.slideamount-1; 963 callingNewSlide(opt,container); 964 } 965 }); 966 hammertime.on("swipeup", function() { 967 jQuery("html, body").animate({scrollTop:(container.offset().top + container.height())+"px"}); 968 }); 969 hammertime.on("swipedown", function() { 970 jQuery("html, body").animate({scrollTop:(container.offset().top - jQuery(window).height())+"px"}); 971 }); 972 } catch(e) {} 973 } 974 975 } 976 977 978 979 980 //////////////////////////////////////////////////////////////// 981 // SHOW AND HIDE THE THUMBS IF MOUE GOES OUT OF THE BANNER /// 982 ////////////////////////////////////////////////////////////// 983 var hideThumbs = function(container,opt) { 984 985 var bullets = container.parent().find('.tp-bullets'); 986 var ca = container.parent().find('.tparrows'); 987 988 if (bullets==null) { 989 container.append('<div class=".tp-bullets"></div>'); 990 var bullets = container.parent().find('.tp-bullets'); 991 } 992 993 if (ca==null) { 994 container.append('<div class=".tparrows"></div>'); 995 var ca = container.parent().find('.tparrows'); 996 } 997 998 999 //var bp = (thumbs.parent().outerHeight(true) - opt.height)/2; 1000 1001 // ADD THUMBNAIL IMAGES FOR THE BULLETS // 1002 container.data('hideThumbs',opt.hideThumbs); 1003 1004 bullets.addClass("hidebullets"); 1005 ca.addClass("hidearrows"); 1006 1007 if (is_mobile()) { 1008 try{ 1009 container.hammer().on('touch', function() { 1010 container.addClass("hovered"); 1011 if (opt.onHoverStop=="on") 1012 container.trigger('stoptimer'); 1013 clearTimeout(container.data('hideThumbs')); 1014 bullets.removeClass("hidebullets"); 1015 ca.removeClass("hidearrows"); 1016 1017 1018 }); 1019 1020 container.hammer().on('release', function() { 1021 container.removeClass("hovered"); 1022 container.trigger('playtimer'); 1023 if (!container.hasClass("hovered") && !bullets.hasClass("hovered")) 1024 container.data('hideThumbs', setTimeout(function() { 1025 bullets.addClass("hidebullets"); 1026 ca.addClass("hidearrows"); 1027 container.trigger('playtimer'); 1028 },opt.hideNavDelayOnMobile)); 1029 }); 1030 } catch(e) {} 1031 1032 } else { 1033 bullets.hover(function() { 1034 opt.overnav = true; 1035 if (opt.onHoverStop=="on") 1036 container.trigger('stoptimer'); 1037 bullets.addClass("hovered"); 1038 clearTimeout(container.data('hideThumbs')); 1039 bullets.removeClass("hidebullets"); 1040 ca.removeClass("hidearrows"); 1041 }, 1042 function() { 1043 opt.overnav = false;
1044 container.trigger('playtimer'); 1045 bullets.removeClass("hovered"); 1046 if (!container.hasClass("hovered") && !bullets.hasClass("hovered")) 1047 container.data('hideThumbs', setTimeout(function() { 1048 bullets.addClass("hidebullets"); 1049 ca.addClass("hidearrows"); 1050 },opt.hideThumbs)); 1051 }); 1052 1053 1054 ca.hover(function() { 1055 opt.overnav = true; 1056 if (opt.onHoverStop=="on") 1057 container.trigger('stoptimer'); 1058 bullets.addClass("hovered"); 1059 clearTimeout(container.data('hideThumbs')); 1060 bullets.removeClass("hidebullets"); 1061 ca.removeClass("hidearrows"); 1062 1063 }, 1064 function() { 1065 opt.overnav = false; 1066 container.trigger('playtimer'); 1067 bullets.removeClass("hovered"); 1068 }); 1069 1070 1071 1072 container.on('mouseenter', function() { 1073 container.addClass("hovered"); 1074 if (opt.onHoverStop=="on") 1075 container.trigger('stoptimer'); 1076 clearTimeout(container.data('hideThumbs')); 1077 bullets.removeClass("hidebullets"); 1078 ca.removeClass("hidearrows"); 1079 1080 1081 }); 1082 1083 container.on('mouseleave', function() { 1084 container.removeClass("hovered"); 1085 container.trigger('playtimer'); 1086 if (!container.hasClass("hovered") && !bullets.hasClass("hovered")) 1087 container.data('hideThumbs', setTimeout(function() { 1088 bullets.addClass("hidebullets"); 1089 ca.addClass("hidearrows"); 1090 },opt.hideThumbs)); 1091 }); 1092 } 1093 1094 1095 } 1096 1097 1098 1099 1100 1101 1102 1103 ////////////////////////////// 1104 // SET POSITION OF BULLETS // 1105 ////////////////////////////// 1106 var setBulPos = function(container,opt) { 1107 var topcont=container.parent(); 1108 var bullets=topcont.find('.tp-bullets'); 1109 1110 if (opt.navigationType=="thumb") { 1111 bullets.find('.thumb').each(function(i) { 1112 var thumb = jQuery(this); 1113 1114 thumb.css({'width':opt.thumbWidth * opt.bw+"px", 'height':opt.thumbHeight*opt.bh+"px"}); 1115 1116 }) 1117 var bup = bullets.find('.tp-mask'); 1118 1119 bup.width(opt.thumbWidth*opt.thumbAmount * opt.bw); 1120 bup.height(opt.thumbHeight * opt.bh); 1121 bup.parent().width(opt.thumbWidth*opt.thumbAmount * opt.bw); 1122 bup.parent().height(opt.thumbHeight * opt.bh); 1123 } 1124 1125 1126 var tl = topcont.find('.tp-leftarrow'); 1127 var tr = topcont.find('.tp-rightarrow'); 1128 1129 if (opt.navigationType=="thumb" && opt.navigationArrows=="nexttobullets") opt.navigationArrows="solo"; 1130 // IM CASE WE HAVE NAVIGATION BULLETS TOGETHER WITH ARROWS 1131 if (opt.navigationArrows=="nexttobullets") { 1132 tl.prependTo(bullets).css({'float':'left'}); 1133 tr.insertBefore(bullets.find('.tpclear')).css({'float':'left'}); 1134 } 1135 var loff=0; 1136 if (opt.forceFullWidth=="on") 1137 loff = 0-opt.container.parent().offset().left; 1138 1139 var gridposX = 0, 1140 gridposY = 0; 1141 1142 if (opt.navigationInGrid=="on") { 1143 gridposX = container.width()>opt.startwidth ? (container.width() - opt.startwidth)/2 : 0, 1144 gridposY = container.height()>opt.startheight ? (container.height() - opt.startheight)/2 : 0; 1145 } 1146 1147 if (opt.navigationArrows!="none" && opt.navigationArrows!="nexttobullets") { 1148 1149 tl.css({'position':'absolute'}); 1150 tr.css({'position':'absolute'}); 1151 1152 tl.css({"width":(opt.navArrowWidth)+"px"}); 1153 tl.css({"height":(opt.navArrowHeight)+"px"}); 1154 tr.css({"width":(opt.navArrowWidth)+"px"}); 1155 tr.css({"height":(opt.navArrowHeight)+"px"}); 1156 if (opt.soloArrowLeftValign=="center") tl.css({'top':'50%','marginTop':(opt.soloArrowLeftVOffset-Math.round(tl.innerHeight()/2))+"px"}); 1157 if (opt.soloArrowLeftValign=="bottom") tl.css({'top':'auto','bottom':(0+opt.soloArrowLeftVOffset)+"px"}); 1158 if (opt.soloArrowLeftValign=="top") tl.css({'bottom':'auto','top':(0+opt.soloArrowLeftVOffset)+"px"}); 1159 if (opt.soloArrowLeftHalign=="center") tl.css({'left':'50%','marginLeft':(loff+opt.soloArrowLeftHOffset-Math.round(tl.innerWidth()/2))+"px"}); 1160 if (opt.soloArrowLeftHalign=="left") tl.css({'left':(gridposX+opt.soloArrowLeftHOffset+loff)+"px"}); 1161 if (opt.soloArrowLeftHalign=="right") tl.css({'right':(gridposX+opt.soloArrowLeftHOffset-loff)+"px"}); 1162 if (opt.soloArrowLeftHasImg!=""){ 1163 if (opt.soloArrowLeftImgSrc !="") tl.css({'background':'url('+opt.soloArrowLeftImgSrc+') no-repeat','background-size': 'contain'}); 1164 }; 1165 if (opt.soloArrowRightValign=="center") tr.css({'top':'50%','marginTop':(opt.soloArrowRightVOffset-Math.round(tr.innerHe
1165ight()/2))+"px"}); 1166 if (opt.soloArrowRightValign=="bottom") tr.css({'top':'auto','bottom':(0+opt.soloArrowRightVOffset)+"px"}); 1167 if (opt.soloArrowRightValign=="top") tr.css({'bottom':'auto','top':(0+opt.soloArrowRightVOffset)+"px"}); 1168 if (opt.soloArrowRightHalign=="center") tr.css({'left':'50%','marginLeft':(loff+opt.soloArrowRightHOffset-Math.round(tr.innerWidth()/2))+"px"}); 1169 if (opt.soloArrowRightHalign=="left") tr.css({'left':(gridposX+opt.soloArrowRightHOffset+loff)+"px"}); 1170 if (opt.soloArrowRightHalign=="right") tr.css({'right':(gridposX+opt.soloArrowRightHOffset-loff)+"px"}); 1171 if (opt.soloArrowRightHasImg!=""){ 1172 if (opt.soloArrowRightImgSrc !="") tr.css({'background':'url('+opt.soloArrowRightImgSrc+') no-repeat','background-size':'contain'}); 1173 }; 1174 1175 1176 if (tl.position()!=null) 1177 tl.css({'top':Math.round(parseInt(tl.position().top,0))+"px"}); 1178 1179 if (tr.position()!=null) 1180 tr.css({'top':Math.round(parseInt(tr.position().top,0))+"px"}); 1181 } 1182 1183 if (opt.navigationArrows=="none") { 1184 tl.css({'visibility':'hidden'}); 1185 tr.css({'visibility':'hidden'}); 1186 } 1187 1188 // SET THE POSITIONS OF THE BULLETS // THUMBNAILS 1189 1190 1191 if (opt.navigationVAlign=="center") bullets.css({'top':'50%','marginTop':(opt.navigationVOffset-Math.round(bullets.innerHeight()/2))+"px"}); 1192 if (opt.navigationVAlign=="bottom") bullets.css({'bottom':(0+opt.navigationVOffset)+"px"}); 1193 if (opt.navigationVAlign=="top") bullets.css({'top':(0+opt.navigationVOffset)+"px"}); 1194 1195 1196 1197 if (opt.navigationHAlign=="center") bullets.css({'left':'50%','marginLeft':(loff+opt.navigationHOffset-Math.round(bullets.innerWidth()/2))+"px"}); 1198 if (opt.navigationHAlign=="left") bullets.css({'left':(0+opt.navigationHOffset+loff)+"px"}); 1199 if (opt.navigationHAlign=="right") bullets.css({'right':(0+opt.navigationHOffset-loff)+"px"}); 1200 } 1201 1202 1203 /******************************************************* 1204 - HANDLING OF PREVIEWS AND CUSTOM PREVIEWS - 1205 *******************************************************/ 1206 1207 var handleSpecialPreviews = function(opt) { 1208 1209 var container= opt.container; 1210 // FILL WITH INFOS THE NAVIGATION ARROWS 1211 opt.beforli = opt.next-1; 1212 opt.comingli = opt.next+1; 1213 1214 if (opt.beforli<0) opt.beforli = opt.slideamount-1; 1215 if (opt.comingli>=opt.slideamount) opt.comingli = 0; 1216 1217 var comingli = container.find('>ul:first-child >li:eq('+opt.comingli+')'), 1218 beforli = container.find('>ul:first-child >li:eq('+opt.beforli+')'), 1219 previmgsrc = beforli.find('.defaultimg').attr('src'), 1220 nextimgsrc = comingli.find('.defaultimg').attr('src'); 1221 1222 // SAVE REFERENCES 1223 if (opt.arr == undefined) { 1224 opt.arr = container.parent().find('.tparrows'), 1225 opt.rar = container.parent().find('.tp-rightarrow'), 1226 opt.lar = container.parent().find('.tp-leftarrow'), 1227 opt.raimg = opt.rar.find('.tp-arr-imgholder'), 1228 opt.laimg = opt.lar.find('.tp-arr-imgholder'), 1229 opt.raimg_b = opt.rar.find('.tp-arr-imgholder2'), 1230 opt.laimg_b = opt.lar.find('.tp-arr-imgholder2'), 1231 opt.ratit = opt.rar.find('.tp-arr-titleholder'), 1232 opt.latit = opt.lar.find('.tp-arr-titleholder'); 1233 } 1234 1235 // READ REFERENCES 1236 var arr = opt.arr, 1237 rar = opt.rar, 1238 lar = opt.lar, 1239 raimg = opt.raimg, 1240 laimg = opt.laimg, 1241 raimg_b = opt.raimg_b, 1242 laimg_b = opt.laimg_b, 1243 ratit = opt.ratit, 1244 latit = opt.latit; 1245 1246 1247 if (comingli.data('title') != undefined) ratit.html(comingli.data('title')); 1248 if (beforli.data('title') != undefined) latit.html(beforli.data('title')); 1249 1250 1251 if (rar.hasClass("itishovered")) { 1252 rar.width(ratit.outerWidth(true)+parseInt(rar.css('minWidth'),0)); 1253 } 1254 1255 if (lar.hasClass("itishovered")) { 1256 lar.width(latit.outerWidth(true)+parseInt(lar.css('minWidth'),0)); 1257 } 1258 1259 if (arr.hasClass("preview2") && !arr.hasClass("hashoveralready")) { 1260 1261 arr.addClass("hashoveralready"); 1262 if (!is_mobile()) 1263 arr.hover(function() { 1264 var arr = jQuery(this), 1265 th = arr.find('.tp-arr-titleholder'); 1266 arr.width(th.outerWidth(true)+parseInt(arr.css('minWidth'),0)); 1267 arr.addClass("itishovered"); 1268 },function() { 1269 var arr = jQuery(this), 1270 th = arr.find('.tp-arr-titleholder'); 1271 arr.css({width:parseInt(arr.css('minWidth'),0)}); 1272 arr.removeClass("itishovered"); 1273 }); 1274 else { 1275 var arr = jQuery(this), 1276 th = arr.find('.tp-arr-titleholder'); 1277 th.addClass("alwayshidden"); 1278 punchgs.TweenLite.set(th,{autoAlpha:0}); 1279 } 1280 1281 } 1282 1283 if (beforli.data('thumb')!=undefined) previmgsrc = beforli.data('thumb'); 1284 if (comingli.data('thumb')!=undefined) nextimgsrc = comingli.data('thumb') 1285 1286 1287 // CHANGE THE IMAGE SOURCE (AND ANIMATE IF PREVIEW4 MODE IS ON 1288 if (!arr.hasClass("preview4")) { 1289 punchgs.TweenLite.to(raimg,0.5,{autoAlpha:0,onComplete:function() { 1290 raimg.css({'backgroundImage':'url('+nextimgsrc+')'}); 1291 laimg.css({'backgroundImage':'url('+previmgsrc+')'}); 1292 }}); 1293 punchgs.TweenLite.to(laimg,0.5,{autoAlpha:0,onComplete:function() { 1294 punchgs.TweenLite.to(raimg,0.5,{autoAlpha:1,delay:0.2}); 1295 punchgs.TweenLite.to(laimg,0.5,{autoAlpha:1,delay:0.2}); 1296 }}); 1297 } else { 1298 1299 raimg_b.css({'backgroundImage':'url('+nextimgsrc+')'}); 1300 laimg_b.css({'backgroundImage':'url('+previmgsrc+')'}); 1301 1302 punchgs.TweenLite.fromTo(raimg_b,0.8,{force3D:punchgs.force3d,x:0},{x:-raimg.width(),ease:punchgs.Power3.easeOut,delay:1,onComplete:function() { 1303 raimg.css({'backgroundImage':'url('+nextimgsrc+')'}); 1304 punchgs.TweenLite.set(raimg_b,{x:0}); 1305 }}); 1306 punchgs.TweenLite.fromTo(laimg_b,0.8,{force3D:punchgs.force3d,x:0},{x:raimg.width(),ease:punchgs.Power3.easeOut,delay:1,onComplete:function() { 1307 laimg.css({'backgroundImage':'url('+previmgsrc+')'}); 1308 punchgs.TweenLite.set(laimg_b,{x:0}); 1309 }}); 1310 1311 1312 1313 punchgs.TweenLite.fromTo(raimg,0.8,{x:0},{force3D:punchgs.force3d,x:-raimg.width(),ease:punchgs.Power3.easeOut,delay:1,onComplete:function() { 1314 punchgs.TweenLite.set(raimg,{x:0}); 1315 }}); 1316 punchgs.TweenLite.fromTo(laimg,0.8,{x:0},{force3D:punchgs.force3d,x:raimg.width(),ease:punchgs.Power3.easeOut,delay:1,onComplete:function() { 1317 punchgs.TweenLite.set(laimg,{x:0}); 1318 }}); 1319 } 1320 1321 // HOVER EFFECTS ARE SPECIAL ON PREVIEW4 1322 if (rar.hasClass("preview4") && !rar.hasClass("hashoveralready")) { 1323 1324 rar.addClass("hashoveralready"); 1325 rar.hover(function() { 1326 var iw = jQuery(this).find('.tp-arr-iwrapper'); 1327 var all = jQuery(this).find('.tp-arr-allwrapper'); 1328 punchgs.TweenLite.fromTo(iw,0.4,{x:iw.width()},{x:0,delay:0.3,ease:punchgs.Power3.easeOut,overwrite:"all"}); 1329 punchgs.TweenLite.to(all,0.2,{autoAlpha:1,overwrite:"all"}); 1330 1331 },function() { 1332 var iw = jQuery(this).find('.tp-arr-iwrapper'); 1333 var all = jQuery(this).find('.tp-arr-allwrapper'); 1334 punchgs.TweenLite.to(iw,0.4,{x:iw.width(),ease:punchgs.Power3.easeOut,delay:0.2,overwrite:"all"}); 1335 punchgs.TweenLite.to(all,0.2,{delay:0.6,autoAlpha:0,overwrite:"all"}); 1336 }); 1337 1338 1339 lar.hover(function() { 1340 var iw = jQuery(this).find('.tp-arr-iwrapper'); 1341 var all = jQuery(this).find('.tp-arr-allwrapper'); 1342 punchgs.TweenLite.fromTo(iw,0.4,{x:(0-iw.width())},{x:0,delay:0.3,ease:punchgs.Power3.easeOut,overwrite:"all"}); 1343 punchgs.TweenLite.to(all,0.2,{autoAlpha:1,overwrite:"all"}); 1344 1345 },function() { 1346 var iw = jQuery(this).find('.tp-arr-iwrapper'); 1347 var all = jQuery(this).find('.tp-arr-allwrapper'); 1348 punchgs.TweenLite.to(iw,0.4,{x:(0-iw.width()),ease:punchgs.Power3.easeOut,delay:0.2,overwrite:"all"}); 1349 punchgs.TweenLite.to(all,0.2,{delay:0.6,autoAlpha:0,overwrite:"all"}); 1350 }); 1351 1352 } 1353 // END OF NAVIGATION ARROW CONTENT FILLING 1354 1355 } 1356 ////////////////////////////////////////////////////////// 1357 // - SET THE IMAGE SIZE TO FIT INTO THE CONTIANER - // 1358 //////////////////////////////////////////////////////// 1359 var setSize = function(img,opt) { 1360 1361 1362 opt.container.closest('.forcefullwidth_wrapper_tp_banner').find('.tp-fullwidth-forcer').css({'height':opt.container.height()}); 1363 opt.container.closest('.rev_slider_wrapper').css({'height':opt.container.height()}); 1364 1365 1366 opt.width=parseInt(opt.container.width(),0); 1367 opt.height=parseInt(opt.container.height(),0); 1368 1369 1370 1371 opt.bw= (opt.width / opt.startwidth); 1372 opt.bh = (opt.height / opt.startheight); 1373 1374 if (opt.bh>opt.bw) opt.bh=opt.bw; 1375 if (opt.bh<opt.bw) opt.bw = opt.bh; 1376 if (opt.bw<opt.bh) opt.bh = opt.bw; 1377 if (opt.bh>1) { opt.bw=1; opt.bh=1; } 1378 if (opt.bw>1) {opt.bw=1; opt.bh=1; } 1379 1380 1381 //opt.height= opt.startheight * opt.bh; 1382 if (!opt.heightfix) 1383 { 1384 opt.height = Math.round(opt.startheight * (opt.width / opt.startwidth)); 1385 } 1386 1387 1388 1389 1390 if (opt.height>
1390opt.startheight && opt.autoHeight!="on") opt.height=opt.startheight; 1391 1392 1393 if (opt.fullScreen=="on") { 1394 opt.height = opt.bw * opt.startheight; 1395 var cow = opt.container.parent().width(); 1396 var coh = jQuery(window).height(); 1397 1398 if (opt.fullScreenOffsetContainer!=undefined) { 1399 try{ 1400 var offcontainers = opt.fullScreenOffsetContainer.split(","); 1401 jQuery.each(offcontainers,function(index,searchedcont) { 1402 coh = coh - jQuery(searchedcont).outerHeight(true); 1403 if (coh<opt.minFullScreenHeight) coh=opt.minFullScreenHeight; 1404 }); 1405 } catch(e) {} 1406 1407 try{ 1408 1409 if (opt.fullScreenOffset.split("%").length>1 && opt.fullScreenOffset!=undefined && opt.fullScreenOffset.length>0) { 1410 1411 coh = coh - (jQuery(window).height()* parseInt(opt.fullScreenOffset,0)/100); 1412 } else { 1413 if (opt.fullScreenOffset!=undefined && opt.fullScreenOffset.length>0) 1414 coh = coh - parseInt(opt.fullScreenOffset,0); 1415 } 1416 1417 1418 if (coh<opt.minFullScreenHeight) coh=opt.minFullScreenHeight; 1419 1420 } catch(e) {} 1421 } 1422 1423 opt.container.parent().height(coh); 1424 1425 opt.container.closest('.rev_slider_wrapper').height(coh); 1426 opt.container.css({'height':'100%'}); 1427 1428 opt.height=coh; 1429 1430 } else { 1431 opt.container.height(opt.height); 1432 } 1433 1434 1435 opt.slotw=Math.ceil(opt.width/opt.slots); 1436 1437 if (opt.fullScreen=="on") 1438 opt.sloth=Math.ceil(jQuery(window).height()/opt.slots); 1439 else 1440 opt.sloth=Math.ceil(opt.height/opt.slots); 1441 1442 if (opt.autoHeight=="on") 1443 opt.sloth=Math.ceil(img.height()/opt.slots); 1444 1445 1446 1447 1448 } 1449 1450 1451 1452 1453 ///////////////////////////////////////// 1454 // - PREPARE THE SLIDES / SLOTS - // 1455 /////////////////////////////////////// 1456 var prepareSlides = function(container,opt) { 1457 1458 container.find('.tp-caption').each(function() { jQuery(this).addClass(jQuery(this).data('transition')); jQuery(this).addClass('start') }); 1459 1460 // PREPARE THE UL CONTAINER TO HAVEING MAX HEIGHT AND HEIGHT FOR ANY SITUATION 1461 container.find('>ul:first').css({overflow:'hidden',width:'100%',height:'100%',maxHeight:container.parent().css('maxHeight')}); 1462 if (opt.autoHeight=="on") { 1463 container.find('>ul:first').css({overflow:'hidden',width:'100%',height:'100%',maxHeight:"none"}); 1464 container.css({'maxHeight':'none'}); 1465 container.parent().css({'maxHeight':'none'}); 1466 } 1467 1468 container.find('>ul:first >li').each(function(j) { 1469 var li=jQuery(this); 1470 1471 // MAKE LI OVERFLOW HIDDEN FOR FURTHER ISSUES 1472 li.css({'width':'100%','height':'100%','overflow':'hidden'}); 1473 1474 // IF LINK ON SLIDE EXISTS, NEED TO CREATE A PROPER LAYER FOR IT. 1475 if (li.data('link')!=undefined) { 1476 var link = li.data('link'); 1477 var target="_self"; 1478 var zindex=60; 1479 if (li.data('slideindex')=="back") zindex=0; 1480 1481 var linktoslide=li.data('linktoslide'); 1482 if (li.data('target')!=undefined) target=li.data('target'); 1483 1484 if (link=="slide") { 1485 li.append('<div class="tp-caption sft slidelink" style="width:100%;height:100%;z-index:'+zindex+';" data-x="center" data-y="center" data-linktoslide="'+linktoslide+'" data-start="0"><a style="width:100%;height:100%;display:block"><span style="width:100%;height:100%;display:block"></span></a></div>'); 1486 } else { 1487 linktoslide="no"; 1488 li.append('<div class="tp-caption sft slidelink" style="width:100%;height:100%;z-index:'+zindex+';" data-x="center" data-y="center" data-linktoslide="'+linktoslide+'" data-start="0"><a style="width:100%;height:100%;display:block" target="'+target+'" href="'+link+'"><span style="width:100%;height:100%;display:block"></span></a></div>'); 1489 } 1490 1491 } 1492 }); 1493 1494 // RESOLVE OVERFLOW HIDDEN OF MAIN CONTAINER 1495 container.parent().css({'overflow':'visible'}); 1496 1497 1498 container.find('>ul:first >li >img').each(function(j) { 1499 1500 var img=jQuery(this); 1501 1502 img.addClass('defaultimg'); 1503 if (img.data('lazyload')!=undefined && img.data('lazydone') != 1) { 1504 1505 } else { 1506 setSize(img,opt); 1507 } 1508 1509 1510 1511 img.wrap('<div class="slotholder" style="width:100%;height:100%;"'+ 1512 'data-duration="'+img.data('duration')+'"'+ 1513 'data-zoomstart="'+img.data("zoomstart")+'"'+ 1514 'data-zoomend="'+img.data("zoomend")+'"'+ 1515 'data-rotationstart="'+img.data("rotationstart")+'"'+ 1516 'data-rotationend="'+img.data("rotationend")+'"'+ 1517 'data-ease="'+img.data("ease")+'"'+ 1518 'data-duration="'+img.data("duration")+'"'+ 1519 'data-bgpositionend="'+img.data("bgpositionend")+'"'+ 1520 'data-bgposition="'+img.data("bgposition")+'"'+ 1521 'data-duration="'+img.data("duration")+'"'+ 1522 'data-kenburns="'+img.data("kenburns")+'"'+ 1523 'data-easeme="'+img.data("ease")+'"'+ 1524 'data-bgfit="'+img.data("bgfit")+'"'+ 1525 'data-bgfitend="'+img.data("bgfitend")+'"'+ 1526 'data-owidth="'+img.data("owidth")+'"'+ 1527 'data-oheight="'+img.data("oheight")+'"'+ 1528 '></div>'); 1529 1530 if (opt.dottedOverlay!="none" && opt.dottedOverlay!=undefined) 1531 img.closest('.slotholder').append('<div class="tp-dottedoverlay '+opt.dottedOverlay+'"></div>'); 1532 1533 var src=img.attr('src'), 1534 ll = img.data('lazyload'), 1535 bgfit = img.data('bgfit'), 1536 bgrepeat = img.data('bgrepeat'), 1537 bgposition = img.data('bgposition'); 1538 1539
1540 if (bgfit==undefined) bgfit="cover"; 1541 if (bgrepeat==undefined) bgrepeat="no-repeat"; 1542 if (bgposition==undefined) bgposition="center center" 1543 1544 1545 var pari = img.closest('.slotholder'); 1546 1547 1548 1549 1550 1551 img.replaceWith('<div class="tp-bgimg defaultimg" data-img_num='+j+' 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>'); 1552 1553 1554 1555 1556 if (isIE(8)) { 1557 pari.find('.tp-bgimg').css({backgroundImage:"none",'background-image':'none'}); 1558 pari.find('.tp-bgimg').append('<img class="ieeightfallbackimage defaultimg" src="'+src+'" style="width:100%">'); 1559 } 1560 1561 img.css({'opacity':0}); 1562 img.data('li-id',j); 1563 1564 }); 1565 } 1566 1567 1568 1569 1570 1571 /////////////////////// 1572 // PREPARE THE SLIDE // 1573 ////////////////////// 1574 var prepareOneSlideSlot = function(slotholder,opt,visible,vorh) { 1575 1576 1577 var sh=slotholder, 1578 img = sh.find('.defaultimg'), 1579 scalestart = sh.data('zoomstart'), 1580 rotatestart = sh.data('rotationstart'); 1581 1582 if (img.data('currotate')!=undefined) 1583 rotatestart = img.data('currotate'); 1584 if (img.data('curscale')!=undefined) 1585 scalestart = img.data('curscale'); 1586 1587 setSize(img,opt) 1588 1589 var src = img.data('src'), 1590 bgcolor=img.css('background-color'), 1591 w = opt.width, 1592 h = opt.height, 1593 fulloff = img.data("fxof"); 1594 1595 if (opt.autoHeight=="on") h = opt.container.height(); 1596 if (fulloff==undefined) fulloff=0; 1597 1598 fullyoff=0; 1599 1600 var off=0, 1601 bgfit = img.data('bgfit'), 1602 bgrepeat = img.data('bgrepeat'), 1603 bgposition = img.data('bgposition'); 1604 1605 if (bgfit==undefined) bgfit="cover"; 1606 if (bgrepeat==undefined) bgrepeat="no-repeat"; 1607 if (bgposition==undefined) bgposition="center center"; 1608 1609 1610 if (isIE(8)) { 1611 sh.data('kenburns',"off"); 1612 var imgsrc=src; 1613 src=""; 1614 1615 } 1616 1617 1618 if (sh.data('kenburns')=="on") { 1619 bgfit=scalestart; 1620 if (bgfit.toString().length<4) 1621 bgfit = calculateKenBurnScales(bgfit,sh,opt); 1622 } 1623 1624 1625 if (vorh == "horizontal") { 1626 1627 if (!visible) var off=0-opt.slotw; 1628 1629 for (var i=0;i<opt.slots;i++) { 1630 1631 sh.append('<div class="slot" style="position:absolute;'+ 1632 'top:'+(0+fullyoff)+'px;'+ 1633 'left:'+(fulloff+(i*opt.slotw))+'px;'+ 1634 'overflow:hidden;width:'+(opt.slotw+0.6)+'px;'+ 1635 'height:'+h+'px">'+ 1636 '<div class="slotslide" style="position:absolute;'+ 1637 'top:0px;left:'+off+'px;'+ 1638 'width:'+(opt.slotw+0.6)+'px;'+ 1639 'height:'+h+'px;overflow:hidden;">'+ 1640 '<div style="background-color:'+bgcolor+';'+ 1641 'position:absolute;top:0px;'+ 1642 'left:'+(0-(i*opt.slotw))+'px;'+ 1643 'width:'+w+'px;height:'+h+'px;'+ 1644 'background-image:url('+src+');'+ 1645 'background-repeat:'+bgrepeat+';'+ 1646 'background-size:'+bgfit+';background-position:'+bgposition+';">'+ 1647 '</div></div></div>'); 1648 if (scalestart!=undefined && rotatestart!=undefined) 1649 punchgs.TweenLite.set(sh.find('.slot').last(),{rotationZ:rotatestart}); 1650 if (isIE(8)) { 1651 sh.find('.slot ').last().find('.slotslide').append('<img class="ieeightfallbackimage" src="'+imgsrc+'" style="width:100%;height:auto">'); 1652 ieimgposition(sh,opt); 1653 1654 } 1655 } 1656 } else { 1657 1658 if (!visible) var off=0-opt.sloth; 1659 1660 for (var i=0;i<opt.slots+2;i++) { 1661 sh.append('<div class="slot" style="position:absolute;'+ 1662 'top:'+(fullyoff+(i*opt.sloth))+'px;'+ 1663 'left:'+(fulloff)+'px;'+ 1664 'overflow:hidden;'+ 1665 'width:'+w+'px;'+ 1666 'height:'+(opt.sloth)+'px">'+ 1667 1668 '<div class="slotslide" style="position:absolute;'+ 1669 'top:'+(off)+'px;'+ 1670 'left:0px;width:'+w+'px;'+ 1671 'height:'+opt.sloth+'px;'+ 1672 'overflow:hidden;">'+ 1673 '<div style="background-color:'+bgcolor+';'+ 1674 'position:absolute;'+
1675 'top:'+(0-(i*opt.sloth))+'px;'+ 1676 'left:0px;'+ 1677 'width:'+w+'px;height:'+h+'px;'+ 1678 'background-image:url('+src+');'+ 1679 'background-repeat:'+bgrepeat+';'+ 1680 'background-size:'+bgfit+';background-position:'+bgposition+';">'+ 1681 1682 '</div></div></div>'); 1683 if (scalestart!=undefined && rotatestart!=undefined) 1684 punchgs.TweenLite.set(sh.find('.slot').last(),{rotationZ:rotatestart}); 1685 if (isIE(8)) { 1686 sh.find('.slot ').last().find('.slotslide').append('<img class="ieeightfallbackimage" src="'+imgsrc+'" style="width:100%;height:auto;">'); 1687 ieimgposition(sh,opt); 1688 } 1689 } 1690 } 1691 1692 1693 1694 1695 } 1696 1697 1698 1699 /////////////////////// 1700 // PREPARE THE SLIDE // 1701 ////////////////////// 1702 var prepareOneSlideBox = function(slotholder,opt,visible) { 1703 1704 var sh=slotholder; 1705 var img = sh.find('.defaultimg'); 1706 1707 var scalestart = sh.data('zoomstart'); 1708 var rotatestart = sh.data('rotationstart'); 1709 1710 if (img.data('currotate')!=undefined) 1711 rotatestart = img.data('currotate'); 1712 if (img.data('curscale')!=undefined) 1713 scalestart = img.data('curscale')*100; 1714 1715 1716 1717 setSize(img,opt) 1718 var src = img.data('src'); 1719 var bgcolor=img.css('backgroundColor'); 1720 1721 var w = opt.width; 1722 var h = opt.height; 1723 if (opt.autoHeight=="on") 1724 h = opt.container.height(); 1725 1726 var fulloff = img.data("fxof"); 1727 if (fulloff==undefined) fulloff=0; 1728 1729 fullyoff=0; 1730 1731 1732 1733 var off=0; 1734 1735 1736 if (isIE(8)) { 1737 var imgsrc=src; 1738 src=""; 1739 } 1740 1741 // SET THE MINIMAL SIZE OF A BOX 1742 var basicsize = 0; 1743 if (opt.sloth>opt.slotw) 1744 basicsize=opt.sloth 1745 else 1746 basicsize=opt.slotw; 1747 1748 1749 if (!visible) { 1750 var off=0-basicsize; 1751 } 1752 1753 opt.slotw = basicsize; 1754 opt.sloth = basicsize; 1755 var x=0; 1756 var y=0; 1757 1758 var bgfit = img.data('bgfit'); 1759 var bgrepeat = img.data('bgrepeat'); 1760 var bgposition = img.data('bgposition'); 1761 1762 if (bgfit==undefined) bgfit="cover"; 1763 if (bgrepeat==undefined) bgrepeat="no-repeat"; 1764 if (bgposition==undefined) bgposition="center center"; 1765 1766 if (sh.data('kenburns')=="on") { 1767 bgfit=scalestart; 1768 if (bgfit.toString().length<4) 1769 bgfit = calculateKenBurnScales(bgfit,sh,opt); 1770 } 1771 1772 for (var j=0;j<opt.slots;j++) { 1773 1774 y=0; 1775 for (var i=0;i<opt.slots;i++) { 1776 1777 1778 sh.append('<div class="slot" '+ 1779 'style="position:absolute;'+ 1780 'top:'+(fullyoff+y)+'px;'+ 1781 'left:'+(fulloff+x)+'px;'+ 1782 'width:'+basicsize+'px;'+ 1783 'height:'+basicsize+'px;'+ 1784 'overflow:hidden;">'+ 1785 1786 '<div class="slotslide" data-x="'+x+'" data-y="'+y+'" '+ 1787 'style="position:absolute;'+ 1788 'top:'+(0)+'px;'+ 1789 'left:'+(0)+'px;'+ 1790 'width:'+basicsize+'px;'+ 1791 'height:'+basicsize+'px;'+ 1792 'overflow:hidden;">'+ 1793 1794 '<div style="position:absolute;'+ 1795 'top:'+(0-y)+'px;'+ 1796 'left:'+(0-x)+'px;'+ 1797 'width:'+w+'px;'+ 1798 'height:'+h+'px;'+ 1799 'background-color:'+bgcolor+';'+ 1800 'background-image:url('+src+');'+ 1801 'background-repeat:'+bgrepeat+';'+ 1802 'background-size:'+bgfit+';background-position:'+bgposition+';">'+ 1803 '</div></div></div>'); 1804 y=y+basicsize; 1805 1806 if (isIE(8)) { 1807 1808 sh.find('.slot ').last().find('.slotslide').append('<img src="'+imgsrc+'">'); 1809 ieimgposition(sh,opt); 1810 } 1811 1812 if (scalestart!=undefined && rotatestart!=undefined) 1813 punchgs.TweenLite.set(sh.find('.slot').last(),{rotationZ:rotatestart}); 1814 } 1815 x=x+basicsize; 1816 } 1817 } 1818 1819 /*********************************************** 1820 - MOVE IE8 IMAGE IN RIGHT POSITION - 1821 ***********************************************/ 1822 1823 var ieimgposition = function(nextsh,opt) { 1824 1825 if (isIE(8)) { 1826 1827 var ie8img = nextsh.find('.ieeightfallbackimage'); 1828 1829 var ie8w = ie8img.width(), 1830 ie8h = ie8img.height(); 1831 1832 1833 1834 if (opt.startwidth/opt.startheight <nextsh.data('owidth')/nextsh.data('oheight')) 1835 ie8img.css({width:"auto",height:"100%"}) 1836 else 1837 ie8img.css({width:"100%",height:"auto"}) 1838 1839 1840 setTimeout(function() { 1841 1842 1843 var ie8w = ie8img.width(), 1844 ie8h = ie8img.height(); 1845 1846 1847 1848 if (nextsh.data('bgposition')=="center center") 1849 ie8img.css({position:"absolute",top:opt.height/2 - ie8h/2+"px", left:opt.width/2-ie8w/2+"px"}); 1850 1851 if (nextsh.data('bgposition')=="center top" || nextsh.data('bgposition')=="top center") 1852 ie8img.css({position:"absolute",top:"0px", left:opt.width/2-ie8w/2+"px"}); 1853 1854 if (nextsh.data('bgposition')=="center bottom" || nextsh.data('bgposition')=="bottom center") 1855 ie8img.css({position:"absolute",bottom:"0px", left:opt.width/2-ie8w/2+"px"}); 1856 1857 1858 if (nextsh.data('bgposition')=="right top" || nextsh.data('bgposition')=="top right") 1859 ie8img.css({position:"absolute",top:"0px", right:"0px"}); 1860 1861 if (nextsh.data('bgposition')=="right bottom" || nextsh.data('bgposition')=="bottom right") 1862 ie8img.css({position:"absolute",bottom:"0px", right:"0px"}); 1863 1864 if (nextsh.data('bgposition')=="right center" || nextsh.data('bgposition')=="center right") 1865 ie8img.css({position:"absolute",top:opt.height/2 - ie8h/2+"px", right:"0px"}); 1866 1867 if (nextsh.data('bgposition')=="left bottom" || nextsh.data('bgposition')=="bottom left") 1868 ie8img.css({position:"absolute",bottom:"0px", left:"0px"}); 1869 1870 if (nextsh.data('bgposition')=="left center" || nextsh.data('bgposition')=="center left") 1871 ie8img.css({position:"absolute",top:opt.height/2 - ie8h/2+"px", left:"0px"}); 1872 },20); 1873 } 1874 } 1875 1876 1877 1878 1879 /////////////////////// 1880 // REMOVE SLOTS // 1881 ///////////////////// 1882 var removeSlots = function(container,opt,where) { 1883 1884 1885 where.find('.slot').each(function() { 1886 jQuery(this).remove(); 1887 }); 1888 opt.transition = 0; 1889 1890 } 1891 1892 1893 /******************************************* 1894 - PREPARE LOADING OF IMAGES - 1895 ********************************************/ 1896 var loadAllPrepared = function(container,alreadyinload) { 1897 1898 container.find('img, .defaultimg').each(function(i) { 1899 var img = jQuery(this); 1900 1901 if (img.data('lazyload')!=img.attr('src') && alreadyinload<3 && img.data('lazyload')!=undefined && img.data('lazyload')!='undefined') { 1902
1903 if (img.data('lazyload') !=undefined && img.data('lazyload') !='undefined') { 1904 img.attr('src',img.data('lazyload')); 1905 1906 var limg = new Image(); 1907 1908 limg.onload = function(i) { 1909 img.data('lazydone',1); 1910 if (img.hasClass("defaultimg")) setDefImg(img,limg); 1911 } 1912 limg.error = function() { 1913 img.data('lazydone',1); 1914 } 1915 1916 limg.src=img.attr('src'); 1917 if (limg.complete) { 1918 if (img.hasClass("defaultimg")) setDefImg(img,limg); 1919 img.data('lazydone',1); 1920 } 1921 1922 } 1923 } else { 1924 1925 if ((img.data('lazyload') === undefined || img.data('lazyload') === 'undefined') && img.data('lazydone')!=1) { 1926 var limg = new Image(); 1927 limg.onload = function() { 1928 if (img.hasClass("defaultimg")) setDefImg(img,limg); 1929 img.data('lazydone',1); 1930 } 1931 limg.error = function() { 1932 img.data('lazydone',1); 1933 } 1934 1935 1936 if (img.attr('src')!=undefined && img.attr('src')!='undefined') { 1937 limg.src = img.attr('src'); 1938 } else 1939 limg.src = img.data('src'); 1940 1941 if (limg.complete) { 1942 if (img.hasClass("defaultimg")) { 1943 setDefImg(img,limg); 1944 } 1945 img.data('lazydone',1); 1946 } 1947 } 1948 } 1949 }) 1950 } 1951 1952 var setDefImg = function(img,limg) { 1953 var nextli = img.closest('li'); 1954 var ww = limg.width; 1955 var hh = limg.height; 1956 nextli.data('owidth',ww); 1957 nextli.data('oheight',hh); 1958 nextli.find('.slotholder').data('owidth',ww); 1959 nextli.find('.slotholder').data('oheight',hh); 1960 nextli.data('loadeddone',1); 1961 } 1962 1963 var waitForLoads = function(element,call,opt) { 1964 1965 loadAllPrepared(element,0); 1966 var inter = setInterval(function() { 1967 opt.bannertimeronpause = true; 1968 opt.container.trigger('stoptimer'); 1969 opt.cd=0; 1970 var found = 0; 1971 element.find('img, .defaultimg').each(function(i) { 1972 if (jQuery(this).data('lazydone')!=1) { 1973 found++; 1974 1975 } 1976 }); 1977 1978 if (found>0) 1979 loadAllPrepared(element,found); 1980 else { 1981 clearInterval(inter); 1982 if (call!=undefined) 1983 call(); 1984 } 1985 1986 },100) 1987 } 1988 1989 1990 ////////////////////////////// 1991 // - SWAP THE SLIDES - // 1992 //////////////////////////// 1993 var swapSlide = function(container,opt) { 1994 1995 try{ 1996 var actli = container.find('>ul:first-child >li:eq('+opt.act+')'); 1997 } catch(e) { 1998 var actli=container.find('>ul:first-child >li:eq(1)'); 1999 } 2000 opt.lastslide=opt.act; 2001 var nextli = container.find('>ul:first-child >li:eq('+opt.next+')'); 2002 2003 var defimg= nextli.find('.defaultimg'); 2004 2005 2006 opt.bannertimeronpause = true; 2007 container.trigger('stoptimer'); 2008 opt.cd=0; 2009 2010 if (defimg.data('lazyload') !=undefined && defimg.data('lazyload') !="undefined" && defimg.data('lazydone') !=1 ) { 2011 2012 if (!isIE(8)) 2013 defimg.css({backgroundImage:'url("'+nextli.find('.defaultimg').data('lazyload')+'")'}); 2014 else { 2015 defimg.attr('src',nextli.find('.defaultimg').data('lazyload')); 2016 } 2017 2018 defimg.data('src',nextli.find('.defaultimg').data('lazyload')); 2019 defimg.data('lazydone',1); 2020 defimg.data('orgw',0); 2021 nextli.data('loadeddone',1); 2022 2023 container.find('.tp-loader').css({display:"block"}); 2024 waitForLoads(container.find('.tp-static-layers'),function() { 2025 waitForLoads(nextli,function() { 2026 var nextsh = nextli.find('.slotholder'); 2027 if (nextsh.data('kenburns')=="on") { 2028 var waitfordimension = setInterval(function() { 2029 var ow = nextsh.data('owidth'); 2030 if (ow>=0) { 2031 clearInterval(waitfordimension); 2032 swapSlideCall(opt,defimg,container) 2033 } 2034 },10) 2035 } else 2036 swapSlideCall(opt,defimg,container) 2037 },opt); 2038 },opt); 2039 2040 } else { 2041 2042 if (nextli.data('loadeddone')===undefined) { 2043 nextli.data('loadeddone',1); 2044 waitForLoads(nextli,function() { 2045 swapSlideCall(opt,defimg,container) 2046 },opt); 2047 } else 2048 2049 swapSlideCall(opt,defimg,container) 2050 } 2051 } 2052 2053 var swapSlideCall = function(opt,defimg,container) { 2054 opt.bannertimeronpause = false; 2055 opt.cd=0; 2056 container.trigger('nulltimer'); 2057 container.find('.tp-loader').css({display:"none"}); 2058 setSize(defimg,opt); 2059 setBulPos(container,opt); 2060 setSize(defimg,opt); 2061 swapSlideProgress(container,opt); 2062 2063 } 2064 2065 /****************************** 2066 - SWAP SLIDE PROGRESS - 2067 ********************************/ 2068 /*!SWAP SLIDE*/ 2069 var swapSlideProgress = function(container,opt) { 2070 2071 2072 container.trigger('revolution.slide.onbeforeswap'); 2073 2074 opt.transition = 1; 2075 opt.videoplaying = false;
2076 //konsole.log("VideoPlay set to False due swapSlideProgress"); 2077 2078 try{ 2079 var actli = container.find('>ul:first-child >li:eq('+opt.act+')'); 2080 } catch(e) { 2081 var actli=container.find('>ul:first-child >li:eq(1)'); 2082 } 2083 2084 opt.lastslide=opt.act; 2085 2086 var nextli = container.find('>ul:first-child >li:eq('+opt.next+')'); 2087 2088 setTimeout(function() { 2089 handleSpecialPreviews(opt); 2090 },200); 2091 2092 var actsh = actli.find('.slotholder'); 2093 var nextsh = nextli.find('.slotholder'); 2094 2095 if (nextsh.data('kenburns')=="on" || actsh.data('kenburns')=="on") { 2096 stopKenBurn(container,opt); 2097 container.find('.kenburnimg').remove(); 2098 } 2099 2100 2101 // IF DELAY HAS BEEN SET VIA THE SLIDE, WE TAKE THE NEW VALUE, OTHER WAY THE OLD ONE... 2102 if (nextli.data('delay')!=undefined) { 2103 opt.cd=0; 2104 opt.delay=nextli.data('delay'); 2105 } else { 2106 opt.delay=opt.origcd; 2107 } 2108 2109 2110 if (opt.firststart==1) 2111 punchgs.TweenLite.set(actli,{autoAlpha:0}); 2112 2113 punchgs.TweenLite.set(actli,{zIndex:18}); 2114 punchgs.TweenLite.set(nextli,{autoAlpha:0,zIndex:20}); 2115 2116 /////////////////////////// 2117 // REMOVE THE CAPTIONS // 2118 /////////////////////////// 2119 var removetime = 0; 2120 if (actli.index() != nextli.index() && opt.firststart!=1) { 2121 removetime = removeTheCaptions(actli,opt); 2122 2123 } 2124 2125 if (actli.data('saveperformance')!="on") removetime = 0; 2126 2127 setTimeout(function() { 2128 //opt.cd=0; 2129 //container.trigger('nulltimer'); 2130 container.trigger('restarttimer'); 2131 slideAnimation(container,opt,nextli,actli,actsh,nextsh); 2132 },removetime) 2133 2134 } 2135 2136 2137 /****************************************** 2138 - START THE LAYER ANIMATION - 2139 *******************************************/ 2140 2141 var slideAnimation = function(container,opt,nextli,actli,actsh,nextsh) { 2142 2143 // IF THERE IS AN OTHER FIRST SLIDE START HAS BEED SELECTED 2144 if (nextli.data('differentissplayed') =='prepared') { 2145 nextli.data('differentissplayed','done'); 2146 nextli.data('transition',nextli.data('savedtransition')); 2147 nextli.data('slotamount',nextli.data('savedslotamount')); 2148 nextli.data('masterspeed',nextli.data('savedmasterspeed')); 2149 } 2150 2151 2152 if (nextli.data('fstransition') != undefined && nextli.data('differentissplayed') !="done") { 2153 nextli.data('savedtransition',nextli.data('transition')); 2154 nextli.data('savedslotamount',nextli.data('slotamount')); 2155 nextli.data('savedmasterspeed',nextli.data('masterspeed')); 2156 2157 nextli.data('transition',nextli.data('fstransition')); 2158 nextli.data('slotamount',nextli.data('fsslotamount')); 2159 nextli.data('masterspeed',nextli.data('fsmasterspeed')); 2160 2161 nextli.data('differentissplayed','prepared'); 2162 } 2163 2164 /////////////////////////////////////// 2165 // TRANSITION CHOOSE - RANDOM EFFECTS// 2166 /////////////////////////////////////// 2167 var nexttrans = 0, 2168 transtext = nextli.data('transition').split(","), 2169 curtransid = nextli.data('nexttransid'); 2170 2171 if (curtransid == undefined) { 2172 curtransid=0; 2173 nextli.data('nexttransid',curtransid); 2174 } else { 2175 curtransid=curtransid+1; 2176 if (curtransid==transtext.length) curtransid=0; 2177 nextli.data('nexttransid',curtransid); 2178 2179 } 2180 2181 2182 2183 var comingtransition = transtext[curtransid]; 2184 2185 if (opt.ie) { 2186 if (comingtransition=="boxfade") comingtransition = "boxslide"; 2187 if (comingtransition=="slotfade-vertical") comingtransition = "slotzoom-vertical"; 2188 if (comingtransition=="slotfade-horizontal") comingtransition = "slotzoom-horizontal"; 2189 } 2190 2191 if (isIE(8)) { 2192 comingtransition = 11; 2193 } 2194 2195 2196 var specials = 0; 2197 2198 if (opt.parallax=="scroll" && opt.parallaxFirstGo==undefined) { 2199 opt.parallaxFirstGo = true; 2200 scrollParallax(container,opt); 2201 setTimeout(function() { 2202 scrollParallax(container,opt); 2203 },210); 2204 setTimeout(function() { 2205 scrollParallax(container,opt); 2206 },420); 2207 2208 } 2209 2210 2211 2212 2213 /*if (opt.ffnn == undefined) opt.ffnn=0; 2214 comingtransition=opt.ffnn; 2215 2216 if ( direction==1) 2217 opt.ffnn=opt.ffnn-1; 2218 else 2219 opt.ffnn=opt.ffnn+1; 2220 2221 if (opt.ffnn>46) opt.ffnn=0; 2222 if (opt.ffnn<0) opt.ffnn = 46; 2223 2224 jQuery('.logo').html('Next Anim:'+comingtransition);*/ 2225 2226 2227 if (comingtransition=="boxslide" || comingtransition == "boxfade" || comingtransition == "papercut" || 2228 comingtransition==0 || comingtransition == 1 || comingtransition == 16) 2229 comingtransition = 9; 2230 2231 2232 /* Transition Name , 2233 Transition Code, 2234 Transition Sub Code, 2235 Max Slots, 2236 MasterSpeed Delays, 2237 Preparing Slots (box,slideh, slidev), 2238 Call on nextsh (null = no, true/false for visibility first preparing), 2239 Call on actsh (null = no, true/false for visibility first preparing), 2240 */ 2241 2242 2243 2244 2245 if (comingtransition=="slidehorizontal") { 2246 comingtransition = "slideleft" 2247 if (opt.leftarrowpressed==1) 2248 comingtransition = "slideright" 2249 } 2250 2251 if (comingtransition=="slidevertical") { 2252 comingtransition = "slideup" 2253 if (opt.leftarrowpressed==1) 2254 comingtransition = "slidedown" 2255 } 2256 2257 if (comingtransition=="parallaxhorizontal") { 2258 comingtransition = "parallaxtoleft" 2259 if (opt.leftarrowpressed==1) 2260 comingtransition = "parallaxtoright" 2261 } 2262 2263 2264 if (comingtransition=="parallaxvertical") { 2265 comingtransition = "parallaxtotop" 2266 if (opt.leftarrowpressed==1) 2267 comingtransition = "parallaxtobottom" 2268 } 2269 2270 2271 2272 2273 var transitionsArray = [ ['boxslide' , 0, 1, 10, 0,'box',false,null,0], 2274 ['boxfade', 1, 0, 10, 0,'box',false,null,1], 2275 ['slotslide-horizontal', 2, 0, 0, 200,'horizontal',true,false,2], 2276 ['slotslide-vertical', 3, 0,0,200,'vertical',true,false,3], 2277 ['curtain-1', 4, 3,0,0,'horizontal',true,true,4], 2278 ['curtain-2', 5, 3,0,0,'horizontal',true,true,5], 2279 ['curtain-3', 6, 3,25,0,'horizontal',true,true,6], 2280 ['slotzoom-horizontal', 7, 0,0,400,'horizontal',true,true,7], 2281 ['slotzoom-vertical', 8, 0,0,0,'vertical',true,true,8], 2282 ['slotfade-horizontal', 9, 0,0,500,'horizontal',true,null,9], 2283 ['slotfade-vertical', 10, 0,0 ,500,'vertical',true,null,10], 2284 ['fade', 11, 0, 1 ,300,'horizontal',true,null,11], 2285 ['slideleft', 12, 0,1,0,'horizontal',true,true,12], 2286 ['slideup', 13, 0,1,0,'horizontal',true,true,13], 2287 ['slidedown', 14, 0,1,0,'horizontal',true,true,14], 2288 ['slideright', 15, 0,1,0,'horizontal',true,true,15], 2289 ['papercut', 16, 0,0,600,'',null,null,16], 2290 ['3dcurtain-horizontal', 17, 0,20,100,'vertical',false,true,17], 2291 ['3dcurtain-vertical', 18, 0,10,100,'horizontal',false,true,18], 2292 ['cubic', 19, 0,20,600,'horizontal',false,true,19], 2293 ['cube',19,0,20,600,'horizontal',false,true,20], 2294 ['flyin', 20, 0,4,600,'vertical',false,true,21], 2295 ['turnoff', 21, 0,1,1600,'horizontal',false,true,22], 2296 ['incube', 22, 0,20,200,'horizontal',false,true,23], 2297 ['cubic-horizontal', 23, 0,20,500,'vertical',false,true,24], 2298 ['cube-horizontal', 23, 0,20,500,'vertical',false,true,25], 2299 ['incube-horizontal', 24, 0,20,500,'vertical',false,true,26], 2300 ['turnoff-vertical', 25, 0,1,200,'horizontal',false,true,27], 2301 ['fadefromright', 12, 1,1,0,'horizontal',true,true,28], 2302 ['fadefromleft', 15, 1,1,0,'horizontal',true,true,29],
2303 ['fadefromtop', 14, 1,1,0,'horizontal',true,true,30], 2304 ['fadefrombottom', 13, 1,1,0,'horizontal',true,true,31], 2305 ['fadetoleftfadefromright', 12, 2,1,0,'horizontal',true,true,32], 2306 ['fadetorightfadetoleft', 15, 2,1,0,'horizontal',true,true,33], 2307 ['fadetobottomfadefromtop', 14, 2,1,0,'horizontal',true,true,34], 2308 ['fadetotopfadefrombottom', 13, 2,1,0,'horizontal',true,true,35], 2309 ['parallaxtoright', 12, 3,1,0,'horizontal',true,true,36], 2310 ['parallaxtoleft', 15, 3,1,0,'horizontal',true,true,37], 2311 ['parallaxtotop', 14, 3,1,0,'horizontal',true,true,38], 2312 ['parallaxtobottom', 13, 3,1,0,'horizontal',true,true,39], 2313 ['scaledownfromright', 12, 4,1,0,'horizontal',true,true,40], 2314 ['scaledownfromleft', 15, 4,1,0,'horizontal',true,true,41], 2315 ['scaledownfromtop', 14, 4,1,0,'horizontal',true,true,42], 2316 ['scaledownfrombottom', 13, 4,1,0,'horizontal',true,true,43], 2317 ['zoomout', 13, 5,1,0,'horizontal',true,true,44], 2318 ['zoomin', 13, 6,1,0,'horizontal',true,true,45], 2319 ['notransition',26,0,1,0,'horizontal',true,null,46] 2320 ]; 2321 2322 2323 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]; 2324 var premiumTransitions = [16,17,18,19,20,21,22,23,24,25,26,27] 2325 2326 var nexttrans =0; 2327 var specials = 1; 2328 var STAindex = 0; 2329 var indexcounter =0; 2330 var STA = new Array; 2331 2332 //START THE KEN BURN PAN ZOOM ANIMATION 2333 if (nextsh.data('kenburns')=="on") { 2334 if (comingtransition == "boxslide" || comingtransition==0 || 2335 comingtransition == "boxfade" || comingtransition==1 || 2336 comingtransition == "papercut" || comingtransition==16 2337 ) 2338 comingtransition = 11; 2339 2340 startKenBurn(container,opt,true,true); 2341 } 2342 2343 2344 2345 // RANDOM TRANSITIONS 2346 if (comingtransition == "random") { 2347 comingtransition = Math.round(Math.random()*transitionsArray.length-1); 2348 if (comingtransition>transitionsArray.length-1) comingtransition=transitionsArray.length-1; 2349 } 2350 2351 // RANDOM FLAT TRANSITIONS 2352 if (comingtransition == "random-static") { 2353 comingtransition = Math.round(Math.random()*flatTransitions.length-1); 2354 if (comingtransition>flatTransitions.length-1) comingtransition=flatTransitions.length-1; 2355 comingtransition = flatTransitions[comingtransition]; 2356 } 2357 2358 // RANDOM PREMIUM TRANSITIONS 2359 if (comingtransition == "random-premium") { 2360 comingtransition = Math.round(Math.random()*premiumTransitions.length-1); 2361 if (comingtransition>premiumTransitions.length-1) comingtransition=premiumTransitions.length-1; 2362 comingtransition = premiumTransitions[comingtransition]; 2363 } 2364 2365 2366 2367 //joomla only change: avoid problematic transitions that don't compatible with mootools 2368 var problematicTransitions = [12,13,14,15,16,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45]; 2369 if(opt.isJoomla == true && window.MooTools != undefined && problematicTransitions.indexOf(comingtransition) != -1){ 2370 2371 var newTransIndex = Math.round(Math.random() * (premiumTransitions.length-2) ) + 1; 2372 2373 //some limits fix 2374 if (newTransIndex > premiumTransitions.length-1) 2375 newTransIndex = premiumTransitions.length-1; 2376 2377 if(newTransIndex == 0) 2378 newTransIndex = 1; 2379 2380 comingtransition = premiumTransitions[newTransIndex]; 2381 } 2382 2383 2384 2385 function findTransition() { 2386 // FIND THE RIGHT TRANSITION PARAMETERS HERE 2387 jQuery.each(transitionsArray,function(inde,trans) { 2388 if (trans[0] == comingtransition || trans[8] == comingtransition) { 2389 nexttrans = trans[1]; 2390 specials = trans[2]; 2391 STAindex = indexcounter; 2392 } 2393 indexcounter = indexcounter+1; 2394 }) 2395 } 2396 2397 findTransition(); 2398 2399 // CHECK IF WE HAVE IE8 AND THAN FALL BACK ON FLAT TRANSITIONS 2400 if (isIE(8) && nexttrans>15 && nexttrans<28) { 2401 comingtransition = Math.round(Math.random()*flatTransitions.length-1); 2402 if (comingtransition>flatTransitions.length-1) comingtransition=flatTransitions.length-1; 2403 comingtransition = flatTransitions[comingtransition]; 2404 indexcounter =0; 2405 findTransition(); 2406 } 2407 2408 2409 2410 2411 // WHICH DIRECTION DID WE HAD ? 2412 var direction=-1; 2413 if (opt.leftarrowpressed==1 || opt.act>opt.next) direction=1; 2414 2415 2416 2417 opt.leftarrowpressed=0; 2418 2419 if (nexttrans>26) nexttrans = 26; 2420 if (nexttrans<0) nexttrans = 0; 2421 2422 2423 // DEFINE THE MASTERSPEED FOR THE SLIDE // 2424 var masterspeed=300; 2425 if (nextli.data('masterspeed')!=undefined && nextli.data('masterspeed')>99 && nextli.data('masterspeed')<4001) 2426 masterspeed = nextli.data('masterspeed'); 2427 2428 // PREPARED DEFAULT SETTINGS PER TRANSITION 2429 STA = transitionsArray[STAindex]; 2430 2431 2432 2433 2434
2435 ///////////////////////////////////////////// 2436 // SET THE BULLETS SELECTED OR UNSELECTED // 2437 ///////////////////////////////////////////// 2438 2439 2440 container.parent().find(".bullet").each(function() { 2441 var bul = jQuery(this); 2442 bul.removeClass("selected"); 2443 2444 if (opt.navigationArrows=="withbullet" || opt.navigationArrows=="nexttobullets") { 2445 if (bul.index()-1 == opt.next) bul.addClass('selected'); 2446 2447 } else { 2448 2449 if (bul.index() == opt.next) bul.addClass('selected'); 2450 2451 } 2452 }); 2453 2454 2455 2456 /////////////////////////////// 2457 // MAIN TIMELINE DEFINITION // 2458 /////////////////////////////// 2459 2460 var mtl = new punchgs.TimelineLite({onComplete:function() { 2461 letItFree(container,opt,nextsh,actsh,nextli,actli,mtl); 2462 }}); 2463 //SET DEFAULT IMG UNVISIBLE AT START 2464 mtl.add(punchgs.TweenLite.set(nextsh.find('.defaultimg'),{opacity:0})); 2465 mtl.pause(); 2466 2467 2468 2469 2470 ///////////////////////////////////////////// 2471 // SET THE ACTUAL AMOUNT OF SLIDES !! // 2472 // SET A RANDOM AMOUNT OF SLOTS // 2473 /////////////////////////////////////////// 2474 if (nextli.data('slotamount')==undefined || nextli.data('slotamount')<1) { 2475 opt.slots=Math.round(Math.random()*12+4); 2476 if (comingtransition=="boxslide") 2477 opt.slots=Math.round(Math.random()*6+3); 2478 else 2479 if (comingtransition=="flyin") 2480 opt.slots=Math.round(Math.random()*4+1); 2481 } else { 2482 opt.slots=nextli.data('slotamount'); 2483 2484 } 2485 2486 ///////////////////////////////////////////// 2487 // SET THE ACTUAL AMOUNT OF SLIDES !! // 2488 // SET A RANDOM AMOUNT OF SLOTS // 2489 /////////////////////////////////////////// 2490 if (nextli.data('rotate')==undefined) 2491 opt.rotate = 0 2492 else 2493 if (nextli.data('rotate')==999) 2494 opt.rotate=Math.round(Math.random()*360); 2495 else 2496 opt.rotate=nextli.data('rotate'); 2497 if (!jQuery.support.transition || opt.ie || opt.ie9) opt.rotate=0; 2498 2499 2500 2501 2502 ////////////////////////////// 2503 // FIRST START // 2504 ////////////////////////////// 2505 if (opt.firststart==1) opt.firststart=0; 2506 2507 2508 // ADJUST MASTERSPEED 2509 masterspeed = masterspeed + STA[4]; 2510 2511 if ((nexttrans==4 || nexttrans==5 || nexttrans==6) && opt.slots<3 ) opt.slots=3; 2512 2513 // ADJUST SLOTS 2514 if (STA[3] != 0) opt.slots = Math.min(opt.slots,STA[3]); 2515 if (nexttrans==9) opt.slots = opt.width/20; 2516 if (nexttrans==10) opt.slots = opt.height/20; 2517 2518 // prepareOneSlideBox 2519 if (STA[5] == "box") { 2520 if (STA[7] !=null) prepareOneSlideBox(actsh,opt,STA[7]); 2521 if (STA[6] !=null) prepareOneSlideBox(nextsh,opt,STA[6]); 2522 } else 2523 2524 if (STA[5] == "vertical" || STA[5] == "horizontal") { 2525 if (STA[7] !=null) prepareOneSlideSlot(actsh,opt,STA[7],STA[5]); 2526 if (STA[6] !=null) prepareOneSlideSlot(nextsh,opt,STA[6],STA[5]); 2527 } 2528 2529 2530 2531 ///////////////////////////////////// 2532 // THE SLOTSLIDE - TRANSITION I. // 2533 //////////////////////////////////// 2534 if (nexttrans==0) { // BOXSLIDE 2535 2536 2537 // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT 2538 var maxz = Math.ceil(opt.height/opt.sloth); 2539 var curz = 0; 2540 nextsh.find('.slotslide').each(function(j) { 2541 var ss=jQuery(this); 2542 curz=curz+1; 2543 if (curz==maxz) curz=0; 2544 2545 mtl.add(punchgs.TweenLite.from(ss,(masterspeed)/600, 2546 {opacity:0,top:(0-opt.sloth),left:(0-opt.slotw),rotation:opt.rotate,force3D:"auto",ease:punchgs.Power2.easeOut}),((j*15) + ((curz)*30))/1500); 2547 }); 2548 } 2549 ///////////////////////////////////// 2550 // THE SLOTSLIDE - TRANSITION I. // 2551 //////////////////////////////////// 2552 if (nexttrans==1) { 2553 2554 // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT 2555 var maxtime, 2556 maxj = 0; 2557 2558 nextsh.find('.slotslide').each(function(j) { 2559 var ss=jQuery(this); 2560 rand=Math.random()*masterspeed+300; 2561 rand2=Math.random()*500+200; 2562 if (rand+rand2>maxtime) { 2563 maxtime = rand2+rand2; 2564 maxj = j; 2565 } 2566 mtl.add(punchgs.TweenLite.from(ss,rand/1000, 2567 {autoAlpha:0, force3D:"auto",rotation:opt.rotate,ease:punchgs.Power2.easeInOut}),rand2/1000); 2568 }); 2569 } 2570 2571
2572 ///////////////////////////////////// 2573 // THE SLOTSLIDE - TRANSITION I. // 2574 //////////////////////////////////// 2575 if (nexttrans==2) { 2576 2577 var subtl = new punchgs.TimelineLite(); 2578 // ALL OLD SLOTS SHOULD BE SLIDED TO THE RIGHT 2579 actsh.find('.slotslide').each(function() { 2580 var ss=jQuery(this); 2581 subtl.add(punchgs.TweenLite.to(ss,masterspeed/1000,{left:opt.slotw, force3D:"auto",rotation:(0-opt.rotate)}),0); 2582 mtl.add(subtl,0); 2583 }); 2584 2585 // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT 2586 nextsh.find('.slotslide').each(function() { 2587 var ss=jQuery(this); 2588 subtl.add(punchgs.TweenLite.from(ss,masterspeed/1000,{left:0-opt.slotw, force3D:"auto",rotation:opt.rotate}),0); 2589 mtl.add(subtl,0); 2590 }); 2591 } 2592 2593 2594 2595 ///////////////////////////////////// 2596 // THE SLOTSLIDE - TRANSITION I. // 2597 //////////////////////////////////// 2598 if (nexttrans==3) { 2599 var subtl = new punchgs.TimelineLite(); 2600 2601 // ALL OLD SLOTS SHOULD BE SLIDED TO THE RIGHT 2602 actsh.find('.slotslide').each(function() { 2603 var ss=jQuery(this); 2604 subtl.add(punchgs.TweenLite.to(ss,masterspeed/1000,{top:opt.sloth,rotation:opt.rotate,force3D:"auto",transformPerspective:600}),0); 2605 mtl.add(subtl,0); 2606 2607 }); 2608 2609 // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT 2610 nextsh.find('.slotslide').each(function() { 2611 var ss=jQuery(this); 2612 subtl.add(punchgs.TweenLite.from(ss,masterspeed/1000,{top:0-opt.sloth,rotation:opt.rotate,ease:punchgs.Power2.easeOut,force3D:"auto",transformPerspective:600}),0); 2613 mtl.add(subtl,0); 2614 }); 2615 } 2616 2617 2618 2619 ///////////////////////////////////// 2620 // THE SLOTSLIDE - TRANSITION I. // 2621 //////////////////////////////////// 2622 if (nexttrans==4 || nexttrans==5) { 2623 2624 setTimeout(function() { 2625 actsh.find('.defaultimg').css({opacity:0}); 2626 },100); 2627 2628 2629 // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT 2630 var cspeed = (masterspeed)/1000, 2631 ticker = cspeed, 2632 subtl = new punchgs.TimelineLite(); 2633 2634 actsh.find('.slotslide').each(function(i) { 2635 var ss=jQuery(this); 2636 var del = (i*cspeed)/opt.slots; 2637 if (nexttrans==5) del = ((opt.slots-i-1)*cspeed)/(opt.slots)/1.5; 2638 subtl.add(punchgs.TweenLite.to(ss,cspeed*3,{transformPerspective:600,force3D:"auto",top:0+opt.height,opacity:0.5,rotation:opt.rotate,ease:punchgs.Power2.easeInOut,delay:del}),0); 2639 mtl.add(subtl,0); 2640 }); 2641 2642 // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT 2643 nextsh.find('.slotslide').each(function(i) { 2644 var ss=jQuery(this); 2645 var del = (i*cspeed)/opt.slots; 2646 if (nexttrans==5) del = ((opt.slots-i-1)*cspeed)/(opt.slots)/1.5; 2647 subtl.add(punchgs.TweenLite.from(ss,cspeed*3, 2648 {top:(0-opt.height),opacity:0.5,rotation:opt.rotate,force3D:"auto",ease:punchgs.Power2.easeInOut,delay:del}),0); 2649 mtl.add(subtl,0); 2650 2651 }); 2652 2653 2654 } 2655 2656 2657 2658 2659 ///////////////////////////////////// 2660 // THE SLOTSLIDE - TRANSITION I. // 2661 //////////////////////////////////// 2662 if (nexttrans==6) { 2663 2664 2665 if (opt.slots<2) opt.slots=2; 2666 if (opt.slots % 2) opt.slots = opt.slots+1; 2667 2668 var subtl = new punchgs.TimelineLite(); 2669 2670 //SET DEFAULT IMG UNVISIBLE 2671 setTimeout(function() { 2672 actsh.find('.defaultimg').css({opacity:0}); 2673 },100); 2674 2675 actsh.find('.slotslide').each(function(i) { 2676 var ss=jQuery(this); 2677 if (i+1<opt.slots/2) 2678 var tempo = (i+2)*90; 2679 else 2680 var tempo = (2+opt.slots-i)*90; 2681 2682 subtl.add(punchgs.TweenLite.to(ss,(masterspeed+tempo)/1000,{top:0+opt.height,opacity:1,force3D:"auto",rotation:opt.rotate,ease:punchgs.Power2.easeInOut}),0); 2683 mtl.add(subtl,0); 2684 }); 2685 2686 // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT 2687 nextsh.find('.slotslide').each(function(i) { 2688 var ss=jQuery(this); 2689 2690 if (i+1<opt.slots/2) 2691 var tempo = (i+2)*90; 2692 else 2693 var tempo = (2+opt.slots-i)*90; 2694 2695 subtl.add(punchgs.TweenLite.from(ss,(masterspeed+tempo)/1000, 2696 {top:(0-opt.height),opacity:1,force3D:"auto",rotation:opt.rotate,ease:punchgs.Power2.easeInOut}),0); 2697 mtl.add(subtl,0); 2698 }); 2699 } 2700 2701
2702 //////////////////////////////////// 2703 // THE SLOTSZOOM - TRANSITION II. // 2704 //////////////////////////////////// 2705 if (nexttrans==7) { 2706 2707 masterspeed = masterspeed *2; 2708 var subtl = new punchgs.TimelineLite(); 2709 2710 //SET DEFAULT IMG UNVISIBLE 2711 setTimeout(function() { 2712 actsh.find('.defaultimg').css({opacity:0}); 2713 },100); 2714 2715 // ALL OLD SLOTS SHOULD BE SLIDED TO THE RIGHT 2716 actsh.find('.slotslide').each(function() { 2717 var ss=jQuery(this).find('div'); 2718 subtl.add(punchgs.TweenLite.to(ss,masterspeed/1000,{ 2719 left:(0-opt.slotw/2)+'px', 2720 top:(0-opt.height/2)+'px', 2721 width:(opt.slotw*2)+"px", 2722 height:(opt.height*2)+"px", 2723 opacity:0, 2724 rotation:opt.rotate, 2725 force3D:"auto", 2726 ease:punchgs.Power2.easeOut}),0); 2727 mtl.add(subtl,0); 2728 2729 }); 2730 2731 ////////////////////////////////////////////////////////////// 2732 // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT // 2733 /////////////////////////////////////////////////////////////// 2734 nextsh.find('.slotslide').each(function(i) { 2735 var ss=jQuery(this).find('div'); 2736 2737 subtl.add(punchgs.TweenLite.fromTo(ss,masterspeed/1000, 2738 {left:0,top:0,opacity:0,transformPerspective:600}, 2739 {left:(0-i*opt.slotw)+'px', 2740 ease:punchgs.Power2.easeOut, 2741 force3D:"auto", 2742 top:(0)+'px', 2743 width:opt.width, 2744 height:opt.height, 2745 opacity:1,rotation:0, 2746 delay:0.1}),0); 2747 mtl.add(subtl,0); 2748 }); 2749 } 2750 2751 2752 2753 2754 //////////////////////////////////// 2755 // THE SLOTSZOOM - TRANSITION II. // 2756 //////////////////////////////////// 2757 if (nexttrans==8) { 2758 2759 masterspeed = masterspeed * 3; 2760 var subtl = new punchgs.TimelineLite(); 2761 2762 2763 2764 // ALL OLD SLOTS SHOULD BE SLIDED TO THE RIGHT 2765 actsh.find('.slotslide').each(function() { 2766 var ss=jQuery(this).find('div'); 2767 subtl.add(punchgs.TweenLite.to(ss,masterspeed/1000, 2768 {left:(0-opt.width/2)+'px', 2769 top:(0-opt.sloth/2)+'px', 2770 width:(opt.width*2)+"px", 2771 height:(opt.sloth*2)+"px", 2772 force3D:"auto", 2773 opacity:0,rotation:opt.rotate}),0); 2774 mtl.add(subtl,0); 2775 2776 }); 2777 2778 2779 // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT // 2780 /////////////////////////////////////////////////////////////// 2781 nextsh.find('.slotslide').each(function(i) { 2782 var ss=jQuery(this).find('div'); 2783 2784 subtl.add(punchgs.TweenLite.fromTo(ss,masterspeed/1000, 2785 {left:0, top:0,opacity:0,force3D:"auto"}, 2786 {'left':(0)+'px', 2787 'top':(0-i*opt.sloth)+'px', 2788 'width':(nextsh.find('.defaultimg').data('neww'))+"px", 2789 'height':(nextsh.find('.defaultimg').data('newh'))+"px", 2790 opacity:1,rotation:0, 2791 }),0); 2792 mtl.add(subtl,0); 2793 }); 2794 } 2795 2796 2797 //////////////////////////////////////// 2798 // THE SLOTSFADE - TRANSITION III. // 2799 ////////////////////////////////////// 2800 if (nexttrans==9 || nexttrans==10) { 2801 2802 2803 2804 2805 var ssamount=0; 2806 // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT 2807 nextsh.find('.slotslide').each(function(i) { 2808 var ss=jQuery(this); 2809 ssamount++; 2810 mtl.add(punchgs.TweenLite.fromTo(ss,masterspeed/1000,{autoAlpha:0,force3D:"auto",transformPerspective:600}, 2811 {autoAlpha:1,ease:punchgs.Power2.easeInOut,delay:(i*5)/1000}),0); 2812 2813 }); 2814 2815 2816 2817 2818 } 2819 2820 2821 /////////////////////////// 2822 // SIMPLE FADE ANIMATION // 2823 /////////////////////////// 2824 2825 if (nexttrans==11 || nexttrans==26) { 2826 2827 2828 var ssamount=0; 2829 if (nexttrans==26) masterspeed=0; 2830 2831 // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT 2832 nextsh.find('.slotslide').each(function(i) { 2833 var ss=jQuery(this); 2834 mtl.add(punchgs.TweenLite.from(ss,masterspeed/1000,{autoAlpha:0,force3D:"auto",ease:punchgs.Power2.easeInOut}),0); 2835 }); 2836 2837 2838 } 2839 2840 2841 2842 2843 2844 2845 if (nexttrans==12 || nexttrans==13 || nexttrans==14 || nexttrans==15) { 2846 2847 //masterspeed = masterspeed * 3; 2848 masterspeed = 1000; 2849 2850 setTimeout(function() { 2851 punchgs.TweenLite.set(actsh.find('.defaultimg'),{autoAlpha:0}); 2852 2853 },100); 2854 2855 var oow = opt.width; 2856 var ooh = opt.height; 2857 2858 2859 // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT 2860 var ssn=nextsh.find('.slotslide') 2861 2862 2863 2864 if (opt.fullWidth=="on" || opt.fullScreen=="on") { 2865 oow=ssn.width(); 2866 ooh=ssn.height(); 2867 } 2868 var twx = 0; 2869 var twy = 0; 2870 2871 2872 2873 if (nexttrans==12) 2874 twx = oow; 2875 else 2876 if (nexttrans==15) 2877 twx = 0-oow; 2878 else 2879 if (nexttrans==13) 2880 twy = ooh; 2881 else 2882 if (nexttrans==14) 2883 twy = 0-ooh; 2884 2885 // SPECIALS FOR EXTENDED ANIMATIONS 2886 var op = 1; 2887 var scal = 1; 2888 var fromscale = 1;
2889 var easeitout = punchgs.Power2.easeInOut; 2890 var easeitin = punchgs.Power2.easeInOut; 2891 var speedy = masterspeed/1000; 2892 var speedy2 = speedy; 2893 2894 // DEPENDING ON EXTENDED SPECIALS, DIFFERENT SCALE AND OPACITY FUNCTIONS NEED TO BE ADDED 2895 if (specials == 1) op = 0; 2896 if (specials == 2) op = 0; 2897 if (specials == 3) { 2898 easeitout = punchgs.Power2.easeInOut; 2899 easeitin = punchgs.Power1.easeInOut; 2900 speedy = masterspeed / 1200; 2901 } 2902 2903 if (specials==4 || specials==5) 2904 scal=0.6; 2905 if (specials==6 ) 2906 scal=1.4; 2907 2908 2909 if (specials==5 || specials==6) { 2910 fromscale=1.4; 2911 op=0; 2912 oow=0; 2913 ooh=0;twx=0;twy=0; 2914 } 2915 if (specials==6) fromscale=0.6; 2916 var dd = 0; 2917 2918 2919 2920 mtl.add(punchgs.TweenLite.from(ssn,speedy, 2921 {left:twx, top:twy, scale:fromscale, opacity:op,rotation:opt.rotate,ease:easeitin,force3D:"auto"}),0); 2922 2923 2924 var ssa=actsh.find('.slotslide'); 2925 2926 if (specials==4 || specials==5) { 2927 oow = 0; ooh=0; 2928 } 2929 2930 if (specials!=1) { 2931 if (nexttrans==12) 2932 mtl.add(punchgs.TweenLite.to(ssa,speedy2,{'left':(0-oow)+'px',force3D:"auto",scale:scal,opacity:op,rotation:opt.rotate,ease:easeitout}),0); 2933 else 2934 if (nexttrans==15) 2935 mtl.add(punchgs.TweenLite.to(ssa,speedy2,{'left':(oow)+'px',force3D:"auto",scale:scal,opacity:op,rotation:opt.rotate,ease:easeitout}),0); 2936 else 2937 if (nexttrans==13) 2938 mtl.add(punchgs.TweenLite.to(ssa,speedy2,{'top':(0-ooh)+'px',force3D:"auto",scale:scal,opacity:op,rotation:opt.rotate,ease:easeitout}),0); 2939 else 2940 if (nexttrans==14) 2941 mtl.add(punchgs.TweenLite.to(ssa,speedy2,{'top':(ooh)+'px',orce3D:"auto",scale:scal,opacity:op,rotation:opt.rotate,ease:easeitout}),0); 2942 } 2943 2944 2945 } 2946 2947 2948 ////////////////////////////////////// 2949 // THE SLOTSLIDE - TRANSITION XVI. // 2950 ////////////////////////////////////// 2951 if (nexttrans==16) { // PAPERCUT 2952 2953 2954 var subtl = new punchgs.TimelineLite(); 2955 mtl.add(punchgs.TweenLite.set(actli,{'position':'absolute','z-index':20}),0); 2956 mtl.add(punchgs.TweenLite.set(nextli,{'position':'absolute','z-index':15}),0); 2957 2958 2959 // PREPARE THE CUTS 2960 actli.wrapInner('<div class="tp-half-one" style="position:relative; width:100%;height:100%"></div>'); 2961 2962 actli.find('.tp-half-one').clone(true).appendTo(actli).addClass("tp-half-two"); 2963 actli.find('.tp-half-two').removeClass('tp-half-one'); 2964 2965 var oow = opt.width; 2966 var ooh = opt.height; 2967 if (opt.autoHeight=="on") 2968 ooh = container.height(); 2969 2970 2971 actli.find('.tp-half-one .defaultimg').wrap('<div class="tp-papercut" style="width:'+oow+'px;height:'+ooh+'px;"></div>') 2972 actli.find('.tp-half-two .defaultimg').wrap('<div class="tp-papercut" style="width:'+oow+'px;height:'+ooh+'px;"></div>') 2973 actli.find('.tp-half-two .defaultimg').css({position:'absolute',top:'-50%'}); 2974 actli.find('.tp-half-two .tp-caption').wrapAll('<div style="position:absolute;top:-50%;left:0px;"></div>'); 2975 2976 mtl.add(punchgs.TweenLite.set(actli.find('.tp-half-two'), 2977 {width:oow,height:ooh,overflow:'hidden',zIndex:15,position:'absolute',top:ooh/2,left:'0px',transformPerspective:600,transformOrigin:"center bottom"}),0); 2978 2979 mtl.add(punchgs.TweenLite.set(actli.find('.tp-half-one'), 2980 {width:oow,height:ooh/2,overflow:'visible',zIndex:10,position:'absolute',top:'0px',left:'0px',transformPerspective:600,transformOrigin:"center top"}),0); 2981 2982 2983 2984 // ANIMATE THE CUTS 2985 var img=actli.find('.defaultimg'); 2986 2987 2988 var ro1=Math.round(Math.random()*20-10), 2989 ro2=Math.round(Math.random()*20-10), 2990 ro3=Math.round(Math.random()*20-10), 2991 xof = Math.random()*0.4-0.2, 2992 yof = Math.random()*0.4-0.2, 2993 sc1=Math.random()*1+1, 2994 sc2=Math.random()*1+1, 2995 sc3=Math.random()*0.3+0.3; 2996 2997 mtl.add(punchgs.TweenLite.set(actli.find('.tp-half-one'),{overflow:'hidden'}),0); 2998 mtl.add(punchgs.TweenLite.fromTo(actli.find('.tp-half-one'),masterspeed/800, 2999 {width:oow,height:ooh/2,position:'absolute',top:'0px',left:'0px',force3D:"auto",transformOrigin:"center top"}, 3000 {scale:sc1,rotation:ro1,y:(0-ooh-ooh/4),autoAlpha:0,ease:punchgs.Power2.easeInOut}),0); 3001 mtl.add(punchgs.TweenLite.fromTo(actli.find('.tp-half-two'),masterspeed/800, 3002 {width:oow,height:ooh,overflow:'hidden',position:'absolute',top:ooh/2,left:'0px',force3D:"auto",transformOrigin:"center bottom"},
3003 {scale:sc2,rotation:ro2,y:ooh+ooh/4,ease:punchgs.Power2.easeInOut,autoAlpha:0,onComplete:function() { 3004 // CLEAN UP 3005 punchgs.TweenLite.set(actli,{'position':'absolute','z-index':15}); 3006 punchgs.TweenLite.set(nextli,{'position':'absolute','z-index':20}); 3007 if (actli.find('.tp-half-one').length>0) { 3008 actli.find('.tp-half-one .defaultimg').unwrap(); 3009 actli.find('.tp-half-one .slotholder').unwrap(); 3010 } 3011 actli.find('.tp-half-two').remove(); 3012 }}),0); 3013 3014 subtl.add(punchgs.TweenLite.set(nextsh.find('.defaultimg'),{autoAlpha:1}),0); 3015 3016 if (actli.html()!=null) 3017 mtl.add(punchgs.TweenLite.fromTo(nextli,(masterspeed-200)/1000, 3018 {scale:sc3,x:(opt.width/4)*xof, y:(ooh/4)*yof,rotation:ro3,force3D:"auto",transformOrigin:"center center",ease:punchgs.Power2.easeOut}, 3019 {autoAlpha:1,scale:1,x:0,y:0,rotation:0}),0); 3020 3021 mtl.add(subtl,0); 3022 3023 3024 } 3025 3026 //////////////////////////////////////// 3027 // THE SLOTSLIDE - TRANSITION XVII. // 3028 /////////////////////////////////////// 3029 if (nexttrans==17) { // 3D CURTAIN HORIZONTAL 3030 3031 3032 // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT 3033 3034 nextsh.find('.slotslide').each(function(j) { 3035 var ss=jQuery(this); 3036 3037 mtl.add(punchgs.TweenLite.fromTo(ss,(masterspeed)/800, 3038 {opacity:0,rotationY:0,scale:0.9,rotationX:-110,force3D:"auto",transformPerspective:600,transformOrigin:"center center"}, 3039 {opacity:1,top:0,left:0,scale:1,rotation:0,rotationX:0,force3D:"auto",rotationY:0,ease:punchgs.Power3.easeOut,delay:j*0.06}),0); 3040 3041 }); 3042 } 3043 3044 3045 3046 //////////////////////////////////////// 3047 // THE SLOTSLIDE - TRANSITION XVIII. // 3048 /////////////////////////////////////// 3049 if (nexttrans==18) { // 3D CURTAIN VERTICAL 3050 3051 // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT 3052 nextsh.find('.slotslide').each(function(j) { 3053 var ss=jQuery(this); 3054 3055 mtl.add(punchgs.TweenLite.fromTo(ss,(masterspeed)/500, 3056 {autoAlpha:0,rotationY:310,scale:0.9,rotationX:10,force3D:"auto",transformPerspective:600,transformOrigin:"center center"}, 3057 {autoAlpha:1,top:0,left:0,scale:1,rotation:0,rotationX:0,force3D:"auto",rotationY:0,ease:punchgs.Power3.easeOut,delay:j*0.06}),0); 3058 }); 3059 3060 3061 3062 } 3063 3064 3065 //////////////////////////////////////// 3066 // THE SLOTSLIDE - TRANSITION XIX. // 3067 /////////////////////////////////////// 3068 3069 3070 if (nexttrans==19 || nexttrans==22) { // IN CUBE 3071 3072 3073 var subtl = new punchgs.TimelineLite(); 3074 //SET DEFAULT IMG UNVISIBLE 3075 3076 mtl.add(punchgs.TweenLite.set(actli,{zIndex:20}),0); 3077 mtl.add(punchgs.TweenLite.set(nextli,{zIndex:20}),0); 3078 setTimeout(function() { 3079 actsh.find('.defaultimg').css({opacity:0}); 3080 },100); 3081 var chix=nextli.css('z-index'), 3082 chix2=actli.css('z-index'), 3083 rot = 90, 3084 op = 1; 3085 3086 if (direction==1) rot = -90; 3087 3088 if (nexttrans==19) { 3089 var torig = "center center -"+opt.height/2; 3090 op=0; 3091 3092 } else { 3093 var torig = "center center "+opt.height/2; 3094 3095 } 3096 3097 // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT 3098 punchgs.TweenLite.set(container,{transformStyle:"flat",backfaceVisibility:"hidden",transformPerspective:600}); 3099 3100 nextsh.find('.slotslide').each(function(j) { 3101 var ss=jQuery(this); 3102 3103 subtl.add(punchgs.TweenLite.fromTo(ss,masterspeed/1000, 3104 {transformStyle:"flat",backfaceVisibility:"hidden",left:0,rotationY:opt.rotate,z:10,top:0,scale:1,force3D:"auto",transformPerspective:600,transformOrigin:torig,rotationX:rot}, 3105 {left:0,rotationY:0,top:0,z:0, scale:1,force3D:"auto",rotationX:0, delay:(j*50)/1000,ease:punchgs.Power2.easeInOut}),0); 3106 subtl.add(punchgs.TweenLite.to(ss,0.1,{autoAlpha:1,delay:(j*50)/1000}),0); 3107 mtl.add(subtl); 3108 }); 3109 3110 actsh.find('.slotslide').each(function(j) { 3111 var ss=jQuery(this); 3112 var rot = -90; 3113 if (direction==1) rot = 90; 3114 3115 subtl.add(punchgs.TweenLite.fromTo(ss,masterspeed/1000, 3116 {transformStyle:"flat",backfaceVisibility:"hidden",autoAlpha:1,rotationY:0,top:0,z:0,scale:1,force3D:"auto",transformPerspective:600,transformOrigin:torig, rotationX:0},
3117 {autoAlpha:1,rotationY:opt.rotate,top:0,z:10, scale:1,rotationX:rot, delay:(j*50)/1000,force3D:"auto",ease:punchgs.Power2.easeInOut}),0); 3118 3119 mtl.add(subtl); 3120 }); 3121 } 3122 3123 3124 3125 3126 //////////////////////////////////////// 3127 // THE SLOTSLIDE - TRANSITION XX. // 3128 /////////////////////////////////////// 3129 if (nexttrans==20 ) { // FLYIN 3130 3131 3132 setTimeout(function() { 3133 actsh.find('.defaultimg').css({opacity:0}); 3134 },100); 3135 var chix=nextli.css('z-index'); 3136 var chix2=actli.css('z-index'); 3137 3138 if (direction==1) { 3139 var ofx = -opt.width 3140 var rot =70; 3141 var torig = "left center -"+opt.height/2; 3142 } else { 3143 var ofx = opt.width; 3144 var rot = -70; 3145 var torig = "right center -"+opt.height/2; 3146 } 3147 3148 3149 nextsh.find('.slotslide').each(function(j) { 3150 var ss=jQuery(this); 3151 3152 mtl.add(punchgs.TweenLite.fromTo(ss,masterspeed/1500, 3153 {left:ofx,rotationX:40,z:-600, opacity:op,top:0,force3D:"auto",transformPerspective:600,transformOrigin:torig,rotationY:rot}, 3154 {left:0, delay:(j*50)/1000,ease:punchgs.Power2.easeInOut}),0); 3155 3156 mtl.add(punchgs.TweenLite.fromTo(ss,masterspeed/1000, 3157 {rotationX:40,z:-600, opacity:op,top:0,scale:1,force3D:"auto",transformPerspective:600,transformOrigin:torig,rotationY:rot}, 3158 {rotationX:0,opacity:1,top:0,z:0, scale:1,rotationY:0, delay:(j*50)/1000,ease:punchgs.Power2.easeInOut}),0); 3159 3160 mtl.add(punchgs.TweenLite.to(ss,0.1,{opacity:1,force3D:"auto",delay:(j*50)/1000+masterspeed/2000}),0); 3161 3162 }); 3163 actsh.find('.slotslide').each(function(j) { 3164 var ss=jQuery(this); 3165 3166 if (direction!=1) { 3167 var ofx = -opt.width 3168 var rot =70; 3169 var torig = "left center -"+opt.height/2; 3170 } else { 3171 var ofx = opt.width; 3172 var rot = -70; 3173 var torig = "right center -"+opt.height/2; 3174 } 3175 mtl.add(punchgs.TweenLite.fromTo(ss,masterspeed/1000, 3176 {opacity:1,rotationX:0,top:0,z:0,scale:1,left:0, force3D:"auto",transformPerspective:600,transformOrigin:torig, rotationY:0}, 3177 {opacity:1,rotationX:40,top:0, z:-600, left:ofx, force3D:"auto",scale:0.8,rotationY:rot, delay:(j*50)/1000,ease:punchgs.Power2.easeInOut}),0); 3178 mtl.add(punchgs.TweenLite.to(ss,0.1,{force3D:"auto",opacity:0,delay:(j*50)/1000+(masterspeed/1000 - (masterspeed/10000))}),0); 3179 }); 3180 } 3181 3182 //////////////////////////////////////// 3183 // THE SLOTSLIDE - TRANSITION XX. // 3184 /////////////////////////////////////// 3185 if (nexttrans==21 || nexttrans==25) { // TURNOFF 3186 3187 3188 //SET DEFAULT IMG UNVISIBLE 3189 3190 setTimeout(function() { 3191 actsh.find('.defaultimg').css({opacity:0}); 3192 },100); 3193 var chix=nextli.css('z-index'); 3194 var chix2=actli.css('z-index'); 3195 3196 if (direction==1) { 3197 var ofx = -opt.width 3198 var rot =90; 3199 3200 if (nexttrans==25) { 3201 var torig = "center top 0" 3202 rot2 = -rot; 3203 rot = opt.rotate; 3204 } else { 3205 var torig = "left center 0"; 3206 rot2 = opt.rotate; 3207 } 3208 3209 } else { 3210 var ofx = opt.width; 3211 var rot = -90; 3212 if (nexttrans==25) { 3213 var torig = "center bottom 0" 3214 rot2 = -rot; 3215 rot = opt.rotate; 3216 } else { 3217 var torig = "right center 0"; 3218 rot2 = opt.rotate; 3219 } 3220 } 3221 3222 3223 nextsh.find('.slotslide').each(function(j) { 3224 var ss=jQuery(this); 3225 3226 3227 mtl.add(punchgs.TweenLite.fromTo(ss,masterspeed/1000, 3228 {left:0,transformStyle:"flat",rotationX:rot2,z:0, autoAlpha:0,top:0,scale:1,force3D:"auto",transformPerspective:600,transformOrigin:torig,rotationY:rot}, 3229 {left:0,rotationX:0,top:0,z:0, autoAlpha:1,scale:1,rotationY:0,force3D:"auto", ease:punchgs.Power3.easeInOut}),0); 3230 }); 3231 3232 3233 3234 if (direction!=1) { 3235 var ofx = -opt.width 3236 var rot = 90; 3237 3238 if (nexttrans==25) { 3239 var torig = "center top 0" 3240 rot2 = -rot; 3241 rot = opt.rotate; 3242 } else { 3243 var torig = "left center 0"; 3244 rot2 = opt.rotate; 3245 } 3246 3247 } else { 3248 var ofx = opt.width; 3249 var rot = -90; 3250 if (nexttrans==25) { 3251 var torig = "center bottom 0" 3252 rot2 = -rot; 3253 rot = opt.rotate; 3254 } else { 3255 var torig = "right center 0"; 3256 rot2 = opt.rotate; 3257 } 3258 } 3259 3260 actsh.find('.slotslide').each(function(j) { 3261 var ss=jQuery(this); 3262 mtl.add(punchgs.TweenLite.fromTo(ss,masterspeed/1000, 3263 {left:0,transformStyle:"flat",rotationX:0,z:0, autoAlpha:1,top:0,scale:1,force3D:"auto",transformPerspective:600,transformOrigin:torig,rotationY:0}, 3264 {left:0,rotationX:rot2,top:0,z:0,autoAlpha:1,force3D:"auto", scale:1,rotationY:rot,ease:punchgs.Power1.easeInOut}),0); 3265 }); 3266 } 3267 3268 3269
3270 //////////////////////////////////////// 3271 // THE SLOTSLIDE - TRANSITION XX. // 3272 /////////////////////////////////////// 3273 if (nexttrans==23 || nexttrans == 24) { // cube-horizontal - inboxhorizontal 3274 3275 3276 //SET DEFAULT IMG UNVISIBLE 3277 setTimeout(function() { 3278 actsh.find('.defaultimg').css({opacity:0}); 3279 },100); 3280 var chix=nextli.css('z-index'); 3281 var chix2=actli.css('z-index'); 3282 3283 var rot = -90; 3284 if (direction==1) 3285 rot = 90; 3286 3287 var op = 1; 3288 3289 3290 if (nexttrans==23) { 3291 var torig = "center center -"+opt.width/2; 3292 op=0; 3293 3294 } else { 3295 var torig = "center center "+opt.width/2; 3296 3297 } 3298 3299 3300 var opx=0; 3301 punchgs.TweenLite.set(container,{transformStyle:"preserve-3d",backfaceVisibility:"hidden",perspective:2500}); 3302 nextsh.find('.slotslide').each(function(j) { 3303 var ss=jQuery(this); 3304 3305 mtl.add(punchgs.TweenLite.fromTo(ss,masterspeed/1000, 3306 {left:opx,rotationX:opt.rotate,force3D:"auto",opacity:op,top:0,scale:1,transformPerspective:600,transformOrigin:torig,rotationY:rot}, 3307 {left:0,rotationX:0,autoAlpha:1,top:0,z:0, scale:1,rotationY:0, delay:(j*50)/500,ease:punchgs.Power2.easeInOut}),0); 3308 3309 3310 }); 3311 3312 rot = 90; 3313 if (direction==1) 3314 rot = -90; 3315 3316 3317 3318 3319 actsh.find('.slotslide').each(function(j) { 3320 var ss=jQuery(this); 3321 mtl.add(punchgs.TweenLite.fromTo(ss,masterspeed/1000, 3322 {left:0,autoAlpha:1,rotationX:0,top:0,z:0,scale:1,force3D:"auto",transformPerspective:600,transformOrigin:torig, rotationY:0}, 3323 {left:opx,autoAlpha:1,rotationX:opt.rotate,top:0, scale:1,rotationY:rot, delay:(j*50)/500,ease:punchgs.Power2.easeInOut}),0); 3324 3325 3326 3327 }); 3328 } 3329 3330 3331 // SHOW FIRST LI && ANIMATE THE CAPTIONS 3332 mtl.pause(); 3333 animateTheCaptions(nextli, opt,null,mtl); 3334 punchgs.TweenLite.to(nextli,0.001,{autoAlpha:1}); 3335 3336 3337 var data={}; 3338 data.slideIndex=opt.next+1; 3339 data.slide = nextli; 3340 container.trigger('revolution.slide.onchange',data); 3341 setTimeout(function() { container.trigger('revolution.slide.onafterswap'); },masterspeed); 3342 container.trigger('revolution.slide.onvideostop'); 3343 3344 } 3345 3346 3347 3348 3349 3350 3351 /************************************** 3352 - GIVE FREE THE TRANSITIOSN - 3353 **************************************/ 3354 var letItFree = function(container,opt,nextsh,actsh,nextli,actli,mtl) { 3355 punchgs.TweenLite.to(nextsh.find('.defaultimg'),0.001,{autoAlpha:1,onComplete:function() { 3356 removeSlots(container,opt,nextli); 3357 }}); 3358 if (nextli.index()!=actli.index()) { 3359 punchgs.TweenLite.to(actli,0.2,{autoAlpha:0,onComplete:function() { 3360 removeSlots(container,opt,actli); 3361 }}); 3362 } 3363 opt.act=opt.next; 3364 if (opt.navigationType=="thumb") moveSelectedThumb(container); 3365 if (nextsh.data('kenburns')=="on") { 3366 startKenBurn(container,opt); 3367 } 3368 container.find('.current-sr-slide-visible').removeClass("current-sr-slide-visible"); 3369 nextli.addClass("current-sr-slide-visible"); 3370 if (opt.hideOnFirstLast=="on"){ 3371 var slide = nextli.find(".tp-bgimg.defaultimg"); 3372 var last =container.find(".tp-bgimg.defaultimg").last().data("img_num"); 3373 if (slide.data("img_num")== 0){ 3374 $(".tp-rightarrow").css({"visibility":"visible"}); 3375 $(".tp-leftarrow").css({"visibility":"hidden"}); 3376 }else if(slide.data("img_num")== last){ 3377 $(".tp-rightarrow").css({"visibility":"hidden"}); 3378 $(".tp-leftarrow").css({"visibility":"visible"}); 3379 }else{ 3380 $(".tp-leftarrow").css({"visibility":"visible"}); 3381 $(".tp-rightarrow").css({"visibility":"visible"}); 3382 } 3383 } 3384 if (opt.parallax=="scroll" || opt.parallax=="scroll+mouse" || opt.parallax=="mouse+scroll") { 3385 scrollParallax(container,opt); 3386 } 3387 3388 mtl.clear(); 3389 3390 } 3391 3392 3393 ////////////////////////////////////////// 3394 // CHANG THE YOUTUBE PLAYER STATE HERE // 3395 //////////////////////////////////////// 3396 var onPlayerStateChange = function(event) { 3397 3398 var embedCode = event.target.getVideoEmbedCode(); 3399 var ytcont = jQuery('#'+embedCode.split('id="')[1].split('"')[0]) 3400 var container = ytcont.closest('.tp-simpleresponsive'); 3401 var player = ytcont.parent().data('player'); 3402 3403 if (event.data == YT.PlayerState.PLAYING) { 3404 3405 var bt = container.find('.tp-bannertimer'); 3406 var opt = bt.data('opt'); 3407 3408 3409 if (ytcont.closest('.tp-caption').data('volume')=="mute") 3410 player.mute(); 3411 3412 opt.videoplaying=true; 3413 container.trigger('stoptimer'); 3414 //konsole.log("VideoPlay set to True due onPlayerStateChange PLAYING"); 3415 container.trigger('revolution.slide.onvideoplay'); //opt.videostartednow=1; 3416 3417 3418 } else { 3419 3420 var bt = container.find('.tp-bannertimer'); 3421 var opt = bt.data('opt'); 3422 3423 if (event.data!=-1) { 3424 opt.videoplaying=false; 3425 container.trigger('playtimer'); 3426 container.trigger('revolution.slide.onvideostop'); //opt.videostoppednow=1; 3427 3428 } 3429 3430 } 3431 if (event.data==0 && opt.nextslideatend==true) 3432 opt.container.revnext(); 3433 3434 3435 } 3436 3437 3438
3439 //////////////////////// 3440 // VIMEO ADD EVENT ///// 3441 //////////////////////// 3442 var addEvent = function(element, eventName, callback) { 3443 3444 if (element.addEventListener) element.addEventListener(eventName, callback, false); 3445 else 3446 element.attachEvent(eventName, callback, false); 3447 } 3448 3449 3450 3451 ///////////////////////////////////// 3452 // EVENT HANDLING FOR VIMEO VIDEOS // 3453 ///////////////////////////////////// 3454 3455 var vimeoready_auto = function(player_id,autoplay) { 3456 3457 var froogaloop = $f(player_id); 3458 var vimcont = jQuery('#'+player_id); 3459 var container = vimcont.closest('.tp-simpleresponsive'); 3460 3461 3462 froogaloop.addEvent('ready', function(data) { 3463 if(autoplay) froogaloop.api('play'); 3464 3465 froogaloop.addEvent('play', function(data) { 3466 var bt = container.find('.tp-bannertimer'); 3467 var opt = bt.data('opt'); 3468 3469 opt.videoplaying=true; 3470 container.trigger('stoptimer'); 3471 if (vimcont.closest('.tp-caption').data('volume')=="mute") 3472 froogaloop.api('setVolume',"0"); 3473 //konsole.log("VideoPlay set to True due vimeoready_auto PLAYING"); 3474 }); 3475 3476 froogaloop.addEvent('finish', function(data) { 3477 var bt = container.find('.tp-bannertimer'); 3478 var opt = bt.data('opt'); 3479 opt.videoplaying=false; 3480 container.trigger('playtimer'); 3481 //konsole.log("VideoPlay set to False due vimeoready_auto FINISH"); 3482 container.trigger('revolution.slide.onvideoplay'); //opt.videostartednow=1; 3483 if (opt.nextslideatend==true) 3484 opt.container.revnext(); 3485 3486 }); 3487 3488 froogaloop.addEvent('pause', function(data) { 3489 var bt = container.find('.tp-bannertimer'); 3490 var opt = bt.data('opt'); 3491 opt.videoplaying=false; 3492 container.trigger('playtimer'); 3493 //konsole.log("VideoPlay set to False due vimeoready_auto PAUSE"); 3494 container.trigger('revolution.slide.onvideostop'); //opt.videostoppednow=1; 3495 }); 3496 }); 3497 } 3498 3499 3500 3501 ///////////////////////////////////// 3502 // RESIZE HTML5VIDEO FOR FULLSCREEN// 3503 ///////////////////////////////////// 3504 var updateHTML5Size = function(pc,container) { 3505 var windowW = container.width(); 3506 var windowH = container.height(); 3507 var mediaAspect = pc.data('mediaAspect'); 3508 if (mediaAspect == undefined) mediaAspect = 1; 3509 3510 3511 var windowAspect = windowW/windowH; 3512 3513 pc.css({position:"absolute"}); 3514 var video = pc.find('video'); 3515 3516 3517 if (windowAspect < mediaAspect) { 3518 // taller 3519 pc 3520 .width(windowH*mediaAspect) 3521 .height(windowH); 3522 3523 punchgs.TweenLite.to(pc,0.01,{force3D:"auto",top:0, 3524 left:0-(windowH*mediaAspect-windowW)/2, 3525 height:windowH}); 3526 3527 /* video 3528 .width(windowH*mediaAspect) 3529 .height(windowH); 3530 video 3531 .css('top',0) 3532 .css('left',-(windowH*mediaAspect-windowW)/2) 3533 .css('height',windowH); */ 3534 3535 3536 } else { 3537 // wider 3538 pc 3539 .width(windowW) 3540 .height(windowW/mediaAspect); 3541 3542 punchgs.TweenLite.to(pc,0.01,{force3D:"auto",top:0-(windowW/mediaAspect-windowH)/2, 3543 left:0, 3544 height:windowW/mediaAspect}); 3545 3546 3547 /* video 3548 .width(windowW) 3549 .height(windowW/mediaAspect); 3550 video 3551 .css('top',-(windowW/mediaAspect-windowH)/2) 3552 .css('left',0) 3553 .css('height',windowW/mediaAspect);*/ 3554 3555 } 3556 3557 3558 } 3559 3560 3561 3562 ///////////////////////////////////// 3563 // - CREATE ANIMATION OBJECT - // 3564 ///////////////////////////////////// 3565 3566 var newAnimObject = function() { 3567 var a = new Object(); 3568 a.x=0; 3569 a.y=0; 3570 a.rotationX = 0; 3571 a.rotationY = 0; 3572 a.rotationZ = 0; 3573 a.scale = 1; 3574 a.scaleX = 1; 3575 a.scaleY = 1; 3576 a.skewX = 0; 3577 a.skewY = 0; 3578 a.opacity=0; 3579 a.transformOrigin = "center, center"; 3580 a.transformPerspective = 400; 3581 a.rotation = 0; 3582 return a; 3583 } 3584 3585 /////////////////////////////////////////////////// 3586 // ANALYSE AND READ OUT DATAS FROM HTML CAPTIONS // 3587 /////////////////////////////////////////////////// 3588 var getAnimDatas = function(frm,data) { 3589 3590 var customarray = data.split(';'); 3591 jQuery.each(customarray,function(index,param) { 3592 3593 param = param.split(":") 3594 3595 var w = param[0], 3596 v = param[1]; 3597 if (w=="rotationX") frm.rotationX = parseInt(v,0); 3598 if (w=="rotationY") frm.rotationY = parseInt(v,0); 3599 if (w=="rotationZ") frm.rotationZ = parseInt(v,0); 3600 if (w=="rotationZ") frm.rotation = parseInt(v,0); 3601 if (w=="scaleX") frm.scaleX = parseFloat(v); 3602 if (w=="scaleY") frm.scaleY = parseFloat(v); 3603 if (w=="opacity") frm.opacity = parseFloat(v);
3604 if (w=="skewX") frm.skewX = parseInt(v,0); 3605 if (w=="skewY") frm.skewY = parseInt(v,0); 3606 if (w=="x") frm.x = parseInt(v,0); 3607 if (w=="y") frm.y = parseInt(v,0); 3608 if (w=="z") frm.z = parseInt(v,0); 3609 if (w=="transformOrigin") frm.transformOrigin = v.toString(); 3610 if (w=="transformPerspective") frm.transformPerspective=parseInt(v,0); 3611 }) 3612 3613 return frm; 3614 } 3615 /////////////////////////////////////////////////////////////////// 3616 // ANALYSE AND READ OUT DATAS FROM HTML CAPTIONS ANIMATION STEPS // 3617 /////////////////////////////////////////////////////////////////// 3618 var getAnimSteps = function(data) { 3619 3620 var paramarray = data.split("animation:"); 3621 var params = new Object(); 3622 3623 params.animation = getAnimDatas(newAnimObject(),paramarray[1]); 3624 var customarray = paramarray[0].split(';'); 3625 3626 jQuery.each(customarray,function(index,param) { 3627 param = param.split(":") 3628 var w = param[0], 3629 v = param[1]; 3630 if (w=="typ") params.typ = v; 3631 if (w=="speed") params.speed = parseInt(v,0)/1000; 3632 if (w=="start") params.start = parseInt(v,0)/1000; 3633 if (w=="elementdelay") params.elementdelay = parseFloat(v); 3634 if (w=="ease") params.ease = v; 3635 }) 3636 3637 return params; 3638 } 3639 3640 3641 3642 3643 //////////////////////// 3644 // SHOW THE CAPTION // 3645 /////////////////////// 3646 var animateTheCaptions = function(nextli, opt,recalled,mtl) { 3647 3648 if (nextli.data('ctl')==undefined) { 3649 nextli.data('ctl',new punchgs.TimelineLite()); 3650 } 3651 3652 var ctl = nextli.data('ctl'), 3653 offsetx=0, 3654 offsety=0, 3655 allcaptions = nextli.find('.tp-caption'), 3656 allstaticcaptions = opt.container.find('.tp-static-layers').find('.tp-caption'); 3657 3658 ctl.pause(); 3659 3660 jQuery.each(allstaticcaptions, function(index,staticcapt) { 3661 allcaptions.push(staticcapt); 3662 }); 3663 3664 allcaptions.each(function(i) { 3665 var internrecalled = recalled, 3666 staticdirection = -1, // 1 -> In, 2-> Out 0-> Ignore -1-> Not Static 3667 nextcaption=jQuery(this); 3668 3669 if (nextcaption.hasClass("tp-static-layer")) { 3670 3671 if (nextcaption.data('startslide') == -1 || nextcaption.data('startslide') == "-1") 3672 nextcaption.data('startslide',0); 3673 3674 if (nextcaption.data('endslide') == -1 || nextcaption.data('endslide') == "-1") 3675 nextcaption.data('endslide',opt.slideamount); 3676 3677 // IF STATIC ITEM CURRENTLY NOT VISIBLE 3678 if (!nextcaption.hasClass("tp-is-shown")) { 3679 // IF ITEM SHOULD BECOME VISIBLE 3680 3681 3682 if ((nextcaption.data('startslide')<=opt.next && nextcaption.data('endslide')>=opt.next) || 3683 (nextcaption.data('startslide') == opt.next) || (nextcaption.data('endslide') == opt.next)){ 3684 3685 nextcaption.addClass("tp-is-shown"); 3686 staticdirection = 1; 3687 } else { 3688 3689 staticdirection = 0; 3690 } 3691 // IF STATIC ITEM ALREADY VISIBLE 3692 } else { 3693 3694 if ((nextcaption.data('endslide')==opt.next) || 3695 (nextcaption.data('startslide') > opt.next) || 3696 (nextcaption.data('endslide') < opt.next)) { 3697 staticdirection = 2; 3698 //nextcaption.removeClass("tp-is-shown"); 3699 } else { 3700 staticdirection = 0; 3701 } 3702 3703 } 3704 3705 } 3706 3707 3708 3709 3710 3711 offsetx = opt.width/2 - (opt.startwidth*opt.bw)/2; 3712 3713 3714 3715 var xbw = opt.bw; 3716 var xbh = opt.bh; 3717 3718 3719 if (opt.fullScreen=="on") 3720 offsety = opt.height/2 - (opt.startheight*opt.bh)/2; 3721 3722 if (opt.autoHeight=="on") 3723 offsety = opt.container.height()/2 - (opt.startheight*opt.bh)/2;; 3724 3725 if (offsety<0) offsety=0; 3726 3727 3728 3729 var handlecaption=0; 3730 3731 // HIDE CAPTION IF RESOLUTION IS TOO LOW 3732 if (opt.width<opt.hideCaptionAtLimit && nextcaption.data('captionhidden')=="on") { 3733 nextcaption.addClass("tp-hidden-caption") 3734 handlecaption=1; 3735 } else { 3736 if (opt.width<opt.hideAllCaptionAtLimit || opt.width<opt.hideAllCaptionAtLilmit) { 3737 nextcaption.addClass("tp-hidden-caption") 3738 handlecaption=1; 3739 } else { 3740 nextcaption.removeClass("tp-hidden-caption") 3741 } 3742 } 3743 3744 3745 3746 if (handlecaption==0) { 3747 3748 // ADD A CLICK LISTENER TO THE CAPTION 3749 if (nextcaption.data('linktoslide')!=undefined && !nextcaption.hasClass("hasclicklistener")) { 3750 nextcaption.addClass("hasclicklistener") 3751 nextcaption.css({'cursor':'pointer'}); 3752 if (nextcaption.data('linktoslide')!="no") { 3753 nextcaption.click(function() { 3754 var nextcaption=jQuery(this); 3755 var dir = nextcaption.data('linktoslide'); 3756 if (dir!="next" && dir!="prev") { 3757 opt.container.data('showus',dir); 3758 opt.container.parent().find('.tp-rightarrow').click(); 3759 } else 3760 if (dir=="next") 3761 opt.container.parent().find('.tp-rightarrow').click(); 3762 else 3763 if (dir=="prev") 3764 opt.container.parent().find('.tp-leftarrow').click(); 3765 }); 3766 } 3767 }// END OF CLICK LISTENER 3768 3769 3770 if (offsetx<0) offsetx=0; 3771 3772 3773 // YOUTUBE AND VIMEO LISTENRES INITIALISATION 3774 3775 var frameID = "iframe"+Math.round(Math.random()*1000+1); 3776 3777 if (nextcaption.find('iframe').length>0 || nextcaption.find('video').length>0) { 3778 3779 3780 var autoplaywason = false;
3781 3782 if (nextcaption.data('autoplayonlyfirsttime') == true || nextcaption.data('autoplayonlyfirsttime')=="true" || nextcaption.data('autoplay')==true) { 3783 nextcaption.data('autoplay',true); 3784 autoplaywason = true; 3785 } 3786 3787 3788 3789 nextcaption.find('iframe').each(function() { 3790 var ifr=jQuery(this); 3791 3792 if (is_mobile()) { 3793 var oldsrc = ifr.attr('src'); 3794 ifr.attr('src',""); 3795 ifr.attr('src',oldsrc); 3796 } 3797 3798 3799 // START YOUTUBE HANDLING 3800 opt.nextslideatend = nextcaption.data('nextslideatend'); 3801 if (nextcaption.data('thumbimage')!=undefined && nextcaption.data('thumbimage').length>2 && nextcaption.data('autoplay')!=true && !internrecalled) { 3802 nextcaption.find('.tp-thumb-image').remove(); 3803 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>'); 3804 } 3805 3806 if (ifr.attr('src').toLowerCase().indexOf('youtube')>=0) { 3807 3808 // if (is_mobile()) ifr.attr('src',ifr.attr('src').replace("enablejsapi=1","")); 3809 3810 if (!ifr.hasClass("HasListener")) { 3811 try { 3812 ifr.attr('id',frameID); 3813 3814 var player; 3815 var ytint = setInterval(function() { 3816 if (YT !=undefined) 3817 if (typeof YT.Player != undefined && typeof YT.Player !="undefined") { 3818 3819 if (nextcaption.data('autoplay')==true || autoplaywason) { 3820 player = new YT.Player(frameID, { 3821 events: { 3822 "onStateChange": onPlayerStateChange, 3823 'onReady': function(event) { 3824 event.target.playVideo(); 3825 } 3826 } 3827 }); 3828 } else 3829 player = new YT.Player(frameID, { 3830 events: { 3831 "onStateChange": onPlayerStateChange 3832 } 3833 }); 3834 ifr.addClass("HasListener"); 3835 3836 nextcaption.data('player',player); 3837 clearInterval(ytint); 3838 } 3839 } 3840 , 100) 3841 3842 3843 3844 } catch(e) {} 3845 } else { 3846 3847 if (nextcaption.data('autoplay')==true || autoplaywason) { 3848 var player=nextcaption.data('player'); 3849 nextcaption.data('timerplay',setTimeout(function() { 3850 if (nextcaption.data('forcerewind')=="on") 3851 player.seekTo(0); 3852 player.playVideo(); 3853 },nextcaption.data('start'))); 3854 } 3855 } // END YOUTUBE HANDLING 3856 3857 // PLAY VIDEO IF THUMBNAIL HAS BEEN CLICKED 3858 nextcaption.find('.tp-thumb-image').click(function() { 3859 punchgs.TweenLite.to(jQuery(this),0.3,{opacity:0,force3D:"auto",ease:punchgs.Power3.easeInOut,onComplete: function() { 3860 nextcaption.find('.tp-thumb-image').remove(); 3861 } 3862 }) 3863 if (!is_mobile()) { 3864 var player=nextcaption.data('player'); 3865 player.playVideo(); 3866 } 3867 }) 3868 } else { 3869 // START VIMEO HANDLING 3870 if (ifr.attr('src').toLowerCase().indexOf('vimeo')>=0) { 3871 3872 if (!ifr.hasClass("HasListener")) { 3873 ifr.addClass("HasListener"); 3874 ifr.attr('id',frameID); 3875 var isrc = ifr.attr('src'); 3876 var queryParameters = {}, queryString = isrc, 3877 re = /([^&=]+)=([^&]*)/g, m; 3878 // Creates a map with the query string parameters 3879 while (m = re.exec(queryString)) { 3880 queryParameters[decodeURIComponent(m[1])] = decodeURIComponent(m[2]); 3881 } 3882 3883 if (queryParameters['player_id']!=undefined) 3884 isrc = isrc.replace(queryParameters['player_id'],frameID); 3885 else 3886 isrc=isrc+"&player_id="+frameID; 3887 3888 try{ isrc = isrc.replace('api=0','api=1'); } catch(e) {} 3889 3890 isrc=isrc+"&api=1"; 3891 3892 ifr.attr('src',isrc); 3893 var player = nextcaption.find('iframe')[0]; 3894 var vimint = setInterval(function() { 3895 if ($f !=undefined) 3896 if (typeof $f(frameID).api != undefined && typeof $f(frameID).api !="undefined") { 3897 $f(player).addEvent('ready', function(){ 3898 3899 3900 vimeoready_auto(frameID,autoplaywason) 3901 }); 3902 clearInterval(vimint); 3903 } 3904 },100); 3905 3906 } else { 3907 if (nextcaption.data('autoplay')==true) { 3908 3909 var ifr = nextcaption.find('iframe'); 3910 var id = ifr.attr('id'); 3911 var vimint = setInterval(function() { 3912 if ($f !=undefined) 3913 if (typeof $f(id).api != undefined && typeof $f(id).api !="undefined") { 3914 var froogaloop = $f(id); 3915 nextcaption.data('timerplay',setTimeout(function() { 3916 if (nextcaption.data('forcerewind')=="on") 3917 froogaloop.api("seekTo",0); 3918 froogaloop.api("play"); 3919 },nextcaption.data('start'))); 3920 clearInterval(vimint); 3921 } 3922 },100); 3923 } 3924 }// END HAS LISTENER HANDLING 3925 3926 // PLAY VIDEO IF THUMBNAIL HAS BEEN CLICKED 3927 nextcaption.find('.tp-thumb-image').click(function() { 3928 punchgs.TweenLite.to(jQuery(this),0.3,{opacity:0,force3D:"auto",ease:punchgs.Power3.easeInOut,onComplete: function() { 3929 nextcaption.find('.tp-thumb-image').remove(); 3930 } 3931 }) 3932 var ifr = nextcaption.find('iframe'); 3933 var id = ifr.attr('id'); 3934 var vimint = setInterval(function() { 3935 if ($f !=undefined) 3936 if (typeof $f(id).api != undefined && typeof $f(id).api !="undefined") { 3937 var froogaloop = $f(id); 3938 froogaloop.api("play"); 3939 clearInterval(vimint); 3940 } 3941 },100); 3942 }) 3943 3944 3945 } // END OF VIMEO HANDLING 3946 } // END OF CHOOSE BETWEEN YOUTUBE AND VIMEO 3947 }); // END OF LOOP THROUGH IFRAMES 3948 3949 // START OF VIDEO JS 3950 if (nextcaption.find('video').length>0) { 3951 3952 3953 nextcaption.find('video').each(function(i) { 3954 3955 var jvideo = jQuery(this); 3956 var video = this; 3957 3958 if (!jvideo.parent().hasClass("html5vid")) { 3959 jvideo.wrap('<div class="html5vid" style="position:relative;top:0px;left:0px;width:auto;height:auto"></div>'); 3960 3961 } 3962 var html5vid = jQuery(this).parent(); 3963 3964 if (video.addEventListener) 3965 video.addEventListener("loadedmetadata",function() { 3966 html5vid.data('metaloaded',1); 3967 }); 3968 else 3969 video.attachEvent("loadedmetadata",function() { 3970 html5vid.data('metaloaded',1); 3971 }); 3972 3973 3974 if (!jvideo.hasClass("HasListener")) { 3975 3976 jvideo.addClass("HasListener") 3977 video.addEventListener("play",function() { 3978 html5vid.addClass("videoisplaying"); 3979 html5vid.find('.tp-poster').remove(); 3980 if (nextcaption.data('volume')=="mute") 3981 video.muted=true; 3982 opt.container.trigger('revolution.slide.onvideoplay'); 3983 opt.videoplaying=true; 3984 opt.container.trigger('stoptimer'); 3985 3986 }); 3987 3988 video.addEventListener("pause",function() { 3989 html5vid.removeClass("videoisplaying"); 3990 opt.videoplaying=false; 3991 opt.container.trigger('playtimer'); 3992 opt.container.trigger('revolution.slide.onvideostop'); 3993 }); 3994 3995 video.addEventListener("ended",function() { 3996 html5vid.removeClass("videoisplaying"); 3997 opt.videoplaying=false; 3998 opt.container.trigger('playtimer'); 3999 opt.container.trigger('revolution.slide.onvideostop'); 4000 if (opt.nextslideatend==true) 4001 opt.container.revnext(); 4002 }); 4003 } 4004 4005 4006 if (jvideo.attr('poster')!=undefined && html5vid.find('.tp-poster').length==0) 4007 html5vid.append('<div class="tp-poster" style="position:absolute;z-index:1;width:100%;height:100%;top:0px;left:0px;background:url('+jvideo.attr('poster')+'); background-position:center center;background-size:100%;background-repeat:no-repeat;"></div>'); 4008 4009 if (jvideo.attr('control') == undefined && html5vid.find('.tp-vi
4009deo-play-button').length==0) { 4010 html5vid.append('<div class="tp-video-play-button"><i class="revicon-right-dir"></i><div class="tp-revstop"></div></div>'); 4011 html5vid.find('.tp-video-play-button').click(function() { 4012 if (html5vid.hasClass("videoisplaying")) 4013 video.pause(); 4014 else 4015 video.play(); 4016 }) 4017 } 4018 4019 if (jvideo.attr('control') == undefined) { 4020 html5vid.find('video, .tp-poster').click(function() { 4021 if (html5vid.hasClass("videoisplaying")) 4022 video.pause(); 4023 else 4024 video.play(); 4025 }) 4026 } 4027 4028 4029 4030 if (nextcaption.data('forcecover')==1) { 4031 updateHTML5Size(html5vid,opt.container); 4032 html5vid.addClass("fullcoveredvideo"); 4033 nextcaption.addClass("fullcoveredvideo"); 4034 } 4035 4036 if (nextcaption.data('forcecover')==1 || nextcaption.hasClass('fullscreenvideo')) { 4037 html5vid.css({width:"100%", height:"100%"}); 4038 } 4039 4040 4041 var autoplaywason = false; 4042 4043 if (nextcaption.data('autoplayonlyfirsttime') == true || nextcaption.data('autoplayonlyfirsttime')=="true") { 4044 autoplaywason = true; 4045 4046 } 4047 4048 clearInterval(html5vid.data('interval')); 4049 html5vid.data('interval',setInterval(function() { 4050 4051 if (html5vid.data('metaloaded')==1 || video.duration!=NaN) { 4052 4053 clearInterval(html5vid.data('interval')); 4054 4055 4056 if (nextcaption.data('dottedoverlay')!="none" && nextcaption.data('dottedoverlay')!=undefined) 4057 if (nextcaption.find('.tp-dottedoverlay').length!=1) 4058 html5vid.append('<div class="tp-dottedoverlay '+nextcaption.data('dottedoverlay')+'"></div>'); 4059 4060 var mediaaspect=16/9; 4061 if (nextcaption.data('aspectratio')=="4:3") mediaaspect=4/3; 4062 html5vid.data('mediaAspect',mediaaspect); 4063 4064 4065 4066 if (html5vid.closest('.tp-caption').data('forcecover')==1) { 4067 updateHTML5Size(html5vid,opt.container); 4068 html5vid.addClass("fullcoveredvideo"); 4069 } 4070 4071 jvideo.css({display:"block"}); 4072 4073 opt.nextslideatend = nextcaption.data('nextslideatend'); 4074 4075 // IF VIDEO SHOULD BE AUTOPLAYED 4076 if (nextcaption.data('autoplay')==true || autoplaywason==true) { 4077 var bt=jQuery('body').find('#'+opt.container.attr('id')).find('.tp-bannertimer'); 4078 setTimeout(function(){ 4079 opt.videoplaying=true; 4080 opt.container.trigger('stoptimer'); 4081 },200); 4082 4083 4084 4085 4086 if (nextcaption.data('forcerewind')=="on" && !html5vid.hasClass("videoisplaying")) 4087 if (video.currentTime>0) video.currentTime=0; 4088 4089 if (nextcaption.data('volume')=="mute") 4090 video.muted = true; 4091 4092 html5vid.data('timerplay',setTimeout(function() { 4093 4094 if (nextcaption.data('forcerewind')=="on" && !html5vid.hasClass("videoisplaying")) 4095 if (video.currentTime>0) video.currentTime=0; 4096 4097 if (nextcaption.data('volume')=="mute") 4098 video.muted = true; 4099 4100 setTimeout(function() { 4101 4102 video.play(); 4103 4104 },500); 4105 },10+nextcaption.data('start'))); 4106 } 4107 4108 4109 if (html5vid.data('ww') == undefined) html5vid.data('ww',jvideo.attr('width')); 4110 if (html5vid.data('hh') == undefined) html5vid.data('hh',jvideo.attr('height')); 4111 4112 if (!nextcaption.hasClass("fullscreenvideo") && nextcaption.data('forcecover')==1) { 4113 try{ 4114 html5vid.width(html5vid.data('ww')*opt.bw); 4115 html5vid.height(html5vid.data('hh')*opt.bh); 4116 } catch(e) {} 4117 } 4118 4119 clearInterval(html5vid.data('interval')); 4120 } 4121 }),100); 4122 4123 }); 4124 } // END OF VIDEO JS FUNCTIONS 4125 4126 // IF AUTOPLAY IS ON, WE NEED SOME STOP FUNCTION ON 4127 if (nextcaption.data('autoplay')==true) { 4128 var bt=jQuery('body').find('#'+opt.container.attr('id')).find('.tp-bannertimer'); 4129 4130 setTimeout(function() { 4131 4132 opt.videoplaying=true; 4133 opt.container.trigger('stoptimer'); 4134 4135 },200) 4136 opt.videoplaying=true; 4137 opt.container.trigger('stoptimer'); 4138 4139 if (nextcaption.data('autoplayonlyfirsttime') == true || nextcaption.data('autoplayonlyfirsttime')=="true" ) { 4140 nextcaption.data('autoplay',false); 4141 nextcaption.data('autoplayonlyfirsttime',false); 4142 } 4143 } 4144 } 4145 4146 4147 4148 4149 // NEW ENGINE 4150 //if (nextcaption.hasClass("randomrotate") && (opt.ie || opt.ie9)) nextcaption.removeClass("randomrotate").addClass("sfb"); 4151 // nextcaption.removeClass('noFilterClass'); 4152 4153 4154 4155 var imw =0; 4156 var imh = 0; 4157 4158 if (nextcaption.find('img').length>0) { 4159 var im = nextcaption.find('img'); 4160 if (im.width()==0) im.css({width:"auto"}); 4161 if (im.height()==0) im.css({height:"auto"}); 4162 4163 if (im.data('ww') == undefined && im.width()>0) im.data('ww',im.width()); 4164 if (im.data('hh') == undefined && im.height()>0) im.data('hh',im.height()); 4165 4166 var ww = im.data('ww'); 4167 var hh = im.data('hh'); 4168 4169 if (ww==undefined) ww=0; 4170 if (hh==undefined) hh=0; 4171 4172 im.width(ww*opt.bw); 4173 im.height(hh*opt.bh); 4174 imw = im.width(); 4175 imh = im.height(); 4176 } else { 4177 4178 if (nextcaption.find('iframe').length>0 || nextcaption.find('video').length>0) { 4179 4180 var html5vid = false;
4181 var im = nextcaption.find('iframe'); 4182 if (im.length==0) { 4183 im = nextcaption.find('video'); 4184 html5vid = true; 4185 } 4186 im.css({display:"block"}); 4187 4188 if (nextcaption.data('ww') == undefined) nextcaption.data('ww',im.width()); 4189 if (nextcaption.data('hh') == undefined) nextcaption.data('hh',im.height()); 4190 4191 var ww = nextcaption.data('ww'); 4192 var hh = nextcaption.data('hh'); 4193 4194 var nc =nextcaption; 4195 if (nc.data('fsize') == undefined) nc.data('fsize',parseInt(nc.css('font-size'),0) || 0); 4196 if (nc.data('pt') == undefined) nc.data('pt',parseInt(nc.css('paddingTop'),0) || 0); 4197 if (nc.data('pb') == undefined) nc.data('pb',parseInt(nc.css('paddingBottom'),0) || 0); 4198 if (nc.data('pl') == undefined) nc.data('pl',parseInt(nc.css('paddingLeft'),0) || 0); 4199 if (nc.data('pr') == undefined) nc.data('pr',parseInt(nc.css('paddingRight'),0) || 0); 4200 4201 if (nc.data('mt') == undefined) nc.data('mt',parseInt(nc.css('marginTop'),0) || 0); 4202 if (nc.data('mb') == undefined) nc.data('mb',parseInt(nc.css('marginBottom'),0) || 0); 4203 if (nc.data('ml') == undefined) nc.data('ml',parseInt(nc.css('marginLeft'),0) || 0); 4204 if (nc.data('mr') == undefined) nc.data('mr',parseInt(nc.css('marginRight'),0) || 0); 4205 4206 if (nc.data('bt') == undefined) nc.data('bt',parseInt(nc.css('borderTop'),0) || 0); 4207 if (nc.data('bb') == undefined) nc.data('bb',parseInt(nc.css('borderBottom'),0) || 0); 4208 if (nc.data('bl') == undefined) nc.data('bl',parseInt(nc.css('borderLeft'),0) || 0); 4209 if (nc.data('br') == undefined) nc.data('br',parseInt(nc.css('borderRight'),0) || 0); 4210 4211 if (nc.data('lh') == undefined) nc.data('lh',parseInt(nc.css('lineHeight'),0) || 0); 4212 4213 4214 4215 4216 var fvwidth=opt.width; 4217 var fvheight=opt.height; 4218 if (fvwidth>opt.startwidth) fvwidth=opt.startwidth; 4219 if (fvheight>opt.startheight) fvheight=opt.startheight; 4220 4221 4222 4223 if (!nextcaption.hasClass('fullscreenvideo')) 4224 nextcaption.css({ 4225 4226 'font-size': (nc.data('fsize') * opt.bw)+"px", 4227 4228 'padding-top': (nc.data('pt') * opt.bh) + "px", 4229 'padding-bottom': (nc.data('pb') * opt.bh) + "px", 4230 'padding-left': (nc.data('pl') * opt.bw) + "px", 4231 'padding-right': (nc.data('pr') * opt.bw) + "px", 4232 4233 'margin-top': (nc.data('mt') * opt.bh) + "px", 4234 'margin-bottom': (nc.data('mb') * opt.bh) + "px", 4235 'margin-left': (nc.data('ml') * opt.bw) + "px", 4236 'margin-right': (nc.data('mr') * opt.bw) + "px", 4237 4238 'border-top': (nc.data('bt') * opt.bh) + "px", 4239 'border-bottom': (nc.data('bb') * opt.bh) + "px", 4240 'border-left': (nc.data('bl') * opt.bw) + "px", 4241 'border-right': (nc.data('br') * opt.bw) + "px", 4242 4243 'line-height': (nc.data('lh') * opt.bh) + "px", 4244 'height':(hh*opt.bh)+'px' 4245 }); 4246 else { 4247 4248 offsetx=0; offsety=0; 4249 nextcaption.data('x',0) 4250 nextcaption.data('y',0) 4251 4252 var ovhh = opt.height 4253 if (opt.autoHeight=="on") 4254 ovhh = opt.container.height() 4255 nextcaption.css({ 4256 4257 'width':opt.width, 4258 'height':ovhh 4259 }); 4260 } 4261 4262 if (html5vid == false) { 4263 im.width(ww*opt.bw); 4264 im.height(hh*opt.bh); 4265 } 4266 4267 else 4268 4269 if (nextcaption.data('forcecover')!=1 && !nextcaption.hasClass('fullscreenvideo')) { 4270 im.width(ww*opt.bw); 4271 im.height(hh*opt.bh); 4272 } 4273 4274 4275 imw = im.width(); 4276 imh = im.height(); 4277 } 4278 4279 else { 4280 4281 4282 nextcaption.find('.tp-resizeme, .tp-resizeme *').each(function() { 4283 calcCaptionResponsive(jQuery(this),opt); 4284 }); 4285 4286 if (nextcaption.hasClass("tp-resizeme")) { 4287 nextcaption.find('*').each(function() { 4288 calcCaptionResponsive(jQuery(this),opt); 4289 }); 4290 } 4291 4292 calcCaptionResponsive(nextcaption,opt); 4293 4294 imh=nextcaption.outerHeight(true); 4295 imw=nextcaption.outerWidth(true); 4296 4297 // NEXTCAPTION FRONTCORNER CHANGES 4298 var ncch = nextcaption.outerHeight(); 4299 var bgcol = nextcaption.css('backgroundColor'); 4300 nextcaption.find('.frontcorner').css({ 4301 'borderWidth':ncch+"px", 4302 'left':(0-ncch)+'px', 4303 'borderRight':'0px solid transparent', 4304 'borderTopColor':bgcol 4305 }); 4306 4307 nextcaption.find('.frontcornertop').css({ 4308 'borderWidth':ncch+"px", 4309 'left':(0-ncch)+'px', 4310 'borderRight':'0px solid transparent', 4311 'borderBottomColor':bgcol 4312 }); 4313 4314 // NEXTCAPTION BACKCORNER CHANGES 4315 nextcaption.find('.backcorner').css({ 4316 'borderWidth':ncch+"px", 4317 'right':(0-ncch)+'px', 4318 'borderLeft':'0px solid transparent', 4319 'borderBottomColor':bgcol 4320 }); 4321 4322 // NEXTCAPTION BACKCORNER CHANGES 4323 nextcaption.find('.backcornertop').css({ 4324 'borderWidth':ncch+"px", 4325 'right':(0-ncch)+'px', 4326 'borderLeft':'0px solid transparent', 4327 'borderTopColor':bgcol 4328 }); 4329 4330 } 4331 4332 4333 } 4334 4335 if (opt.fullScreenAlignForce == "on") { 4336 //xbw = 1; 4337 //xbh = 1; 4338 offsetx=0; 4339 offsety=0; 4340 } 4341 4342 4343 4344 if (nextcaption.data('voffset')==undefined) nextcaption.data('voffset',0); 4345 if (nextcaption.data('hoffset')==undefined) nextcaption.data('hoffset',0); 4346 4347 var vofs= nextcaption.data('voffset')*xbw; 4348 var hofs= nextcaption.data('hoffset')*xbw; 4349 4350 var crw = opt.startwidth*xbw; 4351 var crh = opt.startheight*xbw; 4352 4353 if (opt.fullScreenAlignForce == "on") { 4354 crw = opt.container.width(); 4355 crh = opt.container.height(); 4356 } 4357 4358 4359 4360 // CENTER THE CAPTION HORIZONTALLY 4361 if (nextcaption.data('x')=="center" || nextcaption.data('xcenter')=='center') { 4362 nextcaption.data('xcenter','center'); 4363 //nextcaption.data('x',(crw/2 - nextcaption.outerWidth(true)/2)/xbw+ hofs); 4364 nextcaption.data('x',(crw/2 - nextcaption.outerWidth(true)/2) + hofs); 4365 4366 4367 } 4368 4369 // ALIGN LEFT THE CAPTION HORIZONTALLY 4370 if (nextcaption.data('x')=="left" || nextcaption.data('xleft')=='left') { 4371 nextcaption.data('xleft','left'); 4372 4373 nextcaption.data('x',(0)/xbw+hofs); 4374 4375 } 4376 4377 // ALIGN RIGHT THE CAPTION HORIZONTALLY 4378 if (nextcaption.data('x')=="right" || nextcaption.data('xright')=='right') { 4379 nextcaption.data('xright','right'); 4380 nextcaption.data('x',((crw - nextcaption.outerWidth(true))+hofs)/xbw); 4381 //konsole.log("crw:"+crw+" width:"+nextcaption.outerWidth(true)+" xbw:"+xbw); 4382 //konsole.log("x-pos:"+nextcaption.data('x')) 4383 } 4384 4385 4386 // CENTER THE CAPTION VERTICALLY 4387 if (nextcaption.data('y')=="center" || nextcaption.data('ycenter')=='center') { 4388 nextcaption.data('ycenter','center'); 4389 nextcaption.data('y',(crh/2 - nextcaption.outerHeight(true)/2) + vofs); 4390 } 4391 4392 // ALIGN TOP THE CAPTION VERTICALLY 4393 if (nextcaption.data('y')=="top" || nextcaption.data('ytop')=='top') { 4394 nextcaption.data('ytop','top'); 4395 nextcaption.data('y',(0)/opt.bh+vofs); 4396 4397 } 4398 4399 // ALIGN BOTTOM THE CAPTION VERTICALLY 4400 if (nextcaption.data('y')=="bottom" || nextcaption.data('ybottom')=='bottom') { 4401 nextcaption.data('ybottom','bottom'); 4402 nextcaption.data('y',((crh - nextcaption.outerHeight(true))+vofs)/xbw); 4403 4404 } 4405 4406 4407 4408 // THE TRANSITIONS OF CAPTIONS 4409 // MDELAY AND MSPEED 4410 if (nextcaption.data('start') == undefined) nextcaption.data('start',1000); 4411 4412 4413 4414 var easedata=nextcaption.data('easing'); 4415 if (easedata==undefined) easedata="punchgs.Power1.easeOut"; 4416 4417
4418 var mdelay = nextcaption.data('start')/1000; 4419 var mspeed = nextcaption.data('speed')/1000; 4420 4421 4422 if (nextcaption.data('x')=="center" || nextcaption.data('xcenter')=='center') 4423 var calcx = (nextcaption.data('x')+offsetx); 4424 else { 4425 4426 var calcx = (xbw*nextcaption.data('x')+offsetx); 4427 } 4428 4429 4430 if (nextcaption.data('y')=="center" || nextcaption.data('ycenter')=='center') 4431 var calcy = (nextcaption.data('y')+offsety); 4432 else { 4433 //if (opt.fullScreenAlignForce == "on" && (nextcaption.data('y')=="bottom" || nextcaption.data('ybottom')=='bottom')) 4434 // opt.bh = 1; 4435 4436 var calcy = (opt.bh*nextcaption.data('y')+offsety); 4437 } 4438 4439 4440 punchgs.TweenLite.set(nextcaption,{top:calcy,left:calcx,overwrite:"auto"}); 4441 4442 if (staticdirection == 0) 4443 internrecalled = true; 4444 4445 if (nextcaption.data('timeline')!=undefined && !internrecalled) { 4446 nextcaption.data('timeline').gotoAndPlay(0); 4447 internrecalled = true; 4448 } 4449 if (!internrecalled) { 4450 4451 4452 4453 // CLEAR THE TIMELINE, SINCE IT CAN BE DAMAGED, OR PAUSED AT A FEW PART 4454 if (nextcaption.data('timeline')!=undefined) { 4455 //nextcaption.data('timeline').clear(); 4456 } 4457 // MAKE SURE THE ANIMATION ENDS WITH A CLEANING ON MOZ TRANSFORMS 4458 function animcompleted() { 4459 /* setTimeout(function() { 4460 nextcaption.css({transform:"none",'-moz-transform':'none','-webkit-transform':'none'}); 4461 },100)*/ 4462 } 4463 4464 4465 function tlstart() { 4466 /* nextcaption.data('timer',setTimeout(function() { 4467 if (nextcaption.hasClass("fullscreenvideo")) 4468 nextcaption.css({'display':'block'}); 4469 4470 },nextcaption.data('start')));*/ 4471 } 4472 4473 var tl = new punchgs.TimelineLite({smoothChildTiming:true,onStart:tlstart}); 4474 tl.pause(); 4475 4476 4477 if (opt.fullScreenAlignForce == "on") { 4478 //calcy = nextcaption.data('y')+offsety; 4479 } 4480 4481 var animobject = nextcaption; 4482 if (nextcaption.data('mySplitText') !=undefined) nextcaption.data('mySplitText').revert(); 4483 4484 4485 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") { 4486 if (nextcaption.find('a').length>0) 4487 nextcaption.data('mySplitText',new punchgs.SplitText(nextcaption.find('a'),{type:"lines,words,chars",charsClass:"tp-splitted",wordsClass:"tp-splitted",linesClass:"tp-splitted"})); 4488 else 4489 if (nextcaption.find('.tp-layer-inner-rotation').length>0) 4490 nextcaption.data('mySplitText',new punchgs.SplitText(nextcaption.find('.tp-layer-inner-rotation'),{type:"lines,words,chars",charsClass:"tp-splitted",wordsClass:"tp-splitted",linesClass:"tp-splitted"})); 4491 else 4492 nextcaption.data('mySplitText',new punchgs.SplitText(nextcaption,{type:"lines,words,chars",charsClass:"tp-splitted",wordsClass:"tp-splitted",linesClass:"tp-splitted"})); 4493 4494 nextcaption.addClass("splitted"); 4495 } 4496 4497 if (nextcaption.data('splitin') == "chars") 4498 animobject = nextcaption.data('mySplitText').chars; 4499 4500 4501 if (nextcaption.data('splitin') == "words") 4502 animobject = nextcaption.data('mySplitText').words; 4503 4504 4505 if (nextcaption.data('splitin') == "lines") 4506 animobject = nextcaption.data('mySplitText').lines; 4507 4508 4509 4510 var frm = newAnimObject(); 4511 var endfrm = newAnimObject(); 4512 4513 4514 if (nextcaption.data('repeat')!=undefined) repeatV = nextcaption.data('repeat'); 4515 if (nextcaption.data('yoyo')!=undefined) yoyoV = nextcaption.data('yoyo'); 4516 if (nextcaption.data('repeatdelay')!=undefined) repeatdelayV = nextcaption.data('repeatdelay'); 4517 4518 // WHICH ANIMATION TYPE SHOULD BE USED 4519 if (nextcaption.hasClass("customin")) frm = getAnimDatas(frm,nextcaption.data('customin')); 4520 else 4521 if (nextcaption.hasClass("randomrotate")) { 4522 4523 frm.scale = Math.random()*3+1; 4524 frm.rotation = Math.round(Math.random()*200-100); 4525 frm.x = Math.round(Math.random()*200-100); 4526 frm.y = Math.round(Math.random()*200-100); 4527 } 4528 else 4529 if (nextcaption.hasClass('lfr') || nextcaption.hasClass('skewfromright')) frm.x = 15+opt.width; 4530 else 4531 if (nextcaption.hasClass('lfl') || nextcaption.hasClass('skewfromleft')) frm.x = -15-imw; 4532 else 4533 if (nextcaption.hasClass('sfl') || nextcaption.hasClass('skewfromleftshort')) frm.x = -50; 4534 else 4535 if (nextcaption.hasClass('sfr') || nextcaption.hasClass('skewfromrightshort')) frm.x = 50; 4536 else 4537 if (nextcaption.hasClass('lft')) frm.y = -25 - imh; 4538 else 4539 if (nextcaption.hasClass('lfb')) frm.y = 25 + opt.height; 4540 else 4541 if (nextcaption.hasClass('sft')) frm.y = -50; 4542 else 4543 if (nextcaption.hasClass('sfb')) frm.y = 50; 4544 4545 4546 if (nextcaption.hasClass('skewfromright') || nextcaption.hasClass('skewfromrightshort')) frm.skewX = -85 4547 else 4548 if (nextcaption.hasClass('skewfromleft') || nextcaption.hasClass('skewfromleftshort')) frm.skewX = 85 4549 4550 4551 if (nextcaption.hasClass("fade") || nextcaption.hasClass('sft') || nextcaption.hasClass('sfl') || nextcaption.hasClass('sfb') || nextcaption.hasClass('skewfromleftshort') || nextcaption.hasClass('sfr') || nextcaption.hasClass('skewfromrightshort')) 4552 frm.opacity = 0; 4553 4554 // FOR SAFARI WE NEED TO REMOVE 3D ROTATIONS 4555 if (get_browser().toLowerCase()=="safari") { 4556 //frm.rotationX=0;frm.rotationY=0; 4557 } 4558
4559 var elemdelay = (nextcaption.data('elementdelay') == undefined) ? 0 : nextcaption.data('elementdelay'); 4560 endfrm.ease = frm.ease = (nextcaption.data('easing') == undefined) ? punchgs.Power1.easeInOut : nextcaption.data('easing'); 4561 4562 4563 // DISTANCES SHOULD BE RESIZED ALSO 4564 4565 frm.data = new Object(); 4566 frm.data.oldx = frm.x; 4567 frm.data.oldy = frm.y; 4568 4569 endfrm.data = new Object(); 4570 endfrm.data.oldx = endfrm.x; 4571 endfrm.data.oldy = endfrm.y; 4572 4573 frm.x = frm.x * xbw; 4574 frm.y = frm.y * xbw; 4575 4576 var newtl = new punchgs.TimelineLite(); 4577 4578 4579 if (staticdirection != 2) { 4580 // CHANGE to punchgs.TweenLite. if Yoyo and Repeat is used. Dont forget to laod the Right Tools for it !! 4581 if (nextcaption.hasClass("customin")) { 4582 if (animobject != nextcaption) 4583 tl.add(punchgs.TweenLite.set(nextcaption, { force3D:"auto",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"})); 4584 frm.visibility = "hidden"; 4585 endfrm.visibility = "visible"; 4586 endfrm.overwrite = "all"; 4587 endfrm.opacity = 1; 4588 endfrm.onComplete = animcompleted(); 4589 endfrm.delay = mdelay; 4590 endfrm.force3D="auto" 4591 4592 tl.add(newtl.staggerFromTo(animobject,mspeed,frm,endfrm,elemdelay),"frame0"); 4593 4594 } else { 4595 4596 frm.visibility = "visible"; 4597 frm.transformPerspective = 600; 4598 if (animobject != nextcaption) 4599 tl.add(punchgs.TweenLite.set(nextcaption, { force3D:"auto",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"})); 4600 4601 endfrm.visibility = "visible"; 4602 endfrm.delay = mdelay; 4603 endfrm.onComplete = animcompleted(); 4604 endfrm.opacity = 1; 4605 endfrm.force3D="auto"; 4606 if (nextcaption.hasClass("randomrotate") && animobject != nextcaption) { 4607 4608 for (var i=0;i<animobject.length;i++) { 4609 var obj =new Object(); 4610 var endobj = new Object(); 4611 jQuery.extend(obj,frm); 4612 jQuery.extend(endobj,endfrm); 4613 frm.scale = Math.random()*3+1; 4614 frm.rotation = Math.round(Math.random()*200-100); 4615 frm.x = Math.round(Math.random()*200-100); 4616 frm.y = Math.round(Math.random()*200-100); 4617 4618 if (i!=0) endobj.delay = mdelay + (i*elemdelay); 4619 4620 4621 tl.append(punchgs.TweenLite.fromTo(animobject[i],mspeed,obj,endobj),"frame0"); 4622 } 4623 4624 4625 4626 } else 4627 tl.add(newtl.staggerFromTo(animobject,mspeed,frm,endfrm,elemdelay),"frame0"); 4628 //tl.add(punchgs.TweenLite.fromTo(nextcaption,mspeed,frm,endfrm),"frame0"); 4629 } 4630 } 4631 4632 // SAVE IT TO NCAPTION BEFORE NEW STEPS WILL BE ADDED 4633 nextcaption.data('timeline',tl); 4634 4635 // FURTHER ANIMATIONS IN CASE THERE ARE MORE THAN ONE STEP IN THE ANIMATION CHAIN 4636 var frames = new Array(); 4637 if (nextcaption.data('frames')!=undefined) { 4638 var rowtext = nextcaption.data('frames'); 4639 rowtext = rowtext.replace(/\s+/g, ''); 4640 rowtext = rowtext.replace("{",""); 4641 var spframes = rowtext.split('}'); 4642 jQuery.each(spframes,function(index,spframe){ 4643 if (spframe.length>0) { 4644 var params = getAnimSteps(spframe); 4645 4646 addMoveCaption(nextcaption,opt,params,"frame"+(index+10),xbw) 4647 4648 } 4649 }) 4650 } // END OF ANIMATION STEPS 4651 4652 tl = nextcaption.data('timeline'); 4653 4654 // IF THERE IS ANY EXIT ANIM DEFINED 4655 // For Static Layers -> 1 -> In, 2-> Out 0-> Ignore -1-> Not Static 4656 if ((nextcaption.data('end')!=undefined) && (staticdirection==-1 || staticdirection==2)) { 4657 endMoveCaption(nextcaption,opt,nextcaption.data('end')/1000,frm,"frame99",xbw); 4658 } else { 4659 if (staticdirection==-1 || staticdirection==2) 4660 endMoveCaption(nextcaption,opt,999999,frm,"frame99",xbw); 4661 else 4662 endMoveCaption(nextcaption,opt,200,frm,"frame99",xbw); 4663 } 4664 4665 // SAVE THE TIMELINE IN DOM ELEMENT 4666 tl = nextcaption.data('timeline'); 4667 nextcaption.data('timeline',tl); 4668 callCaptionLoops(nextcaption,xbw); 4669 tl.resume(); 4670 } 4671 } 4672 4673 if (internrecalled) { 4674 killCaptionLoops(nextcaption); 4675 callCaptionLoops(nextcaption,xbw); 4676 4677 if (nextcaption.data('timeline') != undefined) { 4678 var tweens = nextcaption.data('timeline').getTweensOf(); 4679 jQuery.each(tweens,function(index,tween) { 4680 if (tween.vars.data != undefined) { 4681 var newx = tween.vars.data.oldx * xbw; 4682 var newy = tween.vars.data.oldy * xbw; 4683 if (tween.progress() !=1 && tween.progress()!=0) { 4684 try{ 4685 //tween.updateTo({x:newx, y:newy},true); 4686 tween.vars.x = newx; 4687 tween.vary.y = newy; 4688 } catch(e) { 4689 4690 } 4691 } else { 4692 if (tween.progress()==1) { 4693 punchgs.TweenLite.set(tween.target,{x:newx,y:newy}); 4694 } 4695 } 4696 } 4697 }) 4698 } 4699 } 4700 4701 }) 4702 4703 var bt=jQuery('body').find('#'+opt.container.attr('id')).find('.tp-bannertimer'); 4704 bt.data('opt',opt); 4705 4706 4707 4708 if (mtl != undefined) setTimeout(function() { 4709 mtl.resume(); 4710 },30); 4711 4712 } 4713 4714 4715 var get_browser = function(){ 4716 var N=navigator.appName, ua=navigator.userAgent, tem; 4717 var M=ua.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i);
4718 if(M && (tem= ua.match(/version\/([\.\d]+)/i))!= null) M[2]= tem[1]; 4719 M=M? [M[1], M[2]]: [N, navigator.appVersion, '-?']; 4720 return M[0]; 4721 } 4722 var get_browser_version = function(){ 4723 var N=navigator.appName, ua=navigator.userAgent, tem; 4724 var M=ua.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i); 4725 if(M && (tem= ua.match(/version\/([\.\d]+)/i))!= null) M[2]= tem[1]; 4726 M=M? [M[1], M[2]]: [N, navigator.appVersion, '-?']; 4727 return M[1]; 4728 } 4729 4730 ///////////////////////////////////////////////////////////////// 4731 // - CALCULATE THE RESPONSIVE SIZES OF THE CAPTIONS - // 4732 ///////////////////////////////////////////////////////////////// 4733 var calcCaptionResponsive = function(nc,opt) { 4734 if (nc.data('fsize') == undefined) nc.data('fsize',parseInt(nc.css('font-size'),0) || 0); 4735 if (nc.data('pt') == undefined) nc.data('pt',parseInt(nc.css('paddingTop'),0) || 0); 4736 if (nc.data('pb') == undefined) nc.data('pb',parseInt(nc.css('paddingBottom'),0) || 0); 4737 if (nc.data('pl') == undefined) nc.data('pl',parseInt(nc.css('paddingLeft'),0) || 0); 4738 if (nc.data('pr') == undefined) nc.data('pr',parseInt(nc.css('paddingRight'),0) || 0); 4739 4740 if (nc.data('mt') == undefined) nc.data('mt',parseInt(nc.css('marginTop'),0) || 0); 4741 if (nc.data('mb') == undefined) nc.data('mb',parseInt(nc.css('marginBottom'),0) || 0); 4742 if (nc.data('ml') == undefined) nc.data('ml',parseInt(nc.css('marginLeft'),0) || 0); 4743 if (nc.data('mr') == undefined) nc.data('mr',parseInt(nc.css('marginRight'),0) || 0); 4744 4745 if (nc.data('bt') == undefined) nc.data('bt',parseInt(nc.css('borderTopWidth'),0) || 0); 4746 if (nc.data('bb') == undefined) nc.data('bb',parseInt(nc.css('borderBottomWidth'),0) || 0); 4747 if (nc.data('bl') == undefined) nc.data('bl',parseInt(nc.css('borderLeftWidth'),0) || 0); 4748 if (nc.data('br') == undefined) nc.data('br',parseInt(nc.css('borderRightWidth'),0) || 0); 4749 4750 if (nc.data('ls') == undefined) nc.data('ls',parseInt(nc.css('letterSpacing'),0) || 0); 4751 4752 if (nc.data('lh') == undefined) nc.data('lh',parseInt(nc.css('lineHeight'),0) || "auto"); 4753 if (nc.data('minwidth') == undefined) nc.data('minwidth',parseInt(nc.css('minWidth'),0) || 0); 4754 if (nc.data('minheight') == undefined) nc.data('minheight',parseInt(nc.css('minHeight'),0) || 0); 4755 if (nc.data('maxwidth') == undefined) nc.data('maxwidth',parseInt(nc.css('maxWidth'),0) || "none"); 4756 if (nc.data('maxheight') == undefined) nc.data('maxheight',parseInt(nc.css('maxHeight'),0) || "none"); 4757 if (nc.data('wii') == undefined) nc.data('wii',parseInt(nc.css('width'),0) || 0); 4758 if (nc.data('hii') == undefined) nc.data('hii',parseInt(nc.css('height'),0) || 0); 4759 4760 if (nc.data('wan') == undefined) nc.data('wan',nc.css("-webkit-transition")); 4761 if (nc.data('moan') == undefined) nc.data('moan',nc.css("-moz-animation-transition")); 4762 if (nc.data('man') == undefined) nc.data('man',nc.css("-ms-animation-transition")); 4763 if (nc.data('ani') == undefined) nc.data('ani',nc.css("transition")); 4764 4765 4766 4767 4768 4769 if (!nc.hasClass("tp-splitted")) { 4770 4771 4772 nc.css("-webkit-transition", "none"); 4773 nc.css("-moz-transition", "none"); 4774 nc.css("-ms-transition", "none"); 4775 nc.css("transition", "none"); 4776 4777 punchgs.TweenLite.set(nc,{ 4778 fontSize: Math.round((nc.data('fsize') * opt.bw))+"px", 4779 4780 letterSpacing:Math.floor((nc.data('ls') * opt.bw))+"px", 4781 4782 paddingTop: Math.round((nc.data('pt') * opt.bh)) + "px", 4783 paddingBottom: Math.round((nc.data('pb') * opt.bh)) + "px", 4784 paddingLeft: Math.round((nc.data('pl') * opt.bw)) + "px", 4785 paddingRight: Math.round((nc.data('pr') * opt.bw)) + "px", 4786 4787 marginTop: (nc.data('mt') * opt.bh) + "px", 4788 marginBottom: (nc.data('mb') * opt.bh) + "px", 4789 marginLeft: (nc.data('ml') * opt.bw) + "px", 4790 marginRight: (nc.data('mr') * opt.bw) + "px", 4791 4792 borderTopWidth: Math.round((nc.data('bt') * opt.bh)) + "px", 4793 borderBottomWidth: Math.round((nc.data('bb') * opt.bh)) + "px", 4794 borderLeftWidth: Math.round((nc.data('bl') * opt.bw)) + "px", 4795 borderRightWidth: Math.round((nc.data('br') * opt.bw)) + "px", 4796 4797 lineHeight: Math.round((nc.data('lh') * opt.bh)) + "px", 4798 minWidth:(nc.data('minwidth') * opt.bw) + "px", 4799 minHeight:(nc.data('minheight') * opt.bh) + "px", 4800 4801 /* width:(nc.data('wii') * opt.bw) + "px", 4802 height:(nc.data('hii') * opt.bh) + "px", */ 4803 4804 overwrite:"auto" 4805 }); 4806 setTimeout(function() { 4807 nc.css("-webkit-transition", nc.data('wan')); 4808 nc.css("-moz-transition", nc.data('moan')); 4809 nc.css("-ms-transition", nc.data('man')); 4810 nc.css("transition", nc.data('ani')); 4811 4812 },30); 4813 4814 //konsole.log(nc.data('maxwidth')+" "+nc.data('maxheight')); 4815 if (nc.data('maxheight')!='none') 4816 nc.css({'maxHeight':(nc.data('maxheight') * opt.bh) + "px"}); 4817 4818 4819 if (nc.data('maxwidth')!='none') 4820 nc.css({'maxWidth':(nc.data('maxwidth') * opt.bw) + "px"}); 4821 } 4822 } 4823 4824 4825 /****************************** 4826 - CAPTION LOOPS - 4827 ********************************/ 4828 4829 4830 var callCaptionLoops = function(nextcaption,factor) { 4831 4832 // SOME LOOPING ANIMATION ON INTERNAL ELEMENTS 4833 nextcaption.find('.rs-pendulum').each(function() { 4834 var el = jQuery(this); 4835 var counter = 1; 4836 if (el.data('timeline')==undefined) { 4837 el.data('timeline',new punchgs.TimelineLite); 4838 var startdeg = el.data('startdeg')==undefined ? -20 : el.data('startdeg'), 4839 enddeg = el.data('enddeg')==undefined ? 20 : el.data('enddeg'); 4840 speed = el.data('speed')==undefined ? 2 : el.data('speed'), 4841 origin = el.data('origin')==undefined ? "50% 50%" : el.data('origin'), 4842 repeat_times = el.data('repeat-times')==undefined ? 1 : el.data('repeat-times'), 4843 easing = el.data('ease')==undefined ? punchgs.Power2.easeInOut : el.data('ease'); 4844 4845 startdeg = startdeg * factor; 4846 enddeg = enddeg * factor; 4847 4848 el.data('timeline').append(new punchgs.TweenLite.fromTo(el,speed,{force3D:"auto",rotation:startdeg,transformOrigin:origin},{rotation:enddeg,ease:easing})); 4849 el.data('timeline').append(new punchgs.TweenLite.fromTo(el,speed,{force3D:"auto",rotation:enddeg,transformOrigin:origin},{rotation:startdeg,ease:easing,onComplete:function() { 4850 if(repeat_times == -1 || counter < repeat_times) { counter++; el.data('timeline').restart(); } 4851 }})); 4852 } 4853 4854 }) 4855 4856 // SOME LOOPING ANIMATION ON INTERNAL ELEMENTS 4857 nextcaption.find('.rs-slideloop').each(function() { 4858 var el = jQuery(this); 4859 var counter = 1; 4860 if (el.data('timeline')==undefined) { 4861 el.data('timeline',new punchgs.TimelineLite); 4862 var xs = el.data('xs')==undefined ? 0 : el.data('xs'), 4863 ys = el.data('ys')==undefined ? 0 : el.data('ys'); 4864 xe = el.data('xe')==undefined ? 0 : el.data('xe'), 4865 ye = el.data('ye')==undefined ? 0 : el.data('ye'), 4866 speed = el.data('speed')==undefined ? 2 : el.data('speed'), 4867 repeat_times = el.data('repeat-times')==undefined ? 1 : el.data('repeat-times'), 4868 easing = el.data('ease')==undefined ? punchgs.Power2.easeInOut : el.data('ease'); 4869 4870 xs = xs * factor; 4871 ys = ys * factor; 4872 xe = xe * factor; 4873 ye = ye * factor; 4874 4875 el.data('timeline').append(new punchgs.TweenLite.fromTo(el,speed,{force3D:"auto",x:xs,y:ys},{x:xe,y:ye,ease:easing})); 4876 el.data('timeline').append(new punchgs.TweenLite.fromTo(el,speed,{force3D:"auto",x:xe,y:ye},{x:xs,y:ys,onComplete:function() { 4877 if(repeat_times == -1 || counter < repeat_times) { counter++; el.data('timeline').restart(); } 4878 }})); 4879 } 4880 4881 }) 4882 4883 // SOME LOOPING ANIMATION ON INTERNAL ELEMENTS 4884 nextcaption.find('.rs-pulse').each(function() { 4885 var el = jQuery(this); 4886 var counter = 1; 4887 if (el.data('timeline')==undefined) { 4888 el.data('timeline',new punchgs.TimelineLite); 4889 var zoomstart = el.data('zoomstart')==undefined ? 0 : el.data('zoomstart'),
4890 zoomend = el.data('zoomend')==undefined ? 0 : el.data('zoomend'); 4891 repeat_times = el.data('repeat-times')==undefined ? 1 : el.data('repeat-times'), 4892 speed = el.data('speed')==undefined ? 2 : el.data('speed'), 4893 easing = el.data('ease')==undefined ? punchgs.Power2.easeInOut : el.data('ease'); 4894 4895 el.data('timeline').append(new punchgs.TweenLite.fromTo(el,speed,{force3D:"auto",scale:zoomstart},{scale:zoomend,ease:easing})); 4896 el.data('timeline').append(new punchgs.TweenLite.fromTo(el,speed,{force3D:"auto",scale:zoomend},{scale:zoomstart,onComplete:function() { 4897 if(repeat_times == -1 || counter < repeat_times) { counter++; el.data('timeline').restart(); } 4898 }})); 4899 } 4900 4901 }) 4902 4903 nextcaption.find('.rs-wave').each(function() { 4904 var el = jQuery(this); 4905 var counter = 1; 4906 if (el.data('timeline')==undefined) { 4907 el.data('timeline',new punchgs.TimelineLite); 4908 4909 var angle= el.data('angle')==undefined ? 10 : el.data('angle'), 4910 radius = el.data('radius')==undefined ? 10 : el.data('radius'), 4911 speed = el.data('speed')==undefined ? -20 : el.data('speed'), 4912 repeat_times = el.data('repeat-times')==undefined ? 1 : el.data('repeat-times'), 4913 origin = el.data('origin')==undefined ? -20 : el.data('origin'); 4914 4915 angle = angle*factor; 4916 radius = radius * factor; 4917 4918 var angobj = {a:0, ang : angle, element:el, unit:radius}; 4919 4920 4921 el.data('timeline').append(new punchgs.TweenLite.fromTo(angobj,speed, 4922 { a:360 }, 4923 { a:0, 4924 force3D:"auto", 4925 ease:punchgs.Linear.easeNone, 4926 onUpdate:function() { 4927 4928 var rad = angobj.a * (Math.PI / 180); 4929 punchgs.TweenLite.to(angobj.element,0.1,{force3D:"auto",x:Math.cos(rad) * angobj.unit, y:angobj.unit * (1 - Math.sin(rad))}); 4930 4931 }, 4932 onComplete:function() { 4933 if(repeat_times == -1 || counter < repeat_times) { counter++; el.data('timeline').restart(); } 4934 } 4935 } 4936 )); 4937 } 4938 4939 }) 4940 } 4941 4942 var killCaptionLoops = function(nextcaption) { 4943 // SOME LOOPING ANIMATION ON INTERNAL ELEMENTS 4944 nextcaption.find('.rs-pendulum, .rs-slideloop, .rs-pulse, .rs-wave').each(function() { 4945 var el = jQuery(this); 4946 if (el.data('timeline')!=undefined) { 4947 el.data('timeline').pause(); 4948 el.data('timeline',null); 4949 } 4950 }); 4951 } 4952 4953 ////////////////////////// 4954 // REMOVE THE CAPTIONS // 4955 ///////////////////////// 4956 var removeTheCaptions = function(actli,opt) { 4957 4958 var removetime = 0; 4959 4960 var allcaptions = actli.find('.tp-caption'), 4961 allstaticcaptions = opt.container.find('.tp-static-layers').find('.tp-caption'); 4962 4963 4964 jQuery.each(allstaticcaptions, function(index,staticcapt) { 4965 allcaptions.push(staticcapt); 4966 }); 4967 4968 allcaptions.each(function(i) { 4969 4970 4971 4972 var staticdirection = -1; // 1 -> In, 2-> Out 0-> Ignore -1-> Not Static 4973 4974 var nextcaption=jQuery(this); 4975 if (nextcaption.hasClass("tp-static-layer")) { 4976 4977 if (nextcaption.data('startslide') == -1 || nextcaption.data('startslide') == "-1") 4978 nextcaption.data('startslide',0); 4979 4980 if (nextcaption.data('endslide') == -1 || nextcaption.data('endslide') == "-1") 4981 nextcaption.data('endslide',opt.slideamount); 4982 4983 4984 4985 // IF STATIC ITEM CURRENTLY NOT VISIBLE 4986 if (nextcaption.hasClass("tp-is-shown")) { 4987 4988 if ((nextcaption.data('startslide') > opt.next) || 4989 (nextcaption.data('endslide') < opt.next)) { 4990 staticdirection = 2; 4991 nextcaption.removeClass("tp-is-shown"); 4992 } else { 4993 staticdirection = 0; 4994 } 4995 } else { 4996 staticdirection = 2; 4997 } 4998 4999 } 5000 5001 5002 5003 if (staticdirection != 0 ) { 5004 5005 killCaptionLoops(nextcaption); 5006 5007 if (nextcaption.find('iframe').length>0) { 5008 // VIMEO VIDEO PAUSE 5009 try { 5010 var ifr = nextcaption.find('iframe'); 5011 var id = ifr.attr('id'); 5012 var froogaloop = $f(id); 5013 froogaloop.api("pause"); 5014 clearTimeout(nextcaption.data('timerplay')); 5015 } catch(e) {} 5016 //YOU TUBE PAUSE 5017 try { 5018 var player=nextcaption.data('player'); 5019 player.stopVideo(); 5020 clearTimeout(nextcaption.data('timerplay')); 5021 } catch(e) {} 5022 } 5023 5024 // IF HTML5 VIDEO IS EMBEDED 5025 if (nextcaption.find('video').length>0) { 5026 try{ 5027 nextcaption.find('video').each(function(i) { 5028 var html5vid = jQuery(this).parent(); 5029 var videoID =html5vid.attr('id'); 5030 clearTimeout(html5vid.data('timerplay')); 5031 var video = this; 5032 video.pause(); 5033 }) 5034 }catch(e) {} 5035 } // END OF VIDEO JS FUNCTIONS 5036 try { 5037 5038 //var tl = punchgs.TimelineLite.exportRoot(); 5039 var tl = nextcaption.data('timeline'); 5040 var endstarts = tl.getLabelTime("frame99"); 5041 var curtime = tl.time(); 5042 if (endstarts>curtime) { 5043 5044 // WE NEED TO STOP ALL OTHER NIMATIONS 5045 var tweens = tl.getTweensOf(nextcaption); 5046 jQuery.each(tweens,function(index,tw) { 5047 5048 if (index!=0) 5049 tw.pause(); 5050 }); 5051 if (nextcaption.css('opacity')!=0) { 5052 var spp = nextcaption.data('endspeed') == undefined ? nextcaption.data('speed') : nextcaption.data('endspeed'); 5053 if (spp>removetime) removetime =spp; 5054 tl.play("frame99"); 5055 } else 5056 tl.progress(1,false); 5057 } 5058 5059 } catch(e) {} 5060 5061 } 5062 5063 }); 5064 5065 return removetime; 5066 } 5067
5068 ////////////////////////////// 5069 // MOVE THE CAPTIONS // 5070 //////////////////////////// 5071 var addMoveCaption = function(nextcaption,opt,params,frame,downscale) { 5072 var tl = nextcaption.data('timeline'); 5073 5074 var newtl = new punchgs.TimelineLite(); 5075 5076 var animobject = nextcaption; 5077 5078 if (params.typ == "chars") animobject = nextcaption.data('mySplitText').chars; 5079 else 5080 if (params.typ == "words") animobject = nextcaption.data('mySplitText').words; 5081 else 5082 if (params.typ == "lines") animobject = nextcaption.data('mySplitText').lines; 5083 params.animation.ease = params.ease; 5084 5085 if (params.animation.rotationZ !=undefined) params.animation.rotation = params.animation.rotationZ; 5086 params.animation.data = new Object(); 5087 params.animation.data.oldx = params.animation.x; 5088 params.animation.data.oldy = params.animation.y; 5089 5090 params.animation.x = params.animation.x * downscale; 5091 params.animation.y = params.animation.y * downscale; 5092 5093 5094 tl.add(newtl.staggerTo(animobject,params.speed,params.animation,params.elementdelay),params.start); 5095 tl.addLabel(frame,params.start); 5096 5097 nextcaption.data('timeline',tl); 5098 5099 } 5100 ////////////////////////////// 5101 // MOVE OUT THE CAPTIONS // 5102 //////////////////////////// 5103 var endMoveCaption = function(nextcaption,opt,mdelay,backwards,frame,downscale) { 5104 5105 var tl = nextcaption.data('timeline'); 5106 var newtl = new punchgs.TimelineLite(); 5107 5108 var frm = newAnimObject(); 5109 var mspeed= (nextcaption.data('endspeed') == undefined) ? nextcaption.data('speed') : nextcaption.data('endspeed'); 5110 frm.ease = (nextcaption.data('endeasing') == undefined) ? punchgs.Power1.easeInOut : nextcaption.data('endeasing'); 5111 5112 mspeed = mspeed/1000; 5113 5114 5115 5116 if (nextcaption.hasClass('ltr') || 5117 nextcaption.hasClass('ltl') || 5118 nextcaption.hasClass('str') || 5119 nextcaption.hasClass('stl') || 5120 nextcaption.hasClass('ltt') || 5121 nextcaption.hasClass('ltb') || 5122 nextcaption.hasClass('stt') || 5123 nextcaption.hasClass('stb') || 5124 nextcaption.hasClass('skewtoright') || 5125 nextcaption.hasClass('skewtorightshort') || 5126 nextcaption.hasClass('skewtoleft') || 5127 nextcaption.hasClass('skewtoleftshort') || 5128 nextcaption.hasClass('fadeout') || 5129 nextcaption.hasClass("randomrotateout")) 5130 { 5131 5132 if (nextcaption.hasClass('skewtoright') || nextcaption.hasClass('skewtorightshort')) frm.skewX = 35 5133 else 5134 if (nextcaption.hasClass('skewtoleft') || nextcaption.hasClass('skewtoleftshort')) frm.skewX = -35 5135 5136 5137 if (nextcaption.hasClass('ltr') || nextcaption.hasClass('skewtoright')) 5138 frm.x=opt.width+60; 5139 else if (nextcaption.hasClass('ltl') || nextcaption.hasClass('skewtoleft')) 5140 frm.x=0-(opt.width+60); 5141 else if (nextcaption.hasClass('ltt')) 5142 frm.y=0-(opt.height+60); 5143 else if (nextcaption.hasClass('ltb')) 5144 frm.y=opt.height+60; 5145 else if (nextcaption.hasClass('str') || nextcaption.hasClass('skewtorightshort')) { 5146 frm.x=50;frm.opacity=0; 5147 } else if (nextcaption.hasClass('stl') || nextcaption.hasClass('skewtoleftshort')) { 5148 frm.x=-50;frm.opacity=0; 5149 } else if (nextcaption.hasClass('stt')) { 5150 frm.y=-50;frm.opacity=0; 5151 } else if (nextcaption.hasClass('stb')) { 5152 frm.y=50;frm.opacity=0; 5153 } else if (nextcaption.hasClass("randomrotateout")) { 5154 frm.x = Math.random()*opt.width; 5155 frm.y = Math.random()*opt.height; 5156 frm.scale = Math.random()*2+0.3; 5157 frm.rotation = Math.random()*360-180; 5158 frm.opacity = 0; 5159 } else if (nextcaption.hasClass('fadeout')) { 5160 frm.opacity = 0; 5161 } 5162 5163 if (nextcaption.hasClass('skewtorightshort')) frm.x = 270; 5164 else 5165 if (nextcaption.hasClass('skewtoleftshort')) frm.x = -270 5166 frm.data = new Object(); 5167 frm.data.oldx = frm.x; 5168 frm.data.oldy = frm.y; 5169 frm.x = frm.x * downscale; 5170 frm.y = frm.y * downscale; 5171 5172 frm.overwrite="auto"; 5173 var animobject = nextcaption; 5174 var animobject = nextcaption; 5175 if (nextcaption.data('splitout') == "chars") animobject = nextcaption.data('mySplitText').chars; 5176 else 5177 if (nextcaption.data('splitout') == "words") animobject = nextcaption.data('mySplitText').words; 5178 else 5179 if (nextcaption.data('splitout') == "lines") animobject = nextcaption.data('mySplitText').lines;
5180 var elemdelay = (nextcaption.data('endelementdelay') == undefined) ? 0 : nextcaption.data('endelementdelay'); 5181 //tl.add(punchgs.TweenLite.to(nextcaption,mspeed,frm),mdelay); 5182 tl.add(newtl.staggerTo(animobject,mspeed,frm,elemdelay),mdelay); 5183 5184 } 5185 5186 else 5187 5188 if (nextcaption.hasClass("customout")) { 5189 5190 frm = getAnimDatas(frm,nextcaption.data('customout')); 5191 var animobject = nextcaption; 5192 if (nextcaption.data('splitout') == "chars") animobject = nextcaption.data('mySplitText').chars; 5193 else 5194 if (nextcaption.data('splitout') == "words") animobject = nextcaption.data('mySplitText').words; 5195 else 5196 if (nextcaption.data('splitout') == "lines") animobject = nextcaption.data('mySplitText').lines; 5197 5198 var elemdelay = (nextcaption.data('endelementdelay') == undefined) ? 0 : nextcaption.data('endelementdelay'); 5199 frm.onStart = function() { 5200 5201 punchgs.TweenLite.set(nextcaption,{ 5202 transformPerspective:frm.transformPerspective, 5203 transformOrigin:frm.transformOrigin, 5204 overwrite:"auto" 5205 }); 5206 } 5207 5208 frm.data = new Object(); 5209 frm.data.oldx = frm.x; 5210 frm.data.oldy = frm.y; 5211 5212 frm.x = frm.x * downscale; 5213 frm.y = frm.y * downscale; 5214 5215 tl.add(newtl.staggerTo(animobject,mspeed,frm,elemdelay),mdelay); 5216 } 5217 5218 else { 5219 backwards.delay = 0; 5220 tl.add(punchgs.TweenLite.to(nextcaption,mspeed,backwards),mdelay); 5221 } 5222 5223 5224 tl.addLabel(frame,mdelay); 5225 5226 nextcaption.data('timeline',tl); 5227 } 5228 5229 /////////////////////////// 5230 // REMOVE THE LISTENERS // 5231 /////////////////////////// 5232 var removeAllListeners = function(container,opt) { 5233 container.children().each(function() { 5234 try{ jQuery(this).die('click'); } catch(e) {} 5235 try{ jQuery(this).die('mouseenter');} catch(e) {} 5236 try{ jQuery(this).die('mouseleave');} catch(e) {} 5237 try{ jQuery(this).unbind('hover');} catch(e) {} 5238 }) 5239 try{ container.die('click','mouseenter','mouseleave');} catch(e) {} 5240 clearInterval(opt.cdint); 5241 container=null; 5242 5243 5244 5245 } 5246 5247 /////////////////////////// 5248 // - countDown - // 5249 ///////////////////////// 5250 var countDown = function(container,opt) { 5251 opt.cd=0; 5252 opt.loop=0; 5253 if (opt.stopAfterLoops!=undefined && opt.stopAfterLoops>-1) 5254 opt.looptogo=opt.stopAfterLoops; 5255 else 5256 opt.looptogo=9999999; 5257 5258 if (opt.stopAtSlide!=undefined && opt.stopAtSlide>-1) 5259 opt.lastslidetoshow=opt.stopAtSlide; 5260 else 5261 opt.lastslidetoshow=999; 5262 5263 opt.stopLoop="off"; 5264 5265 if (opt.looptogo==0) opt.stopLoop="on"; 5266 5267 5268 if (opt.slideamount >1 && !(opt.stopAfterLoops==0 && opt.stopAtSlide==1) ) { 5269 var bt=container.find('.tp-bannertimer'); 5270 5271 5272 // LISTENERS //container.trigger('stoptimer'); 5273 container.on('stoptimer',function() { 5274 bt.data('tween').pause(); 5275 if (opt.hideTimerBar=="on") bt.css({visibility:"hidden"}); 5276 5277 }); 5278 container.on('starttimer',function() { 5279 if (opt.conthover!=1 && opt.videoplaying!=true && opt.width>opt.hideSliderAtLimit && opt.bannertimeronpause != true && opt.overnav !=true) 5280 if (opt.stopLoop=="on" && opt.next==opt.lastslidetoshow-1) 5281 { 5282 // NOTHING 5283 } 5284 else { 5285 bt.css({visibility:"visible"}); 5286 bt.data('tween').play(); 5287 } 5288 5289 if (opt.hideTimerBar=="on") bt.css({visibility:"hidden"}); 5290 }); 5291 container.on('restarttimer',function() { 5292 if (opt.stopLoop=="on" && opt.next==opt.lastslidetoshow-1) 5293 { 5294 // NOTHING 5295 } 5296 else { 5297 bt.css({visibility:"visible"}); 5298 bt.data('tween',punchgs.TweenLite.fromTo(bt,opt.delay/1000,{width:"0%"},{force3D:"auto",width:"100%",ease:punchgs.Linear.easeNone,onComplete:countDownNext,delay:1})); 5299 5300 } 5301 if (opt.hideTimerBar=="on") bt.css({visibility:"hidden"}); 5302 }); 5303 5304 container.on('nulltimer',function() { 5305 5306 bt.data('tween').pause(0); 5307 if (opt.hideTimerBar=="on") bt.css({visibility:"hidden"}); 5308 5309 }); 5310 5311 5312 5313 var countDownNext = function() { 5314 if (jQuery('body').find(container).length==0) { 5315 removeAllListeners(container,opt); 5316 clearInterval(opt.cdint); 5317 } 5318 5319 //STATE OF API CHANGED -> MOVE TO AIP BETTER 5320 if (container.data('conthover-changed') == 1) { 5321 opt.conthover= container.data('conthover'); 5322 container.data('conthover-changed',0); 5323 } 5324 5325 // SWAP TO NEXT BANNER 5326 opt.act=opt.next; 5327 opt.next=opt.next+1; 5328 if (opt.next>container.find('>ul >li').length-1) { 5329 opt.next=0; 5330 opt.looptogo=opt.looptogo-1; 5331 5332 if (opt.looptogo<=0) { 5333 opt.stopLoop="on"; 5334 5335 } 5336 } 5337 5338 // STOP TIMER IF NO LOOP NO MORE NEEDED. 5339 5340 if (opt.stopLoop=="on" && opt.next==opt.lastslidetoshow-1) { 5341 container.find('.tp-bannertimer').css({'visibility':'hidden'}); 5342 container.trigger('revolution.slide.onstop'); 5343 } else { 5344 bt.data('tween').restart(); 5345 } 5346 5347 // SWAP THE SLIDES 5348 swapSlide(container,opt); 5349 5350 } 5351 5352 bt.data('tween',punchgs.TweenLite.fromTo(bt,opt.delay/1000,{width:"0%"},{force3D:"auto",width:"100%",ease:punchgs.Linear.easeNone,onComplete:countDownNext,delay:1})); 5353 bt.data('opt',opt); 5354 5355 5356 container.hover( 5357 function() { 5358 5359 if (opt.onHoverStop=="on" && (!is_mobile())) { 5360 container.trigger('stoptimer'); 5361 5362 container.trigger('revolution.slide.onpause'); 5363 var nextsh = container.find('>ul >li:eq('+opt.next+') .slotholder'); 5364 nextsh.find('.defaultimg').each(function() { 5365 var dimg = jQuery(this); 5366 if (dimg.data('kenburn')!=undefined) { 5367 dimg.data('kenburn').pause(); 5368 } 5369 }); 5370 } 5371 }, 5372 function() { 5373 if (container.data('conthover')!=1) { 5374 container.trigger('revolution.slide.onresume'); 5375 container.trigger('starttimer'); 5376 5377 var nextsh = container.find('>ul >li:eq('+opt.next+') .slotholder'); 5378 nextsh.find('.defaultimg').each(function() { 5379 var dimg = jQuery(this); 5380 if (dimg.data('kenburn')!=undefined) { 5381 dimg.data('kenburn').play(); 5382 } 5383 }); 5384 } 5385 }); 5386 } 5387 } 5388 5389 5390 ////////////////// 5391 // IS MOBILE ?? // 5392 ////////////////// 5393 var is_mobile = function() { 5394 var agents = ['android', 'webos', 'iphone', 'ipad', 'blackberry','Android', 'webos', ,'iPod', 'iPhone', 'iPad', 'Blackberry', 'BlackBerry']; 5395 var ismobile=false;
5396 for(i in agents) { 5397 5398 if (navigator.userAgent.split(agents[i]).length>1) { 5399 ismobile = true; 5400 5401 } 5402 } 5403 return ismobile; 5404 } 5405 5406 5407 5408/************************************************************************** 5409 * Revolution Slider - PAN ZOOM MODULE 5410 * @version: 1.0 (03.06.2013) 5411 * @author ThemePunch 5412**************************************************************************/ 5413 5414 /*********************************************** 5415 - KEN BURN BACKGROUND FIT CALCULATOR - 5416 ***********************************************/ 5417 var calculateKenBurnScales = function(proc,sloth,opt) { 5418 var ow = sloth.data('owidth'); 5419 var oh = sloth.data('oheight'); 5420 5421 if (ow / oh > opt.width / opt.height) { 5422 var factor = (opt.container.width() /ow); 5423 var nheight = oh * factor; 5424 var hfactor = (nheight / opt.container.height())*proc; 5425 proc = proc * (100/hfactor); 5426 hfactor = 100; 5427 proc = proc; 5428 return (proc+"% "+hfactor+"%"+" 1"); 5429 } else { 5430 var factor = (opt.container.width() /ow); 5431 var nheight = oh * factor; 5432 var hfactor = (nheight / opt.container.height())*proc; 5433 return (proc+"% "+hfactor+"%"); 5434 } 5435 } 5436 5437 5438 5439 /****************************** 5440 - startKenBurn - 5441 ********************************/ 5442 var startKenBurn = function(container,opt,recalc,prepareonly) { 5443 5444 try{ 5445 var actli = container.find('>ul:first-child >li:eq('+opt.act+')'); 5446 } catch(e) { 5447 var actli=container.find('>ul:first-child >li:eq(1)'); 5448 } 5449 5450 opt.lastslide=opt.act; 5451 5452 5453 var nextli = container.find('>ul:first-child >li:eq('+opt.next+')'), 5454 nextsh = nextli.find('.slotholder'), 5455 bgps = nextsh.data('bgposition'), 5456 bgpe = nextsh.data('bgpositionend'), 5457 zos = nextsh.data('zoomstart')/100, 5458 zoe = nextsh.data('zoomend')/100, 5459 ros = nextsh.data('rotationstart'), 5460 roe = nextsh.data('rotationend'), 5461 bgfs = nextsh.data('bgfit'), 5462 bgfe = nextsh.data('bgfitend'), 5463 easeme = nextsh.data('easeme'), 5464 dur = nextsh.data('duration')/1000, 5465 bgfb = 100; 5466 5467 5468 if (bgfs==undefined) bgfs=100; 5469 if (bgfe==undefined) bgfe=100; 5470 var obgfs = bgfs, 5471 obgfe = bgfe; 5472 5473 bgfs = calculateKenBurnScales(bgfs,nextsh,opt); 5474 bgfe = calculateKenBurnScales(bgfe,nextsh,opt); 5475 bgfb = calculateKenBurnScales(100,nextsh,opt); 5476 5477 5478 if (zos==undefined) zos=1; 5479 if (zoe==undefined) zoe=1; 5480 if (ros==undefined) ros=0; 5481 if (roe==undefined) roe=0; 5482 5483 if (zos<1) zos=1; 5484 if (zoe<1) zoe=1; 5485 5486 5487 var imgobj = new Object(); 5488 imgobj.w = parseInt(bgfb.split(" ")[0],0), 5489 imgobj.h = parseInt(bgfb.split(" ")[1],0); 5490 5491 var turned = false; 5492 if (bgfb.split(" ")[2] == "1") { 5493 turned = true; 5494 } 5495 5496 nextsh.find('.defaultimg').each(function() { 5497 var defimg = jQuery(this); 5498 if (nextsh.find('.kenburnimg').length==0) 5499 nextsh.append('<div class="kenburnimg" style="position:absolute;z-index:1;width:100%;height:100%;top:0px;left:0px;"><img src="'+defimg.attr('src')+'" style="-webkit-touch-callout: none;-webkit-user-select: none;-khtml-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;position:absolute;width:'+imgobj.w+'%;height:'+imgobj.h+'%;"></div>'); 5500 else { 5501 nextsh.find('.kenburnimg img').css({width:imgobj.w+'%',height:imgobj.h+'%'}); 5502 } 5503 5504 5505 defimg.css({'background-image': 'none'}); 5506 5507 5508 var kbimg = nextsh.find('.kenburnimg img'); 5509 5510 5511 var imgs = calculateKenBurnImgPos(opt,bgps,bgfs,kbimg,turned), 5512 imge = calculateKenBurnImgPos(opt,bgpe,bgfe,kbimg,turned); 5513 5514 if (turned) { 5515 imgs.w = obgfs/100; 5516 imge.w = obgfe/100; 5517 } 5518 5519 5520 5521 if (prepareonly) { 5522 5523 punchgs.TweenLite.set(kbimg,{autoAlpha:0, 5524 transformPerspective:1200, 5525 transformOrigin:"0% 0%", 5526 top:0,left:0, 5527 scale:imgs.w, 5528 x:imgs.x, 5529 y:imgs.y}); 5530 var sx = imgs.w, 5531 ww = (sx * kbimg.width()) - opt.width, 5532 hh = (sx * kbimg.height()) - opt.height, 5533 hor = Math.abs((imgs.x / ww)*100), 5534 ver = Math.abs((imgs.y / hh)*100); 5535 if (hh==0) ver =0; 5536 if (ww == 0) hor = 0; 5537 defimg.data('bgposition',hor+"% "+ver+"%"); 5538 if (!isIE(8)) defimg.data('currotate',getRotationDegrees(kbimg)); 5539 if (!isIE(8)) defimg.data('curscale',(imgobj.w*sx)+"% "+(imgobj.h*sx+"%")); 5540 5541 nextsh.find('.kenburnimg').remove(); 5542 } 5543 else 5544 defimg.data('kenburn',punchgs.TweenLite.fromTo(kbimg,dur,{autoAlpha:1, force3D:punchgs.force3d, transformOrigin:"0% 0%", top:0,left:0, scale:imgs.w, x:imgs.x, y:imgs.y},{autoAlpha:1,rotationZ:roe,ease:easeme, x:imge.x, y:imge.y,scale:imge.w,onUpdate:function() { 5545 var sx = kbimg[0]._gsTransform.scaleX;
5546 var ww = (sx * kbimg.width()) - opt.width, 5547 hh = (sx * kbimg.height()) - opt.height, 5548 hor = Math.abs((kbimg[0]._gsTransform.x / ww)*100), 5549 ver = Math.abs((kbimg[0]._gsTransform.y / hh)*100); 5550 if (hh==0) ver =0; 5551 if (ww == 0) hor = 0; 5552 5553 defimg.data('bgposition',hor+"% "+ver+"%"); 5554 5555 if (!isIE(8)) defimg.data('currotate',getRotationDegrees(kbimg)); 5556 if (!isIE(8)) defimg.data('curscale',(imgobj.w*sx)+"% "+(imgobj.h*sx+"%")); 5557 //punchgs.TweenLite.set(defimg,{rotation:defimg.data('currotate'), backgroundPosition:defimg.data('bgposition'), backgroundSize:defimg.data('curscale')}); 5558 }})); 5559 }) 5560 } 5561 5562 /************************************************* 5563 - CALCULATE KENBURNS IMAGE POSITIONS - 5564 **************************************************/ 5565 5566 var calculateKenBurnImgPos = function(opt,bgp,bgf,img,turned) { 5567 var imgobj = new Object; 5568 5569 if (!turned) 5570 imgobj.w = parseInt(bgf.split(" ")[0],0) / 100; 5571 else 5572 imgobj.w = parseInt(bgf.split(" ")[1],0) / 100; 5573 5574 switch(bgp) { 5575 case "left top": 5576 case "top left": 5577 imgobj.x = 0; 5578 imgobj.y = 0; 5579 break; 5580 case "center top": 5581 case "top center": 5582 imgobj.x = (((0-img.width()) * imgobj.w) + parseInt(opt.width,0))/2; 5583 imgobj.y = 0; 5584 break; 5585 case "top right": 5586 case "right top": 5587 imgobj.x = ((0-img.width()) * imgobj.w) + parseInt(opt.width,0); 5588 imgobj.y = 0; 5589 5590 break; 5591 case "center left": 5592 case "left center": 5593 imgobj.x = 0; 5594 imgobj.y = (((0-img.height()) * imgobj.w) + parseInt(opt.height,0)) / 2; 5595 break; 5596 case "center center": 5597 imgobj.x = (((0-img.width()) * imgobj.w) + parseInt(opt.width,0))/2; 5598 imgobj.y = (((0-img.height()) * imgobj.w) + parseInt(opt.height,0)) / 2; 5599 5600 break; 5601 case "center right": 5602 case "right center": 5603 imgobj.x = ((0-img.width()) * imgobj.w) + parseInt(opt.width,0); 5604 imgobj.y = (((0-img.height()) * imgobj.w) + parseInt(opt.height,0)) / 2; 5605 5606 break; 5607 case "bottom left": 5608 case "left bottom": 5609 imgobj.x =0; 5610 imgobj.y = ((0-img.height()) * imgobj.w) + parseInt(opt.height,0); 5611 5612 break;
5613 case "bottom center": 5614 case "center bottom": 5615 imgobj.x = (((0-img.width()) * imgobj.w) + parseInt(opt.width,0))/2; 5616 imgobj.y = ((0-img.height()) * imgobj.w) + parseInt(opt.height,0); 5617 break; 5618 case "bottom right": 5619 case "right bottom": 5620 imgobj.x = ((0-img.width()) * imgobj.w) + parseInt(opt.width,0); 5621 imgobj.y = ((0-img.height()) * imgobj.w) + parseInt(opt.height,0); 5622 break; 5623 } 5624 5625 5626 5627 return imgobj; 5628 } 5629 5630 /****************************** 5631 - GET ROTATION DEGREES - 5632 ********************************/ 5633 var getRotationDegrees = function(obj) { 5634 var matrix = obj.css("-webkit-transform") || 5635 obj.css("-moz-transform") || 5636 obj.css("-ms-transform") || 5637 obj.css("-o-transform") || 5638 obj.css("transform"); 5639 if(matrix !== 'none') { 5640 var values = matrix.split('(')[1].split(')')[0].split(','); 5641 var a = values[0]; 5642 var b = values[1]; 5643 var angle = Math.round(Math.atan2(b, a) * (180/Math.PI)); 5644 } else { var angle = 0; } 5645 return (angle < 0) ? angle +=360 : angle; 5646 } 5647 5648 5649 /****************************** 5650 - STOP KEN BURN - 5651 ********************************/ 5652 var stopKenBurn = function(container,opt) { 5653 5654 try{ 5655 var actli = container.find('>ul:first-child >li:eq('+opt.act+')'); 5656 } catch(e) { 5657 var actli=container.find('>ul:first-child >li:eq(1)'); 5658 } 5659 5660 opt.lastslide=opt.act; 5661 5662 var nextli = container.find('>ul:first-child >li:eq('+opt.next+')'); 5663 5664 5665 var actsh = actli.find('.slotholder'); 5666 var nextsh = nextli.find('.slotholder'); 5667 5668 container.find('.defaultimg').each(function() { 5669 var defimg = jQuery(this); 5670 punchgs.TweenLite.killTweensOf(defimg,false); 5671 punchgs.TweenLite.set(defimg,{scale:1,rotationZ:0}); 5672 punchgs.TweenLite.killTweensOf(defimg.data('kenburn img'),false); 5673 if (defimg.data('kenburn') != undefined) { 5674 defimg.data('kenburn').pause(); 5675 } 5676 if (defimg.data('currotate') != undefined && defimg.data('bgposition') !=undefined && defimg.data('curscale') != undefined) 5677 punchgs.TweenLite.set(defimg,{rotation:defimg.data('currotate'), backgroundPosition:defimg.data('bgposition'), backgroundSize:defimg.data('curscale')}); 5678 if (defimg!= undefined && defimg.data('kenburn img') != undefined && defimg.data('kenburn img').length>0) punchgs.TweenLite.set(defimg.data('kenburn img'),{autoAlpha:0}); 5679 5680 }); 5681 } 5682 5683//// END OF KENBURNS EXTNESION 5684 5685 5686 5687 5688/************************************************************************** 5689 * Revolution Slider - PARALLAX MODULE 5690 * @version: 1.1 (23.06.2013) 5691 * @author ThemePunch 5692**************************************************************************/ 5693 5694 /****************************** 5695 - PARALLAX EFFECT - 5696 ********************************/ 5697 var checkForParallax = function(container,opt) { 5698 if (is_mobile() && opt.parallaxDisableOnMobile=="on") return false; 5699 5700 container.find('>ul:first-child >li').each(function() { 5701 var li = jQuery(this); 5702 for (var i = 1; i<=10;i++) 5703 li.find('.rs-parallaxlevel-'+i).each(function() { 5704 var pw = jQuery(this); 5705 pw.wrap('<div style="position:absolute;top:0px;left:0px;width:100%;height:100%;z-index:'+pw.css('zIndex')+'" class="tp-parallax-container" data-parallaxlevel="'+opt.parallaxLevels[i-1]+'"></div>'); 5706 }); 5707 }) 5708 5709 5710 5711 if (opt.parallax=="mouse" || opt.parallax=="scroll+mouse" || opt.parallax=="mouse+scroll") { 5712 5713 container.mouseenter(function(event) { 5714 var currslide = container.find('.current-sr-slide-visible'); 5715 var t = container.offset().top, 5716 l = container.offset().left, 5717 ex = (event.pageX-l), 5718 ey = (event.pageY-t); 5719 currslide.data("enterx",ex); 5720 currslide.data("entery",ey); 5721 5722 }) 5723 5724 container.on('mousemove.hoverdir, mouseleave.hoverdir',function(event) { 5725 var currslide = container.find('.current-sr-slide-visible'); 5726 switch (event.type) { 5727 5728 case "mousemove": 5729 5730 var t = container.offset().top, 5731 l = container.offset().left,
5732 mh = currslide.data("enterx"), 5733 mv = currslide.data("entery"), 5734 diffh = (mh - (event.pageX - l)), 5735 diffv = (mv - (event.pageY - t)); 5736 5737 currslide.find(".tp-parallax-container").each(function() { 5738 var pc = jQuery(this), 5739 pl = parseInt(pc.data('parallaxlevel'),0)/100, 5740 offsh = diffh * pl, 5741 offsv = diffv * pl; 5742 punchgs.TweenLite.to(pc,0.4,{force3D:"auto",x:offsh,y:offsv,ease:punchgs.Power3.easeOut,overwrite:"all"}); 5743 }) 5744 5745 break; 5746 case "mouseleave": 5747 currslide.find(".tp-parallax-container").each(function() { 5748 var pc = jQuery(this); 5749 punchgs.TweenLite.to(pc,1.5,{force3D:"auto",x:0,y:0,ease:punchgs.Power3.easeOut}); 5750 }) 5751 break; 5752 } 5753 }); 5754 5755 if (is_mobile()) 5756 window.ondeviceorientation = function(event) { 5757 var y = Math.round(event.beta || 0), 5758 x = Math.round(event.gamma || 0); 5759 5760 var currslide = container.find('.current-sr-slide-visible'); 5761 5762 5763 if (jQuery(window).width() > jQuery(window).height()){ 5764 var xx = x; 5765 x = y; 5766 y = xx; 5767 5768 } 5769 5770 var curh = 360/container.width() * x, 5771 curv = 180/container.height() * y; 5772 5773 5774 5775 5776 currslide.find(".tp-parallax-container").each(function() { 5777 var pc = jQuery(this), 5778 pl = parseInt(pc.data('parallaxlevel'),0)/100, 5779 offsh = curh * pl, 5780 offsv = curv * pl; 5781 punchgs.TweenLite.to(pc,0.2,{force3D:"auto",x:offsh,y:offsv,ease:punchgs.Power3.easeOut}); 5782 }) 5783 5784 // y: -90 -> +90, x:-180 -> +180 5785 5786 //jQuery('.logo-container').html("h:"+curh+" v:"+curv); 5787 } 5788 } 5789 if (opt.parallax=="scroll" || opt.parallax=="scroll+mouse" || opt.parallax=="mouse+scroll") { 5790 5791 jQuery(window).on('scroll',function(event) { 5792 scrollParallax(container,opt); 5793 }); 5794 } 5795 } 5796 5797 /*************************************** 5798 - SET POST OF SCROLL PARALLAX - 5799 ***************************************/ 5800 var scrollParallax = function(container,opt) { 5801 if (is_mobile() && opt.parallaxDisableOnMobile=="on") return false; 5802 var t = container.offset().top, 5803 st = jQuery(window).scrollTop(), 5804 dist = t+container.height()/2, 5805 mv = t+container.height()/2 - st, 5806 wh = jQuery(window).height()/2, 5807 diffv= wh - mv; 5808 5809 if (dist<wh) diffv = diffv - (wh-dist); 5810 var currslide = container.find('.current-sr-slide-visible'); 5811 container.find(".tp-parallax-container").each(function(i) { 5812 var pc = jQuery(this), 5813 pl = parseInt(pc.data('parallaxlevel'),0)/100, 5814 offsv = diffv * pl; 5815 pc.data('parallaxoffset',offsv); 5816 punchgs.TweenLite.to(pc,0.2,{force3D:"auto",y:offsv,ease:punchgs.Power3.easeOut}); 5817 }) 5818 5819 if (opt.parallaxBgFreeze!="on") { 5820 var pl = opt.parallaxLevels[0]/100, 5821 offsv = diffv * pl; 5822 punchgs.TweenLite.to(container,0.2,{force3D:"auto",y:offsv,ease:punchgs.Power3.easeOut}); 5823 } 5824 } 5825 5826 /************************************************************************** 5827 * Revolution Slider - THUMBNAIL MODULE 5828 * @version: 1.0 (03.06.2013) 5829 * @author ThemePunch 5830 **************************************************************************/ 5831 5832 5833 //////////////////////////////// 5834 // - CREATE THE BULLETS - // 5835 //////////////////////////////// 5836 var createThumbs = function(container,opt) { 5837 5838 var cap=container.parent(); 5839 5840 5841 5842 if (opt.navigationType=="thumb" || opt.navsecond=="both") { 5843 cap.append('<div class="thumbnail_contents"><div class="tp-bullets tp-thumbs tp-thumb-params '+opt.navigationStyle+'" ><div class="tp-mask" ><div class="tp-thumbcontainer"></div></div></div></div>'); 5844 } 5845 var bullets = cap.find('.tp-bullets.tp-thumbs .tp-mask .tp-thumbcontainer'); 5846 var bup = bullets.parent(); 5847 5848 bup.width(opt.thumbWidth*opt.thumbAmount); 5849 bup.height(opt.thumbHeight); 5850 bup.parent().width(opt.thumbWidth*opt.thumbAmount); 5851 bup.parent().height(opt.thumbHeight); 5852 5853 5854 5855 5856 container.find('>ul:first >li').each(function(i) { 5857 thumbnail_text=$(this).find('.thumbnail_text_hiden').html(); 5858 5859 5860 var li= container.find(">ul:first >li:eq("+i+")"); 5861 var bgcolor = li.find(".defaultimg").css("backgroundColor"); 5862 if (li.data('thumb') !=undefined) 5863 var src= li.data('thumb') 5864 else 5865 var src=li.find("img:first").attr('src'); 5866 5867 5868 if(src.toString().indexOf('image.php?id=') == -1){ 5869 src = '/image.php?id='+src; 5870 } 5871 bullets.append('<div class="bullet thumb" data-num='+i+' style="overflow:visible; 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>'); 5872 5873 5874 5875 if(thumbnail_text){ 5876 $(".thumbnail_contents").append('<div class="bullet_text_container" data-num='+i+'>'+thumbnail_text+'<div class="thumbnail_cont"></div></div>'); 5877 }; 5878 5879 5880 5881 var bullet= bullets.find('.bullet:first'); 5882 5883 5884 }); 5885 $(".bullet_text_container").css({"left":0}); 5886 5887 5888 $(".bullet.thumb").hover(function(){ 5889 var totalHeight = $(".tp-bullets.tp-thumbs").outerHeight() + 12; 5890 $(".bullet_text_container").css({"bottom":totalHeight}); 5891 var bullet = $(this); 5892 var bullet_id = $(this).data("num"); 5893 $(".bullet_text_container:not([data-num="+bullet_id+"])").removeClass("bullet_text_container_hover"); 5894 var thumbnail= $(".bullet_text_container[data-num="+bullet_id+"]"); 5895 if(thumbnail.hasClass('bullet_text_container_hover')) 5896 return false;
5897 thumbnail.addClass("bullet_text_container_hover"); 5898 thumbnail.css({"left":0}) ; 5899 // var pos = bullet.offset().left - thumbnail.offset().left + bullet.width() - 20- thumbnail.width(); 5900 var pos =bullet.offset().left - thumbnail.offset().left -thumbnail.outerWidth() +47 + bullet.outerWidth()/2 ; 5901 5902 5903 // pos=0; 5904 thumbnail.css({"left":pos}); 5905 $(".bullet_text_container:not([data-num="+bullet_id+"])").removeClass("bullet_text_container_hover"); 5906 }, 5907 function(){ 5908 }); 5909 $(".thumbnail_contents").mouseleave(function(e){ 5910 5911 5912 5913 5914 $(".bullet_text_container").removeClass("bullet_text_container_hover"); 5915 5916 5917 5918 }); 5919 //bullets.append('<div style="clear:both"></div>'); 5920 var minwidth=10; 5921 5922 5923 // ADD THE BULLET CLICK FUNCTION HERE 5924 bullets.find('.bullet').each(function(i) { 5925 var bul = jQuery(this); 5926 5927 if (i==opt.slideamount-1) bul.addClass('last'); 5928 if (i==0) bul.addClass('first'); 5929 bul.width(opt.thumbWidth); 5930 bul.height(opt.thumbHeight); 5931 5932 if (minwidth<bul.outerWidth(true)) minwidth=bul.outerWidth(true); 5933 bul.click(function() { 5934 if (opt.transition==0 && bul.index() != opt.act) { 5935 opt.next = bul.index(); 5936 callingNewSlide(opt,container); 5937 } 5938 }); 5939 }); 5940 5941 5942 var max=minwidth*container.find('>ul:first >li').length; 5943 5944 var thumbconwidth=bullets.parent().width(); 5945 opt.thumbWidth = minwidth; 5946 5947 5948 5949 //////////////////////// 5950 // SLIDE TO POSITION // 5951 //////////////////////// 5952 if (thumbconwidth<max) { 5953 jQuery(document).mousemove(function(e) { 5954 jQuery('body').data('mousex',e.pageX); 5955 }); 5956 5957 5958 5959 // ON MOUSE MOVE ON THE THUMBNAILS EVERYTHING SHOULD MOVE :) 5960 5961 bullets.parent().mouseenter(function() { 5962 var $this=jQuery(this); 5963 $this.addClass("over"); 5964 var offset = $this.offset(); 5965 var x = jQuery('body').data('mousex')-offset.left; 5966 var thumbconwidth=$this.width(); 5967 var minwidth=$this.find('.bullet:first').outerWidth(true); 5968 var max=minwidth*container.find('>ul:first >li').length; 5969 var diff=(max- thumbconwidth)+15; 5970 var steps = diff / thumbconwidth; 5971 x=x-30; 5972 //if (x<30) x=0; 5973 //if (x>thumbconwidth-30) x=thumbconwidth; 5974 5975 //ANIMATE TO POSITION 5976 var pos=(0-((x)*steps)); 5977 if (pos>0) pos =0; 5978 if (pos<0-max+thumbconwidth) pos=0-max+thumbconwidth; 5979 moveThumbSliderToPosition($this,pos,200); 5980 }); 5981 5982 bullets.parent().mousemove(function() { 5983 5984 var $this=jQuery(this); 5985 5986 //if (!$this.hasClass("over")) { 5987 var offset = $this.offset(); 5988 var x = jQuery('body').data('mousex')-offset.left; 5989 var thumbconwidth=$this.width(); 5990 var minwidth=$this.find('.bullet:first').outerWidth(true); 5991 var max=minwidth*container.find('>ul:first >li').length-1; 5992 var diff=(max- thumbconwidth)+15; 5993 var steps = diff / thumbconwidth; 5994 x=x-3; 5995 if (x<6) x=0; 5996 if (x+3>thumbconwidth-6) x=thumbconwidth; 5997 5998 //ANIMATE TO POSITION 5999 var pos=(0-((x)*steps)); 6000 if (pos>0) pos =0; 6001 if (pos<0-max+thumbconwidth) pos=0-max+thumbconwidth; 6002 moveThumbSliderToPosition($this,pos,0); 6003 //} else { 6004 //$this.removeClass("over"); 6005 //} 6006 6007 }); 6008 6009 bullets.parent().mouseleave(function() { 6010 var $this=jQuery(this); 6011 $this.removeClass("over"); 6012 moveSelectedThumb(container); 6013 }); 6014 } 6015 6016 6017 } 6018 6019 6020 /////////////////////////////// 6021 // SelectedThumbInPosition // 6022 ////////////////////////////// 6023 var moveSelectedThumb = function(container) { 6024 6025 var bullets=container.parent().find('.tp-bullets.tp-thumbs .tp-mask .tp-thumbcontainer'); 6026 var $this=bullets.parent(); 6027 var offset = $this.offset(); 6028 var minwidth=$this.find('.bullet:first').outerWidth(true); 6029 6030 var x = $this.find('.bullet.selected').index() * minwidth; 6031 var thumbconwidth=$this.width(); 6032 var minwidth=$this.find('.bullet:first').outerWidth(true); 6033 var max=minwidth*container.find('>ul:first >li').length; 6034 var diff=(max- thumbconwidth); 6035 var steps = diff / thumbconwidth; 6036 6037 //ANIMATE TO POSITION 6038 var pos=0-x; 6039 6040 if (pos>0) pos =0; 6041 if (pos<0-max+thumbconwidth) pos=0-max+thumbconwidth; 6042 if (!$this.hasClass("over")) { 6043 moveThumbSliderToPosition($this,pos,200); 6044 } 6045 } 6046 6047 6048 //////////////////////////////////// 6049 // MOVE THUMB SLIDER TO POSITION // 6050 /////////////////////////////////// 6051 var moveThumbSliderToPosition = function($this,pos,speed) { 6052 punchgs.TweenLite.to($this.find('.tp-thumbcontainer'),0.2,{force3D:"auto",left:pos,ease:punchgs.Power3.easeOut,overwrite:"auto"}); 6053 } 6054 6055 6056 6057})(jQuery); 6058 6059 6060 6061/// END OF THUMBNAIL EXTNESIONS 6062 6063 6064 6065 6066 6067 6068// SOME ERROR MESSAGES IN CASE THE PLUGIN CAN NOT BE LOADED 6069function revslider_showDoubleJqueryError(sliderID) { 6070 var errorMessage = "Revolution Slider Error: You have some jquery.js library include that c
6070omes after the revolution files js include."; 6071 errorMessage += "<br> This includes make eliminates the revolution slider libraries, and make it not work."; 6072 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."; 6073 errorMessage += "<br> 2. Find the double jquery.js include and remove it."; 6074 errorMessage = "<span style='font-size:16px;color:#BC0C06;'>" + errorMessage + "</span>" 6075 jQuery(sliderID).show().html(errorMessage); 6076} 6077 6078
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.