1 2 3/************************************************************************** 4 * jquery.themepunch.revolution.js - jQuery Plugin for Revolution Slider 5 * @version: 3.0.8 (06.08.2013) 6 * @requires jQuery v1.7 or later (tested on 1.9) 7 * @author ThemePunch 8**************************************************************************/ 9 10 11(function(jQuery,undefined){ 12 13 14 //////////////////////////////////////// 15 // THE REVOLUTION PLUGIN STARTS HERE // 16 /////////////////////////////////////// 17 18 jQuery.fn.extend({ 19 20 // OUR PLUGIN HERE :) 21 revolution: function(options) { 22 23 24 25 //////////////////////////////// 26 // SET DEFAULT VALUES OF ITEM // 27 //////////////////////////////// 28 jQuery.fn.revolution.defaults = { 29 delay:9000, 30 startheight:500, 31 startwidth:960, 32 33 hideThumbs:200, 34 35 thumbWidth:100, // Thumb With and Height and Amount (only if navigation Tyope set to thumb !) 36 thumbHeight:50, 37 thumbAmount:5, 38 39 navigationType:"bullet", // bullet, thumb, none 40 navigationArrows:"withbullet", // nextto, solo, none 41 42 navigationStyle:"round", // round,square,navbar,round-old,square-old,navbar-old, or any from the list in the docu (choose between 50+ different item), 43 44 navigationHAlign:"center", // Vertical Align top,center,bottom 45 navigationVAlign:"bottom", // Horizontal Align left,center,right 46 navigationHOffset:0, 47 navigationVOffset:20, 48 49 soloArrowLeftHalign:"left", 50 soloArrowLeftValign:"center", 51 soloArrowLeftHOffset:20, 52 soloArrowLeftVOffset:0, 53 54 soloArrowRightHalign:"right", 55 soloArrowRightValign:"center", 56 soloArrowRightHOffset:20, 57 soloArrowRightVOffset:0, 58 59 touchenabled:"on", // Enable Swipe Function : on/off 60 onHoverStop:"on", // Stop Banner Timet at Hover on Slide on/off 61 62 63 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. 64 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 65 66 hideCaptionAtLimit:0, // It Defines if a caption should be shown under a Screen Resolution ( Basod on The Width of Browser) 67 hideAllCaptionAtLilmit:0, // Hide all The Captions if Width of Browser is less then this value 68 hideSliderAtLimit:0, // Hide the whole slider, and stop also functions if Width of Browser is less than this value 69 70 shadow:1, //0 = no Shadow, 1,2,3 = 3 Different Art of Shadows (No Shadow in Fullwidth Version !) 71 fullWidth:"off", // Turns On or Off the Fullwidth Image Centering in FullWidth Modus 72 fullScreen:"off", 73 74 }; 75 76 options = jQuery.extend({}, jQuery.fn.revolution.defaults, options); 77 78 79 80 81 return this.each(function() { 82 83 var opt=options; 84 var container=jQuery(this); 85 if (!container.hasClass("revslider-initialised")) { 86 87 container.addClass("revslider-initialised"); 88 if (container.attr('id')==undefined) container.attr('id',"revslider-"+Math.round(Math.random()*1000+5)); 89 90 // CHECK IF FIREFOX 13 IS ON WAY.. IT HAS A STRANGE BUG, CSS ANIMATE SHOULD NOT BE USED 91 92 93 94 opt.firefox13 = false; 95 opt.ie = !jQuery.support.opacity; 96 opt.ie9 = (document.documentMode == 9); 97 98 99 // CHECK THE jQUERY VERSION 100 var version = jQuery.fn.jquery.split('.'), 101 versionTop = parseFloat(version[0]), 102 versionMinor = parseFloat(version[1]), 103 versionIncrement = parseFloat(version[2] || '0'); 104 105 if (versionTop==1 && versionMinor < 7) { 106 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>'); 107 } 108 109 if (versionTop>1) opt.ie=false; 110 111 112 // Delegate .transition() calls to .animate() 113 // if the browser can't do CSS transitions. 114 if (!jQuery.support.transition) 115 jQuery.fn.transition = jQuery.fn.animate; 116 117 118 119 120 jQuery.cssEase['Bounce'] = 'cubic-bezier(0,1,0.5,1.3)'; 121 122 // CATCH THE CONTAINER 123 //var container=jQuery(this); 124 //container.css({'display':'block'}); 125 126 // LOAD THE YOUTUBE API IF NECESSARY 127 128 container.find('.caption').each(function() { jQuery(this).addClass('tp-caption')}); 129 130 if (is_mobile()) { 131 container.find('.tp-caption').each(function() { 132 if (jQuery(this).data('autoplay')==true) jQuery(this).data('autoplay',false); 133 }) 134 } 135 136 137 var addedyt=0; 138 var addedvim=0; 139 var addedvid=0; 140 container.find('.tp-caption iframe').each(function(i) { 141 try { 142 143 if (jQuery(this).attr('src').indexOf('you')>0 && addedyt==0) { 144 addedyt=1; 145 var s = document.createElement("script"); 146 s.src = "http://www.youtube.com/player_api"; /* Load Player API*/ 147 var before = document.getElementsByTagName("script")[0]; 148 before.parentNode.insertBefore(s, before); 149 } 150 } catch(e) {} 151 }); 152 153 154 155 // LOAD THE VIMEO API 156 container.find('.tp-caption iframe').each(function(i) { 157 try{ 158 if (jQuery(this).attr('src').indexOf('vim')>0 && addedvim==0) { 159 addedvim=1; 160 var f = document.createElement("script"); 161 f.src = "http://a.vimeocdn.com/js/froogaloop2.min.js"; /* Load Player API*/ 162 var before = document.getElementsByTagName("script")[0]; 163 before.parentNode.insertBefore(f, before); 164 } 165 } catch(e) {} 166 }); 167 168 // LOAD THE VIDEO.JS API IF NEEDED 169 container.find('.tp-caption video').each(function(i) { 170 try{ 171 if (jQuery(this).hasClass('video-js') && addedvid==0) { 172 addedvid=1; 173 var f = document.createElement("script"); 174 f.src = opt.videoJsPath+"video.js"; /* Load Player API*/ 175 var before = document.getElementsByTagName("script")[0]; 176 before.parentNode.insertBefore(f, before); 177 jQuery('head').append('<link rel="stylesheet" type="text/css" href="'+opt.videoJsPath+'video-js.min.css" media="screen" />'); 178 jQuery('head').append('<script> videojs.options.flash.swf = "'+opt.videoJsPath+'video-js.swf";</script>'); 179 } 180 } catch(e) {} 181 }); 182 183 // SHUFFLE MODE 184 if (opt.shuffle=="on") { 185 for (var u=0;u<container.find('>ul:first-child >li').length;u++) { 186 var it = Math.round(Math.random()*container.find('>ul:first-child >li').length); 187 container.find('>ul:first-child >li:eq('+it+')').prependTo(container.find('>ul:first-child')); 188 } 189 } 190 191 192 // CREATE SOME DEFAULT OPTIONS FOR LATER 193 opt.slots=4; 194 opt.act=-1; 195 opt.next=0; 196 197 // IF START SLIDE IS SET
198 if (opt.startWithSlide !=undefined) opt.next=opt.startWithSlide; 199 200 // IF DEEPLINK HAS BEEN SET 201 var deeplink = getUrlVars("#")[0]; 202 if (deeplink.length<9) { 203 if (deeplink.split('slide').length>1) { 204 var dslide=parseInt(deeplink.split('slide')[1],0); 205 if (dslide<1) dslide=1; 206 if (dslide>container.find('>ul:first >li').length) dslide=container.find('>ul:first >li').length; 207 opt.next=dslide-1; 208 } 209 } 210 211 212 opt.origcd=opt.delay; 213 214 opt.firststart=1; 215 216 217 218 219 220 221 // BASIC OFFSET POSITIONS OF THE BULLETS 222 if (opt.navigationHOffset==undefined) opt.navOffsetHorizontal=0; 223 if (opt.navigationVOffset==undefined) opt.navOffsetVertical=0; 224 225 226 227 228 229 container.append('<div class="tp-loader"></div>'); 230 231 // RESET THE TIMER 232 if (container.find('.tp-bannertimer').length==0) container.append('<div class="tp-bannertimer" style="visibility:hidden"></div>'); 233 var bt=container.find('.tp-bannertimer'); 234 if (bt.length>0) { 235 bt.css({'width':'0%'}); 236 }; 237 238 239 // WE NEED TO ADD A BASIC CLASS FOR SETTINGS.CSS 240 container.addClass("tp-simpleresponsive"); 241 opt.container=container; 242 243 //if (container.height()==0) container.height(opt.startheight); 244 245 // AMOUNT OF THE SLIDES 246 opt.slideamount = container.find('>ul:first >li').length; 247 248 249 // A BASIC GRID MUST BE DEFINED. IF NO DEFAULT GRID EXIST THAN WE NEED A DEFAULT VALUE, ACTUAL SIZE OF CONAINER 250 if (container.height()==0) container.height(opt.startheight); 251 if (opt.startwidth==undefined || opt.startwidth==0) opt.startwidth=container.width(); 252 if (opt.startheight==undefined || opt.startheight==0) opt.startheight=container.height(); 253 254 // OPT WIDTH && HEIGHT SHOULD BE SET 255 opt.width=container.width(); 256 opt.height=container.height(); 257 258 259 // DEFAULT DEPENDECIES 260 opt.bw = opt.startwidth / container.width(); 261 opt.bh = opt.startheight / container.height(); 262 263 // IF THE ITEM ALREADY IN A RESIZED FORM 264 if (opt.width!=opt.startwidth) { 265 266 opt.height = Math.round(opt.startheight * (opt.width/opt.startwidth)); 267 container.height(opt.height); 268 269 } 270 271 // LETS SEE IF THERE IS ANY SHADOW 272 if (opt.shadow!=0) { 273 container.parent().append('<div class="tp-bannershadow tp-shadow'+opt.shadow+'"></div>'); 274 275 container.parent().find('.tp-bannershadow').css({'width':opt.width}); 276 } 277 278 279 container.find('ul').css({'display':'none'}); 280 281 282 if (opt.lazyLoad!="on") { 283 // IF IMAGES HAS BEEN LOADED 284 container.waitForImages(function() { 285 // PREPARE THE SLIDES 286 container.find('ul').css({'display':'block'}); 287 prepareSlides(container,opt); 288 289 // CREATE BULLETS 290 if (opt.slideamount >1) createBullets(container,opt); 291 if (opt.slideamount >1) createThumbs(container,opt); 292 if (opt.slideamount >1) createArrows(container,opt); 293 294 jQuery('#unvisible_button').click(function() { 295 296 opt.navigationArrows=jQuery('.selectnavarrows').val(); 297 opt.navigationType=jQuery('.selectnavtype').val(); 298 opt.navigationStyle = jQuery('.selectnavstyle').val(); 299 opt.soloArrowStyle = "default"; 300 301 jQuery('.tp-bullets').remove(); 302 jQuery('.tparrows').remove(); 303 304 if (opt.slideamount >1) createBullets(container,opt); 305 if (opt.slideamount >1) createThumbs(container,opt); 306 if (opt.slideamount >1) createArrows(container,opt); 307 308 }); 309 310 311 swipeAction(container,opt); 312 313 if (opt.hideThumbs>0) hideThumbs(container,opt); 314 315 316 container.waitForImages(function() { 317 // START THE FIRST SLIDE 318 319 container.find('.tp-loader').fadeOut(600); 320 setTimeout(function() { 321 322 swapSlide(container,opt); 323 // START COUNTDOWN 324 if (opt.slideamount >1) countDown(container,opt); 325 container.trigger('revolution.slide.onloaded'); 326 },600); 327 328 }); 329 330 331 }); 332 } else { // IF LAZY LOAD IS ACTIVATED 333 var fli = container.find('ul >li >img').first(); 334 if (fli.data('lazyload')!=undefined) fli.attr('src',fli.data('lazyload')); 335 fli.data('lazydone',1); 336 fli.parent().waitForImages(function() { 337 338 // PREPARE THE SLIDES 339 container.find('ul').css({'display':'block'}); 340 prepareSlides(container,opt); 341 342 // CREATE BULLETS 343 if (opt.slideamount >1) createBullets(container,opt); 344 if (opt.slideamount >1) createThumbs(container,opt); 345 if (opt.slideamount >1) createArrows(container,opt); 346 347 swipeAction(container,opt); 348 349 if (opt.hideThumbs>0) hideThumbs(container,opt); 350 351 fli.parent().waitForImages(function() { 352 // START THE FIRST SLIDE 353 354 container.find('.tp-loader').fadeOut(600); 355 setTimeout(function() { 356 357 swapSlide(container,opt); 358 // START COUNTDOWN 359 if (opt.slideamount >1) countDown(container,opt); 360 container.trigger('revolution.slide.onloaded'); 361 },600); 362 }); 363 }); 364 } 365 366 367 368 // IF RESIZED, NEED TO STOP ACTUAL TRANSITION AND RESIZE ACTUAL IMAGES 369 jQuery(window).resize(function() { 370 if (jQuery('body').find(container)!=0) 371 if (container.outerWidth(true)!=opt.width) { 372 containerResized(container,opt); 373 } 374 }); 375 376 377 // CHECK IF THE CAPTION IS A "SCROLL ME TO POSITION" CAPTION IS 378 //if (opt.fullScreen=="on") { 379 container.find('.tp-scrollbelowslider').on('click',function() { 380 var off=0; 381 try{ 382 off = jQuery('body').find(opt.fullScreenOffsetContainer).height(); 383 } catch(e) {} 384 try{ 385 off = off - jQuery(this).data('scrolloffset'); 386 } catch(e) {} 387 388 jQuery('body,html').animate( 389 {scrollTop:(container.offset().top+(container.find('>ul >li').height())-off)+"px"},{duration:400}); 390 }); 391 //} 392 } 393 394 }) 395 }, 396 397 398 // METHODE PAUSE 399 revscroll: function(oy) { 400 return this.each(function() { 401 var container=jQuery(this); 402 jQuery('body,html').animate( 403 {scrollTop:(container.offset().top+(container.find('>ul >li').height())-oy)+"px"},{duration:400}); 404 }) 405 }, 406 407 // METHODE PAUSE 408 revpause: function(options) { 409 410 return this.each(function() { 411 var container=jQuery(this); 412 container.data('conthover',1); 413 container.data('conthover-changed',1); 414 container.trigger('revolution.slide.onpause'); 415 var bt = container.parent().find('.tp-bannertimer'); 416 bt.stop(); 417 418 }) 419 420 421 }, 422 423 // METHODE RESUME 424 revresume: function(options) { 425 return this.each(function() { 426 var container=jQuery(this); 427 container.data('conthover',0); 428 container.data('conthover-changed',1); 429 container.trigger('revolution.slide.onresume'); 430 var bt = container.parent().find('.tp-bannertimer'); 431 var opt = bt.data('opt'); 432 433 bt.animate({'width':"100%"},{duration:((opt.delay-opt.cd)-100),queue:false, easing:"linear"}); 434 }) 435 436 }, 437 438 // METHODE NEXT 439 revnext: function(options) { 440 return this.each(function() { 441 // CATCH THE CONTAINER 442 var container=jQuery(this); 443 container.parent().find('.tp-rightarrow').click(); 444 445 446 }) 447 448 }, 449 450 // METHODE RESUME 451 revprev: function(options) { 452 return this.each(function() { 453 // CATCH THE CONTAINER 454 var container=jQuery(this); 455 container.parent().find('.tp-leftarrow').click(); 456 }) 457 458 }, 459 460 // METHODE LENGTH 461 revmaxslide: function(options) { 462 // CATCH THE CONTAINER 463 return jQuery(this).find('>ul:first-child >li').length; 464 }, 465 466 467 // METHODE CURRENT 468 revcurrentslide: function(options) { 469 // CATCH THE CONTAINER 470 var container=jQuery(this); 471 var bt = container.parent().find('.tp-bannertimer'); 472 var opt = bt.data('opt'); 473 return opt.act; 474 }, 475 476 // METHODE CURRENT 477 revlastslide: function(options) { 478 // CATCH THE CONTAINER 479 var container=jQuery(this); 480 var bt = container.parent().find('.tp-bannertimer'); 481 var opt = bt.data('opt'); 482 return opt.lastslide; 483 }, 484 485 486 // METHODE JUMP TO SLIDE 487 revshowslide: function(slide) { 488 return this.each(function() { 489 // CATCH THE CONTAINER 490 var container=jQuery(this); 491 container.data('showus',slide); 492 container.parent().find('.tp-rightarrow').click(); 493 }) 494 495 } 496 497 498}) 499 500 501 /////////////////////////// 502 // GET THE URL PARAMETER // 503 /////////////////////////// 504 function getUrlVars(hashdivider) 505 { 506 var vars = [], hash; 507 var hashes = window.location.href.slice(window.location.href.indexOf(hashdivider) + 1).split('_'); 508 for(var i = 0; i < hashes.length; i++) 509 { 510 hashes[i] = hashes[i].replace('%3D',"="); 511 hash = hashes[i].split('='); 512 vars.push(hash[0]); 513 vars[hash[0]] = hash[1]; 514 } 515 return vars; 516 } 517 518 ////////////////////////// 519 // CONTAINER RESIZED // 520 ///////////////////////// 521 function containerResized(container,opt) { 522 523 524 container.find('.defaultimg').each(function(i) { 525 var img = jQuery(this); 526 527
528 if ((img.data('lazyload') !=undefined && img.data('lazydone') ==1) || img.data('lazyload') ===undefined) 529 setSize(img,opt); 530 531 opt.height = Math.round(opt.startheight * (opt.width/opt.startwidth)); 532 533 container.height(opt.height); 534 535 if ((img.data('lazyload') !=undefined && img.data('lazydone') ==1) || img.data('lazyload') ===undefined) 536 setSize(img,opt); 537 538 539 try{ 540 container.parent().find('.tp-bannershadow').css({'width':opt.width}); 541 } catch(e) {} 542 543 var actsh = container.find('>ul >li:eq('+opt.act+') .slotholder'); 544 var nextsh = container.find('>ul >li:eq('+opt.next+') .slotholder'); 545 removeSlots(container,opt); 546 nextsh.find('.defaultimg').css({'opacity':0}); 547 actsh.find('.defaultimg').css({'opacity':1}); 548 549 setCaptionPositions(container,opt); 550 551 var nextli = container.find('>ul >li:eq('+opt.next+')'); 552 container.find('.tp-caption').each(function() { jQuery(this).stop(true,true);}); 553 animateTheCaptions(nextli, opt); 554 555 restartBannerTimer(opt,container); 556 557 }); 558 } 559 560 561 ////////////////// 562 // IS MOBILE ?? // 563 ////////////////// 564 function is_mobile() { 565 var agents = ['android', 'webos', 'iphone', 'ipad', 'blackberry','Android', 'webos', ,'iPod', 'iPhone', 'iPad', 'Blackberry', 'BlackBerry']; 566 var ismobile=false; 567 for(i in agents) { 568
569 if (navigator.userAgent.split(agents[i]).length>1) { 570 ismobile = true; 571 572 } 573 } 574 return ismobile; 575 } 576 577 578 //////////////////////////////// 579 // RESTART THE BANNER TIMER // 580 ////////////////////////////// 581 function restartBannerTimer(opt,container) { 582 opt.cd=0; 583 if (opt.videoplaying !=true) { 584 var bt= container.find('.tp-bannertimer'); 585 if (bt.length>0) { 586 bt.stop(); 587 bt.css({'width':'0%'}); 588 bt.animate({'width':"100%"},{duration:(opt.delay-100),queue:false, easing:"linear"}); 589 } 590 clearTimeout(opt.thumbtimer); 591 opt.thumbtimer = setTimeout(function() { 592 moveSelectedThumb(container); 593 setBulPos(container,opt); 594 },200); 595 } 596 } 597 598 //////////////////////////////// 599 // RESTART THE BANNER TIMER // 600 ////////////////////////////// 601 function killBannerTimer(opt,container) { 602 opt.cd=0; 603 604 var bt= container.find('.tp-bannertimer'); 605 if (bt.length>0) { 606 bt.stop(true,true); 607 bt.css({'width':'0%'}); 608 //bt.animate({'width':"100%"},{duration:(opt.delay-100),queue:false, easing:"linear"}); 609 } 610 clearTimeout(opt.thumbtimer); 611 612 } 613 614 function callingNewSlide(opt,container) { 615 opt.cd=0; 616 swapSlide(container,opt); 617 618 // STOP TIMER AND RESCALE IT 619 var bt= container.find('.tp-bannertimer'); 620 if (bt.length>0) { 621 bt.stop(); 622 bt.css({'width':'0%'}); 623 bt.animate({'width':"100%"},{duration:(opt.delay-100),queue:false, easing:"linear"}); 624 } 625 } 626 627 628 629 //////////////////////////////// 630 // - CREATE THE BULLETS - // 631 //////////////////////////////// 632 function createThumbs(container,opt) { 633 634 var cap=container.parent(); 635 636 if (opt.navigationType=="thumb" || opt.navsecond=="both") { 637 cap.append('<div class="tp-bullets tp-thumbs '+opt.navigationStyle+'"><div class="tp-mask"><div class="tp-thumbcontainer"></div></div></div>'); 638 } 639 var bullets = cap.find('.tp-bullets.tp-thumbs .tp-mask .tp-thumbcontainer'); 640 var bup = bullets.parent(); 641 642 bup.width(opt.thumbWidth*opt.thumbAmount); 643 bup.height(opt.thumbHeight); 644 bup.parent().width(opt.thumbWidth*opt.thumbAmount); 645 bup.parent().height(opt.thumbHeight); 646 647 container.find('>ul:first >li').each(function(i) { 648 var li= container.find(">ul:first >li:eq("+i+")"); 649 if (li.data('thumb') !=undefined) 650 var src= li.data('thumb') 651 else 652 var src=li.find("img:first").attr('src'); 653 bullets.append('<div class="bullet thumb"><img src="'+src+'"></div>'); 654 var bullet= bullets.find('.bullet:first'); 655 }); 656 //bullets.append('<div style="clear:both"></div>'); 657 var minwidth=100; 658 659 660 // ADD THE BULLET CLICK FUNCTION HERE 661 bullets.find('.bullet').each(function(i) { 662 var bul = jQuery(this); 663 664 if (i==opt.slideamount-1) bul.addClass('last'); 665 if (i==0) bul.addClass('first'); 666 bul.width(opt.thumbWidth); 667 bul.height(opt.thumbHeight); 668 if (minwidth>bul.outerWidth(true)) minwidth=bul.outerWidth(true); 669 670 bul.click(function() { 671 if (opt.transition==0 && bul.index() != opt.act) { 672 opt.next = bul.index(); 673 callingNewSlide(opt,container); 674 } 675 }); 676 }); 677 678 679 var max=minwidth*container.find('>ul:first >li').length; 680 681 var thumbconwidth=bullets.parent().width(); 682 opt.thumbWidth = minwidth; 683 684 685 686 //////////////////////// 687 // SLIDE TO POSITION // 688 //////////////////////// 689 if (thumbconwidth<max) { 690 jQuery(document).mousemove(function(e) { 691 jQuery('body').data('mousex',e.pageX); 692 }); 693 694 695 696 // ON MOUSE MOVE ON THE THUMBNAILS EVERYTHING SHOULD MOVE :) 697 698 bullets.parent().mouseenter(function() { 699 var $this=jQuery(this); 700 $this.addClass("over"); 701 var offset = $this.offset(); 702 var x = jQuery('body').data('mousex')-offset.left; 703 var thumbconwidth=$this.width(); 704 var minwidth=$this.find('.bullet:first').outerWidth(true); 705 var max=minwidth*container.find('>ul:first >li').length; 706 var diff=(max- thumbconwidth)+15; 707 var steps = diff / thumbconwidth; 708 x=x-30; 709 //if (x<30) x=0; 710 //if (x>thumbconwidth-30) x=thumbconwidth; 711 712 //ANIMATE TO POSITION 713 var pos=(0-((x)*steps)); 714 if (pos>0) pos =0; 715 if (pos<0-max+thumbconwidth) pos=0-max+thumbconwidth; 716 moveThumbSliderToPosition($this,pos,200); 717 }); 718 719 bullets.parent().mousemove(function() { 720 721 var $this=jQuery(this); 722 723 //if (!$this.hasClass("over")) { 724 var offset = $this.offset(); 725 var x = jQuery('body').data('mousex')-offset.left; 726 var thumbconwidth=$this.width(); 727 var minwidth=$this.find('.bullet:first').outerWidth(true); 728 var max=minwidth*container.find('>ul:first >li').length; 729 var diff=(max- thumbconwidth)+15; 730 var steps = diff / thumbconwidth; 731 x=x-30; 732 //if (x<30) x=0; 733 //if (x>thumbconwidth-30) x=thumbconwidth; 734 735 //ANIMATE TO POSITION 736 var pos=(0-((x)*steps)); 737 if (pos>0) pos =0; 738 if (pos<0-max+thumbconwidth) pos=0-max+thumbconwidth; 739 moveThumbSliderToPosition($this,pos,0); 740 //} else { 741 //$this.removeClass("over"); 742 //} 743 744 }); 745 746 bullets.parent().mouseleave(function() { 747 var $this=jQuery(this); 748 $this.removeClass("over"); 749 moveSelectedThumb(container); 750 }); 751 } 752 753 754 } 755 756 757 /////////////////////////////// 758 // SelectedThumbInPosition // 759 ////////////////////////////// 760 function moveSelectedThumb(container) { 761 762 var bullets=container.parent().find('.tp-bullets.tp-thumbs .tp-mask .tp-thumbcontainer'); 763 var $this=bullets.parent(); 764 var offset = $this.offset(); 765 var minwidth=$this.find('.bullet:first').outerWidth(true); 766 767 var x = $this.find('.bullet.selected').index() * minwidth; 768 var thumbconwidth=$this.width(); 769 var minwidth=$this.find('.bullet:first').outerWidth(true); 770 var max=minwidth*container.find('>ul:first >li').length; 771 var diff=(max- thumbconwidth); 772 var steps = diff / thumbconwidth; 773 774 //ANIMATE TO POSITION 775 var pos=0-x; 776 777 if (pos>0) pos =0; 778 if (pos<0-max+thumbconwidth) pos=0-max+thumbconwidth; 779 if (!$this.hasClass("over")) { 780 moveThumbSliderToPosition($this,pos,200); 781 } 782 } 783 784 785 //////////////////////////////////// 786 // MOVE THUMB SLIDER TO POSITION // 787 /////////////////////////////////// 788 function moveThumbSliderToPosition($this,pos,speed) { 789 $this.stop(); 790 $this.find('.tp-thumbcontainer').animate({'left':pos+'px'},{duration:speed,queue:false}); 791 } 792 793 794 795 //////////////////////////////// 796 // - CREATE THE BULLETS - // 797 //////////////////////////////// 798 function createBullets(container,opt) { 799 800 if (opt.navigationType=="bullet" || opt.navigationType=="both") { 801 container.parent().append('<div class="tp-bullets simplebullets '+opt.navigationStyle+'"></div>'); 802 } 803 804 805 var bullets = container.parent().find('.tp-bullets'); 806 807 container.find('>ul:first >li').each(function(i) { 808 var src=container.find(">ul:first >li:eq("+i+") img:first").attr('src'); 809 bullets.append('<div class="bullet"></div>'); 810 var bullet= bullets.find('.bullet:first'); 811 812 813 }); 814 815 // ADD THE BULLET CLICK FUNCTION HERE 816 bullets.find('.bullet').each(function(i) { 817 var bul = jQuery(this); 818 if (i==opt.slideamount-1) bul.addClass('last'); 819 if (i==0) bul.addClass('first'); 820 821 bul.click(function() { 822 var sameslide = false;
823 if (opt.navigationArrows=="withbullet" || opt.navigationArrows=="nexttobullets") { 824 if (bul.index()-1 == opt.act) sameslide=true; 825 } else { 826 if (bul.index() == opt.act) sameslide=true; 827 } 828 829 if (opt.transition==0 && !sameslide) { 830 831 if (opt.navigationArrows=="withbullet" || opt.navigationArrows=="nexttobullets") { 832 opt.next = bul.index()-1; 833 } else { 834 opt.next = bul.index(); 835 } 836 837 callingNewSlide(opt,container); 838 } 839 }); 840 841 }); 842 843 bullets.append('<div class="tpclear"></div>'); 844 845 846 847 setBulPos(container,opt); 848 849 850 851 852 853 } 854 855 ////////////////////// 856 // CREATE ARROWS // 857 ///////////////////// 858 function createArrows(container,opt) { 859 860 var bullets = container.find('.tp-bullets'); 861 862 var hidden=""; 863 var arst= opt.navigationStyle; 864 if (opt.navigationArrows=="none") hidden="visibility:none"; 865 opt.soloArrowStyle = "default"; 866 867 if (opt.navigationArrows!="none" && opt.navigationArrows!="nexttobullets") arst = opt.soloArrowStyle; 868 869 container.parent().append('<div style="'+hidden+'" class="tp-leftarrow tparrows '+arst+'"></div>'); 870 container.parent().append('<div style="'+hidden+'" class="tp-rightarrow tparrows '+arst+'"></div>'); 871 872 // THE LEFT / RIGHT BUTTON CLICK ! // 873 container.parent().find('.tp-rightarrow').click(function() { 874 875 if (opt.transition==0) { 876 if (container.data('showus') !=undefined && container.data('showus') != -1) 877 opt.next = container.data('showus')-1; 878 else 879 opt.next = opt.next+1; 880 container.data('showus',-1); 881 if (opt.next >= opt.slideamount) opt.next=0; 882 if (opt.next<0) opt.next=0; 883 884 if (opt.act !=opt.next) 885 callingNewSlide(opt,container); 886 } 887 }); 888 889 container.parent().find('.tp-leftarrow').click(function() { 890 if (opt.transition==0) { 891 opt.next = opt.next-1; 892 opt.leftarrowpressed=1; 893 if (opt.next < 0) opt.next=opt.slideamount-1; 894 callingNewSlide(opt,container); 895 } 896 }); 897 898 setBulPos(container,opt); 899 900 } 901 902 //////////////////////////// 903 // SET THE SWIPE FUNCTION // 904 //////////////////////////// 905 function swipeAction(container,opt) { 906 // TOUCH ENABLED SCROLL 907 908 if (opt.touchenabled=="on") 909 container.swipe( {data:container, 910 swipeRight:function() 911 { 912 913 if (opt.transition==0) { 914 opt.next = opt.next-1; 915 opt.leftarrowpressed=1; 916 if (opt.next < 0) opt.next=opt.slideamount-1; 917 callingNewSlide(opt,container); 918 } 919 }, 920 swipeLeft:function() 921 { 922 923 if (opt.transition==0) { 924 opt.next = opt.next+1; 925 if (opt.next == opt.slideamount) opt.next=0; 926 callingNewSlide(opt,container); 927 } 928 }, 929 allowPageScroll:"auto"} ); 930 } 931 932 933 934 935 //////////////////////////////////////////////////////////////// 936 // SHOW AND HIDE THE THUMBS IF MOUE GOES OUT OF THE BANNER /// 937 ////////////////////////////////////////////////////////////// 938 function hideThumbs(container,opt) { 939 940 var bullets = container.parent().find('.tp-bullets'); 941 var ca = container.parent().find('.tparrows'); 942 943 if (bullets==null) { 944 container.append('<div class=".tp-bullets"></div>'); 945 var bullets = container.parent().find('.tp-bullets'); 946 } 947 948 if (ca==null) { 949 container.append('<div class=".tparrows"></div>'); 950 var ca = container.parent().find('.tparrows'); 951 } 952 953 954 //var bp = (thumbs.parent().outerHeight(true) - opt.height)/2; 955 956 // ADD THUMBNAIL IMAGES FOR THE BULLETS // 957 container.data('hidethumbs',opt.hideThumbs); 958 959 bullets.addClass("hidebullets"); 960 ca.addClass("hidearrows"); 961 962 bullets.hover(function() { 963 bullets.addClass("hovered"); 964 clearTimeout(container.data('hidethumbs')); 965 bullets.removeClass("hidebullets"); 966 ca.removeClass("hidearrows"); 967 }, 968 function() { 969 970 bullets.removeClass("hovered"); 971 if (!container.hasClass("hovered") && !bullets.hasClass("hovered")) 972 container.data('hidethumbs', setTimeout(function() { 973 bullets.addClass("hidebullets"); 974 ca.addClass("hidearrows"); 975 },opt.hideThumbs)); 976 }); 977 978 979 ca.hover(function() { 980 bullets.addClass("hovered"); 981 clearTimeout(container.data('hidethumbs')); 982 bullets.removeClass("hidebullets"); 983 ca.removeClass("hidearrows"); 984 985 }, 986 function() { 987 988 bullets.removeClass("hovered"); 989 /*if (!container.hasClass("hovered") && !bullets.hasClass("hovered")) 990 container.data('hidethumbs', setTimeout(function() { 991 bullets.addClass("hidebullets"); 992 ca.addClass("hidearrows"); 993 },opt.hideThumbs));*/ 994 }); 995 996 997 998 container.on('mouseenter', function() { 999 container.addClass("hovered"); 1000 clearTimeout(container.data('hidethumbs')); 1001 bullets.removeClass("hidebullets"); 1002 ca.removeClass("hidearrows"); 1003 }); 1004 1005 container.on('mouseleave', function() { 1006 container.removeClass("hovered"); 1007 if (!container.hasClass("hovered") && !bullets.hasClass("hovered")) 1008 container.data('hidethumbs', setTimeout(function() { 1009 bullets.addClass("hidebullets"); 1010 ca.addClass("hidearrows"); 1011 },opt.hideThumbs)); 1012 }); 1013 1014 } 1015 1016 1017 1018 1019 1020 1021 1022 ////////////////////////////// 1023 // SET POSITION OF BULLETS // 1024 ////////////////////////////// 1025 function setBulPos(container,opt) { 1026 var topcont=container.parent(); 1027 var bullets=topcont.find('.tp-bullets'); 1028 var tl = topcont.find('.tp-leftarrow'); 1029 var tr = topcont.find('.tp-rightarrow'); 1030 1031 if (opt.navigationType=="thumb" && opt.navigationArrows=="nexttobullets") opt.navigationArrows="solo"; 1032 // IM CASE WE HAVE NAVIGATION BULLETS TOGETHER WITH ARROWS 1033 if (opt.navigationArrows=="nexttobullets") {
1034 tl.prependTo(bullets).css({'float':'left'}); 1035 tr.insertBefore(bullets.find('.tpclear')).css({'float':'left'}); 1036 } 1037 1038 1039 if (opt.navigationArrows!="none" && opt.navigationArrows!="nexttobullets") { 1040 1041 tl.css({'position':'absolute'}); 1042 tr.css({'position':'absolute'}); 1043 1044 if (opt.soloArrowLeftValign=="center") tl.css({'top':'50%','marginTop':(opt.soloArrowLeftVOffset-Math.round(tl.innerHeight()/2))+"px"}); 1045 if (opt.soloArrowLeftValign=="bottom") tl.css({'top':'auto','bottom':(0+opt.soloArrowLeftVOffset)+"px"}); 1046 if (opt.soloArrowLeftValign=="top") tl.css({'bottom':'auto','top':(0+opt.soloArrowLeftVOffset)+"px"}); 1047 if (opt.soloArrowLeftHalign=="center") tl.css({'left':'50%','marginLeft':(opt.soloArrowLeftHOffset-Math.round(tl.innerWidth()/2))+"px"}); 1048 if (opt.soloArrowLeftHalign=="left") tl.css({'left':(0+opt.soloArrowLeftHOffset)+"px"}); 1049 if (opt.soloArrowLeftHalign=="right") tl.css({'right':(0+opt.soloArrowLeftHOffset)+"px"}); 1050 1051 if (opt.soloArrowRightValign=="center") tr.css({'top':'50%','marginTop':(opt.soloArrowRightVOffset-Math.round(tr.innerHeight()/2))+"px"}); 1052 if (opt.soloArrowRightValign=="bottom") tr.css({'top':'auto','bottom':(0+opt.soloArrowRightVOffset)+"px"}); 1053 if (opt.soloArrowRightValign=="top") tr.css({'bottom':'auto','top':(0+opt.soloArrowRightVOffset)+"px"}); 1054 if (opt.soloArrowRightHalign=="center") tr.css({'left':'50%','marginLeft':(opt.soloArrowRightHOffset-Math.round(tr.innerWidth()/2))+"px"}); 1055 if (opt.soloArrowRightHalign=="left") tr.css({'left':(0+opt.soloArrowRightHOffset)+"px"}); 1056 if (opt.soloArrowRightHalign=="right") tr.css({'right':(0+opt.soloArrowRightHOffset)+"px"}); 1057 1058 1059 if (tl.position()!=null) 1060 tl.css({'top':Math.round(parseInt(tl.position().top,0))+"px"}); 1061 1062 if (tr.position()!=null) 1063 tr.css({'top':Math.round(parseInt(tr.position().top,0))+"px"}); 1064 } 1065 1066 if (opt.navigationArrows=="none") { 1067 tl.css({'visibility':'hidden'}); 1068 tr.css({'visibility':'hidden'}); 1069 } 1070 1071 // SET THE POSITIONS OF THE BULLETS // THUMBNAILS 1072 1073 1074 if (opt.navigationVAlign=="center") bullets.css({'top':'50%','marginTop':(opt.navigationVOffset-Math.round(bullets.innerHeight()/2))+"px"}); 1075 if (opt.navigationVAlign=="bottom") bullets.css({'bottom':(0+opt.navigationVOffset)+"px"}); 1076 if (opt.navigationVAlign=="top") bullets.css({'top':(0+opt.navigationVOffset)+"px"}); 1077 1078 1079 if (opt.navigationHAlign=="center") bullets.css({'left':'50%','marginLeft':(opt.navigationHOffset-Math.round(bullets.innerWidth()/2))+"px"}); 1080 if (opt.navigationHAlign=="left") bullets.css({'left':(0+opt.navigationHOffset)+"px"}); 1081 if (opt.navigationHAlign=="right") bullets.css({'right':(0+opt.navigationHOffset)+"px"}); 1082 1083 1084 1085 } 1086 1087 1088 1089 ////////////////////////////////////////////////////////// 1090 // - SET THE IMAGE SIZE TO FIT INTO THE CONTIANER - // 1091 //////////////////////////////////////////////////////// 1092 function setSize(img,opt) { 1093 1094 1095 1096 opt.width=parseInt(opt.container.width(),0); 1097 opt.height=parseInt(opt.container.height(),0); 1098 1099 1100 opt.bw = (opt.width / opt.startwidth); 1101 1102 if (opt.fullScreen=="on") { 1103 opt.height = opt.bw * opt.startheight; 1104 } 1105 opt.bh = (opt.height / opt.startheight); 1106 1107 1108 1109 if (opt.bh>1) { 1110 opt.bh=1; 1111 opt.bw=1; 1112 } 1113 1114 1115 // IF IMG IS ALREADY PREPARED, WE RESET THE SIZE FIRST HERE 1116 1117 if ((img.data('lazyload') !=undefined && img.data('lazydone') ==1) || img.data('lazyload') ===undefined) { 1118 if (img.data('orgw')!=undefined && img.data('orgw')!=0) { 1119 img.width(img.data('orgw')); 1120 img.height(img.data('orgh')); 1121 } 1122 } 1123 1124 var fw = opt.width / img.width(); 1125 var fh = opt.height / img.height(); 1126 1127 1128 opt.fw = fw; 1129 opt.fh = fh; 1130 1131 1132 if ((img.data('lazyload') !=undefined && img.data('lazydone') ==1) || img.data('lazyload') ===undefined) { 1133 if (img.data('orgw')==undefined || img.data('orgw')==0) { 1134 1135 1136 img.data('orgw',img.width()); 1137 img.data('orgh',img.height()); 1138 1139 } 1140 } 1141 1142 1143 1144 1145 if (opt.fullWidth=="on" && opt.fullScreen!="on") { 1146 1147 var cow = opt.container.parent().width(); 1148 var coh = opt.container.parent().height(); 1149 var ffh = coh / img.data('orgh'); 1150 var ffw = cow / img.data('orgw'); 1151 1152
1153 if ((img.data('lazyload') !=undefined && img.data('lazydone') ==1) || img.data('lazyload') ===undefined) { 1154 img.width(img.width()*ffh); 1155 img.height(coh); 1156 } 1157 1158 if (img.width()<cow) { 1159 img.width(cow+50); 1160 var ffw = img.width() / img.data('orgw'); 1161 img.height(img.data('orgh')*ffw); 1162 1163 } 1164 1165 if (img.width()>cow) { 1166 img.data("fxof",(cow/2 - img.width()/2)); 1167 img.css({'position':'absolute','left':img.data('fxof')+"px"}); 1168 1169 } 1170 1171 1172 if (img.height()<=coh) { 1173 img.data('fyof',0); 1174 img.data("fxof",(cow/2 - img.width()/2)); 1175 img.css({'position':'absolute','top':img.data('fyof')+"px",'left':img.data('fxof')+"px"}); 1176 1177 } 1178 1179 1180 if (img.height()>coh && img.data('fullwidthcentering')=="on") { 1181 img.data('fyof',(coh/2 - img.height()/2)); 1182 img.data("fxof",(cow/2 - img.width()/2)); 1183 img.css({'position':'absolute','top':img.data('fyof')+"px",'left':img.data('fxof')+"px"}); 1184 1185 } 1186 1187 1188 1189 } else 1190 1191 if (opt.fullScreen=="on") { 1192 1193 var cow = opt.container.parent().width(); 1194 1195 1196 var coh = jQuery(window).height(); 1197 1198 // IF THE DEFAULT GRID IS HIGHER THEN THE CALCULATED SLIDER HEIGHT, WE NEED TO RESIZE THE SLIDER HEIGHT 1199 var offsety = coh/2 - (opt.startheight*opt.bh)/2; 1200 if (offsety<0) coh=opt.startheight*opt.bh; 1201 1202 1203 if (opt.fullScreenOffsetContainer!=undefined) { 1204 try{ 1205 coh = coh - jQuery(opt.fullScreenOffsetContainer).outerHeight(true); 1206 } catch(e) {} 1207 } 1208 1209 1210 opt.container.parent().height(coh); 1211 opt.container.css({'height':'100%'}); 1212 1213 opt.height=coh; 1214 1215 1216 var ffh = coh / img.data('orgh'); 1217 var ffw = cow / img.data('orgw'); 1218 1219 1220 if ((img.data('lazyload') !=undefined && img.data('lazydone') ==1) || img.data('lazyload') ===undefined) { 1221 img.width(img.width()*ffh); 1222 img.height(coh); 1223 } 1224 1225 1226 if (img.width()<cow) { 1227 img.width(cow+50); 1228 var ffw = img.width() / img.data('orgw'); 1229 img.height(img.data('orgh')*ffw); 1230 1231 } 1232 1233 if (img.width()>cow) { 1234 img.data("fxof",(cow/2 - img.width()/2)); 1235 img.css({'position':'absolute','left':img.data('fxof')+"px"}); 1236 1237 } 1238 1239 1240 if (img.height()<=coh) { 1241 img.data('fyof',0); 1242 img.data("fxof",(cow/2 - img.width()/2)); 1243 img.css({'position':'absolute','top':img.data('fyof')+"px",'left':img.data('fxof')+"px"}); 1244 1245 } 1246 1247 1248 if (img.height()>coh && img.data('fullwidthcentering')=="on") { 1249 img.data('fyof',(coh/2 - img.height()/2)); 1250 img.data("fxof",(cow/2 - img.width()/2)); 1251 img.css({'position':'absolute','top':img.data('fyof')+"px",'left':img.data('fxof')+"px"}); 1252 1253 } 1254 1255 1256 1257 1258 } else { 1259 if ((img.data('lazyload') !=undefined && img.data('lazydone') ==1) || img.data('lazyload') ===undefined) { 1260 img.width(opt.width); 1261 img.height(img.height()*fw); 1262 } 1263 1264 if (img.height()<opt.height && img.height()!=0 && img.height()!=null) { 1265 1266 if ((img.data('lazyload') !=undefined && img.data('lazydone') ==1) || img.data('lazyload') ===undefined) { 1267 img.height(opt.height); 1268 img.width(img.data('orgw')*fh); 1269 } 1270 } 1271 1272 1273 } 1274 1275 1276 1277 1278 1279 if ((img.data('lazyload') !=undefined && img.data('lazydone') ==1) || img.data('lazyload') ===undefined) { 1280 1281 img.data('neww',img.width()); 1282 img.data('newh',img.height()); 1283 } 1284 1285 if (opt.fullWidth=="on") { 1286 opt.slotw=Math.ceil(img.width()/opt.slots); 1287 } else { 1288 opt.slotw=Math.ceil(opt.width/opt.slots); 1289 } 1290 1291 if (opt.fullSreen=="on") 1292 opt.sloth=Math.ceil(jQuery(window).height()/opt.slots); 1293 else 1294 opt.sloth=Math.ceil(opt.height/opt.slots); 1295 1296 } 1297 1298 1299 1300 1301 ///////////////////////////////////////// 1302 // - PREPARE THE SLIDES / SLOTS - // 1303 /////////////////////////////////////// 1304 function prepareSlides(container,opt) { 1305 1306 container.find('.tp-caption').each(function() { jQuery(this).addClass(jQuery(this).data('transition')); jQuery(this).addClass('start') }); 1307 // PREPARE THE UL CONTAINER TO HAVEING MAX HEIGHT AND HEIGHT FOR ANY SITUATION 1308 container.find('>ul:first').css({overflow:'hidden',width:'100%',height:'100%',maxHeight:container.parent().css('maxHeight')}); 1309 1310 container.find('>ul:first >li').each(function(j) { 1311 var li=jQuery(this); 1312 1313 // MAKE LI OVERFLOW HIDDEN FOR FURTHER ISSUES 1314 li.css({'width':'100%','height':'100%','overflow':'hidden'}); 1315 1316 if (li.data('link')!=undefined) { 1317 var link = li.data('link'); 1318 var target="_self"; 1319 var zindex=2; 1320 if (li.data('slideindex')=="back") zindex=0; 1321 1322 var linktoslide=li.data('linktoslide'); 1323 if (li.data('target')!=undefined) target=li.data('target'); 1324 1325 if (link=="slide") { 1326 li.append('<div class="tp-caption sft slidelink" style="z-index:'+zindex+';" data-x="0" data-y="0" data-linktoslide="'+linktoslide+'" data-start="0"><a><div></div></a></div>'); 1327 } else { 1328 linktoslide="no"; 1329 li.append('<div class="tp-caption sft slidelink" style="z-index:'+zindex+';" data-x="0" data-y="0" data-linktoslide="'+linktoslide+'" data-start="0"><a target="'+target+'" href="'+link+'"><div></div></a></div>'); 1330 } 1331 1332 } 1333 }); 1334 1335 // RESOLVE OVERFLOW HIDDEN OF MAIN CONTAINER 1336 container.parent().css({'overflow':'visible'}); 1337 1338 1339 container.find('>ul:first >li >img').each(function(j) { 1340 1341 var img=jQuery(this); 1342 img.addClass('defaultimg'); 1343 if (img.data('lazyload')!=undefined && img.data('lazydone') != 1) { 1344 1345 } else { 1346 1347 setSize(img,opt); 1348 1349 setSize(img,opt); 1350 } 1351 img.wrap('<div class="slotholder"></div>'); 1352 img.css({'opacity':0}); 1353 img.data('li-id',j); 1354 1355 }); 1356 } 1357 1358 1359 /////////////////////// 1360 // PREPARE THE SLIDE // 1361 ////////////////////// 1362 function prepareOneSlide(slotholder,opt,visible) { 1363 1364 var sh=slotholder; 1365 var img = sh.find('img') 1366 1367 setSize(img,opt) 1368 var src = img.attr('src'); 1369 var bgcolor=img.css('background-color'); 1370 1371 var w = img.data('neww'); 1372 var h = img.data('newh'); 1373 var fulloff = img.data("fxof"); 1374 if (fulloff==undefined) fulloff=0; 1375 1376 var fullyoff=img.data("fyof"); 1377 if (img.data('fullwidthcentering')!="on" || fullyoff==undefined) fullyoff=0; 1378 1379 var off=0; 1380 1381 1382 if (!visible) 1383 var off=0-opt.slotw; 1384 1385 for (var i=0;i<opt.slots;i++) 1386 sh.append('<div class="slot" style="position:absolute;top:'+(0+fullyoff)+'px;
1386left:'+(fulloff+i*opt.slotw)+'px;overflow:hidden;width:'+opt.slotw+'px;height:'+h+'px"><div class="slotslide" style="position:absolute;top:0px;left:'+off+'px;width:'+opt.slotw+'px;height:'+h+'px;overflow:hidden;"><img style="background-color:'+bgcolor+';position:absolute;top:0px;left:'+(0-(i*opt.slotw))+'px;width:'+w+'px;height:'+h+'px" src="'+src+'"></div></div>'); 1387 1388 } 1389 1390 1391 /////////////////////// 1392 // PREPARE THE SLIDE // 1393 ////////////////////// 1394 function prepareOneSlideV(slotholder,opt,visible) { 1395 1396 var sh=slotholder; 1397 var img = sh.find('img') 1398 1399 setSize(img,opt) 1400 var src = img.attr('src'); 1401 var bgcolor=img.css('background-color'); 1402 var w = img.data('neww'); 1403 var h = img.data('newh'); 1404 var fulloff = img.data("fxof"); 1405 if (fulloff==undefined) fulloff=0; 1406 1407 var fullyoff=img.data("fyof"); 1408 if (img.data('fullwidthcentering')!="on" || fullyoff==undefined) fullyoff=0; 1409 1410 var off=0; 1411 1412 1413 1414 if (!visible) 1415 var off=0-opt.sloth; 1416 1417 //alert(fullyoff+" "+opt.sloth+" "opt.slots+" "+) 1418 1419 for (var i=0;i<opt.slots+2;i++) 1420 sh.append('<div class="slot" style="position:absolute;'+ 1421 'top:'+(fullyoff+(i*opt.sloth))+'px;'+ 1422 'left:'+(fulloff)+'px;'+ 1423 'overflow:hidden;'+ 1424 'width:'+w+'px;'+ 1425 'height:'+(opt.sloth)+'px"'+ 1426 '><div class="slotslide" style="position:absolute;'+ 1427 'top:'+(off)+'px;'+ 1428 'left:0px;width:'+w+'px;'+ 1429 'height:'+opt.sloth+'px;'+ 1430 'overflow:hidden;"><img style="position:absolute;'+ 1431 'background-color:'+bgcolor+';'+ 1432 'top:'+(0-(i*opt.sloth))+'px;'+ 1433 'left:0px;width:'+w+'px;'+ 1434 'height:'+h+'px" src="'+src+'"></div></div>'); 1435 1436 } 1437 1438 1439 /////////////////////// 1440 // PREPARE THE SLIDE // 1441 ////////////////////// 1442 function prepareOneSlideBox(slotholder,opt,visible) { 1443 1444 var sh=slotholder; 1445 var img = sh.find('img'); 1446 1447 setSize(img,opt) 1448 var src = img.attr('src'); 1449 var bgcolor=img.css('background-color'); 1450 1451 var w = img.data('neww'); 1452 var h = img.data('newh'); 1453 var fulloff = img.data("fxof"); 1454 if (fulloff==undefined) fulloff=0; 1455 1456 var fullyoff=img.data("fyof"); 1457 if (img.data('fullwidthcentering')!="on" || fullyoff==undefined) fullyoff=0; 1458 1459 1460 1461 var off=0; 1462 1463 1464 1465 1466 // SET THE MINIMAL SIZE OF A BOX 1467 var basicsize = 0; 1468 if (opt.sloth>opt.slotw) 1469 basicsize=opt.sloth 1470 else 1471 basicsize=opt.slotw; 1472 1473 1474 if (!visible) { 1475 var off=0-basicsize; 1476 } 1477 1478 opt.slotw = basicsize; 1479 opt.sloth = basicsize; 1480 var x=0; 1481 var y=0; 1482 1483 1484 1485 for (var j=0;j<opt.slots;j++) { 1486 1487 y=0; 1488 for (var i=0;i<opt.slots;i++) { 1489 1490 1491 sh.append('<div class="slot" '+ 1492 'style="position:absolute;'+ 1493 'top:'+(fullyoff+y)+'px;'+ 1494 'left:'+(fulloff+x)+'px;'+ 1495 'width:'+basicsize+'px;'+ 1496 'height:'+basicsize+'px;'+ 1497 'overflow:hidden;">'+ 1498 1499 '<div class="slotslide" data-x="'+x+'" data-y="'+y+'" '+ 1500 'style="position:absolute;'+ 1501 'top:'+(0)+'px;'+ 1502 'left:'+(0)+'px;'+ 1503 'width:'+basicsize+'px;'+ 1504 'height:'+basicsize+'px;'+ 1505 'overflow:hidden;">'+ 1506 1507 '<img style="position:absolute;'+ 1508 'top:'+(0-y)+'px;'+ 1509 'left:'+(0-x)+'px;'+ 1510 'width:'+w+'px;'+ 1511 'height:'+h+'px'+ 1512 'background-color:'+bgcolor+';"'+ 1513 'src="'+src+'"></div></div>'); 1514 y=y+basicsize; 1515 } 1516 x=x+basicsize; 1517 } 1518 } 1519 1520 1521 1522 1523 1524 /////////////////////// 1525 // REMOVE SLOTS // 1526 ///////////////////// 1527 function removeSlots(container,opt,time) { 1528 if (time==undefined) 1529 time==80 1530 1531 setTimeout(function() { 1532 container.find('.slotholder .slot').each(function() { 1533 clearTimeout(jQuery(this).data('tout')); 1534 jQuery(this).remove(); 1535 }); 1536 opt.transition = 0; 1537 },time); 1538 } 1539 1540 1541 //////////////////////// 1542 // CAPTION POSITION // 1543 /////////////////////// 1544 function setCaptionPositions(container,opt) { 1545 1546 // FIND THE RIGHT CAPTIONS 1547 var actli = container.find('>li:eq('+opt.act+')'); 1548 var nextli = container.find('>li:eq('+opt.next+')'); 1549 1550 // SET THE NEXT CAPTION AND REMOVE THE LAST CAPTION 1551 var nextcaption=nextli.find('.tp-caption'); 1552 1553 if (nextcaption.find('iframe')==0) { 1554 1555 // MOVE THE CAPTIONS TO THE RIGHT POSITION 1556 if (nextcaption.hasClass('hcenter')) 1557 nextcaption.css({'height':opt.height+"px",'top':'0px','left':(opt.width/2 - nextcaption.outerWidth()/2)+'px'}); 1558 else 1559 if (nextcaption.hasClass('vcenter')) 1560 nextcaption.css({'width':opt.width+"px",'left':'0px','top':(opt.height/2 - nextcaption.outerHeight()/2)+'px'}); 1561 } 1562 } 1563 1564 1565 ////////////////////////////// 1566 // // 1567 // - SWAP THE SLIDES - // 1568 // // 1569 //////////////////////////// 1570 function swapSlide(container,opt) { 1571 try{ 1572 var actli = container.find('>ul:first-child >li:eq('+opt.act+')'); 1573 } catch(e) { 1574 var actli=container.find('>ul:first-child >li:eq(1)'); 1575 } 1576 opt.lastslide=opt.act; 1577 var nextli = container.find('>ul:first-child >li:eq('+opt.next+')'); 1578 1579 var defimg= nextli.find('.defaultimg'); 1580
1581 if (defimg.data('lazyload') !=undefined && defimg.data('lazydone') !=1 ) { 1582 defimg.attr('src',nextli.find('.defaultimg').data('lazyload')), 1583 1584 defimg.data('orgw',0); 1585 container.find('.tp-loader').css({'display':'block'}).transition({opacity:1,duration:300}); 1586 setTimeout(function() { killBannerTimer(opt,container)},180); 1587 1588 nextli.waitForImages(function() { 1589 defimg.data('lazydone',1); 1590 setTimeout(function() {restartBannerTimer(opt,container)},190); 1591 1592 setSize(defimg,opt); 1593 setBulPos(container,opt); 1594 1595 setSize(defimg,opt); 1596 swapSlideProgress(container,opt); 1597 container.find('.tp-loader').transition({opacity:0,duration:300}); 1598 1599 setTimeout(function() { 1600 container.find('.tp-loader').css({'display':'none'}); 1601 1602 },2200) 1603 }); 1604 1605 } else { 1606 swapSlideProgress(container,opt); 1607 } 1608 } 1609 1610 1611 function swapSlideProgress(container,opt) { 1612 1613 1614 container.trigger('revolution.slide.onbeforeswap'); 1615 1616 1617 opt.transition = 1; 1618 opt.videoplaying = false; 1619 //console.log("VideoPlay set to False due swapSlideProgress"); 1620 1621 try{ 1622 var actli = container.find('>ul:first-child >li:eq('+opt.act+')'); 1623 } catch(e) { 1624 var actli=container.find('>ul:first-child >li:eq(1)'); 1625 } 1626 1627 opt.lastslide=opt.act; 1628 1629 var nextli = container.find('>ul:first-child >li:eq('+opt.next+')'); 1630 1631 var actsh = actli.find('.slotholder'); 1632 var nextsh = nextli.find('.slotholder'); 1633 actli.css({'visibility':'visible'}); 1634 nextli.css({'visibility':'visible'}); 1635 1636 if (opt.ie) { 1637 if (comingtransition=="boxfade") comingtransition = "boxslide"; 1638 if (comingtransition=="slotfade-vertical") comingtransition = "slotzoom-vertical"; 1639 if (comingtransition=="slotfade-horizontal") comingtransition = "slotzoom-horizontal"; 1640 } 1641 1642 1643 // IF DELAY HAS BEEN SET VIA THE SLIDE, WE TAKE THE NEW VALUE, OTHER WAY THE OLD ONE... 1644 if (nextli.data('delay')!=undefined) { 1645 opt.cd=0; 1646 opt.delay=nextli.data('delay'); 1647 } else { 1648 opt.delay=opt.origcd; 1649 } 1650 1651 // RESET POSITION AND FADES OF LI'S 1652 actli.css({'left':'0px','top':'0px'}); 1653 nextli.css({'left':'0px','top':'0px'}); 1654 1655 1656 // IF THERE IS AN OTHER FIRST SLIDE START HAS BEED SELECTED 1657 if (nextli.data('differentissplayed') =='prepared') { 1658 nextli.data('differentissplayed','done'); 1659 nextli.data('transition',nextli.data('savedtransition')); 1660 nextli.data('slotamount',nextli.data('savedslotamount')); 1661 nextli.data('masterspeed',nextli.data('savedmasterspeed')); 1662 } 1663 1664 1665 if (nextli.data('fstransition') != undefined && nextli.data('differentissplayed') !="done") { 1666 nextli.data('savedtransition',nextli.data('transition')); 1667 nextli.data('savedslotamount',nextli.data('slotamount')); 1668 nextli.data('savedmasterspeed',nextli.data('masterspeed')); 1669 1670 nextli.data('transition',nextli.data('fstransition')); 1671 nextli.data('slotamount',nextli.data('fsslotamount')); 1672 nextli.data('masterspeed',nextli.data('fsmasterspeed')); 1673 1674 nextli.data('differentissplayed','prepared'); 1675 } 1676 1677 /////////////////////////////////////// 1678 // TRANSITION CHOOSE - RANDOM EFFECTS// 1679 /////////////////////////////////////// 1680 var nexttrans = 0; 1681 1682 1683 var transtext = nextli.data('transition').split(","); 1684 var curtransid = nextli.data('nexttransid'); 1685 if (curtransid == undefined) { 1686 curtransid=0; 1687 nextli.data('nexttransid',curtransid); 1688 } else { 1689 curtransid=curtransid+1; 1690 if (curtransid==transtext.length) curtransid=0; 1691 nextli.data('nexttransid',curtransid); 1692 1693 } 1694 1695 1696 1697 var comingtransition = transtext[curtransid]; 1698 1699 if (comingtransition=="boxslide") nexttrans = 0 1700 else 1701 if (comingtransition=="boxfade") nexttrans = 1 1702 else 1703 if (comingtransition=="slotslide-horizontal") nexttrans = 2 1704 else 1705 if (comingtransition=="slotslide-vertical") nexttrans = 3 1706 else 1707 if (comingtransition=="curtain-1") nexttrans = 4 1708 else 1709 if (comingtransition=="curtain-2") nexttrans = 5 1710 else 1711 if (comingtransition=="curtain-3") nexttrans = 6 1712 else 1713 if (comingtransition=="slotzoom-horizontal") nexttrans = 7 1714 else 1715 if (comingtransition=="slotzoom-vertical") nexttrans = 8 1716 else 1717 if (comingtransition=="slotfade-horizontal") nexttrans = 9 1718 else
1719 if (comingtransition=="slotfade-vertical") nexttrans = 10 1720 else 1721 if (comingtransition=="fade") nexttrans = 11 1722 else 1723 if (comingtransition=="slideleft") nexttrans = 12 1724 else 1725 if (comingtransition=="slideup") nexttrans = 13 1726 else 1727 if (comingtransition=="slidedown") nexttrans = 14 1728 else 1729 if (comingtransition=="slideright") nexttrans = 15; 1730 else 1731 if (comingtransition=="papercut") nexttrans = 16; 1732 else 1733 if (comingtransition=="3dcurtain-horizontal") nexttrans = 17; 1734 else 1735 if (comingtransition=="3dcurtain-vertical") nexttrans = 18; 1736 else 1737 if (comingtransition=="cubic" || comingtransition=="cube") nexttrans = 19; 1738 else 1739 if (comingtransition=="flyin") nexttrans = 20; 1740 else 1741 if (comingtransition=="turnoff") nexttrans = 21; 1742 else { 1743 nexttrans=Math.round(Math.random()*21); 1744 nextli.data('slotamount',Math.round(Math.random()*12+4)); 1745 } 1746 1747 if (comingtransition=="random-static") { 1748 nexttrans=Math.round(Math.random()*16); 1749 if (nexttrans>15) nexttrans=15; 1750 if (nexttrans<0) nexttrans=0; 1751 } 1752 1753 if (comingtransition=="random-premium") { 1754 nexttrans=Math.round(Math.random()*6+16); 1755 if (nexttrans>21) nexttrans=21; 1756 if (nexttrans<16) nexttrans=16; 1757 } 1758 1759 1760 1761 var direction=-1; 1762 if (opt.leftarrowpressed==1 || opt.act>opt.next) direction=1; 1763 1764 if (comingtransition=="slidehorizontal") { 1765 nexttrans = 12 1766 if (opt.leftarrowpressed==1) 1767 nexttrans = 15 1768 } 1769 1770 if (comingtransition=="slidevertical") { 1771 nexttrans = 13 1772 if (opt.leftarrowpressed==1) 1773 nexttrans = 14 1774 } 1775 1776 opt.leftarrowpressed=0; 1777 1778 1779 1780 if (nexttrans>21) nexttrans = 21; 1781 if (nexttrans<0) nexttrans = 0; 1782 1783 if ((opt.ie || opt.ie9) && nexttrans >18) { 1784 nexttrans=Math.round(Math.random()*16); 1785 nextli.data('slotamount',Math.round(Math.random()*12+4)); 1786 }; 1787 if (opt.ie && (nexttrans==17 || nexttrans==16 || nexttrans==2 || nexttrans==3 || nexttrans==9 || nexttrans==10 )) nexttrans=Math.round(Math.random()*3+12); 1788 1789 1790 if (opt.ie9 && (nexttrans==3)) nexttrans = 4; 1791 1792 1793 1794 1795 //jQuery('body').find('.debug').html("Transition:"+nextli.data('transition')+" id:"+nexttrans); 1796 1797 // DEFINE THE MASTERSPEED FOR THE SLIDE // 1798 var masterspeed=300; 1799 if (nextli.data('masterspeed')!=undefined && nextli.data('masterspeed')>99 && nextli.data('masterspeed')<4001) 1800 masterspeed = nextli.data('masterspeed'); 1801 1802 1803 1804 ///////////////////////////////////////////// 1805 // SET THE BULLETS SELECTED OR UNSELECTED // 1806 ///////////////////////////////////////////// 1807 1808 1809 container.parent().find(".bullet").each(function() { 1810 var bul = jQuery(this); 1811 bul.removeClass("selected"); 1812 1813 1814 if (opt.navigationArrows=="withbullet" || opt.navigationArrows=="nexttobullets") { 1815 if (bul.index()-1 == opt.next) bul.addClass('selected'); 1816 1817 } else { 1818 1819 if (bul.index() == opt.next) bul.addClass('selected'); 1820 1821 } 1822 }); 1823 1824 1825 ////////////////////////////////////////////////////////////////// 1826 // SET THE NEXT CAPTION AND REMOVE THE LAST CAPTION // 1827 ////////////////////////////////////////////////////////////////// 1828 1829 container.find('>li').each(function() { 1830 var li = jQuery(this); 1831 if (li.index!=opt.act && li.index!=opt.next) li.css({'z-index':16}); 1832 }); 1833 1834 actli.css({'z-index':18}); 1835 nextli.css({'z-index':20}); 1836 nextli.css({'opacity':0}); 1837 1838 1839 /////////////////////////// 1840 // ANIMATE THE CAPTIONS // 1841 /////////////////////////// 1842 if (actli.index() != nextli.index()) { 1843 removeTheCaptions(actli,opt); 1844 1845 } 1846 animateTheCaptions(nextli, opt); 1847 1848 1849 1850 1851 ///////////////////////////////////////////// 1852 // SET THE ACTUAL AMOUNT OF SLIDES !! // 1853 // SET A RANDOM AMOUNT OF SLOTS // 1854 /////////////////////////////////////////// 1855 if (nextli.data('slotamount')==undefined || nextli.data('slotamount')<1) { 1856 opt.slots=Math.round(Math.random()*12+4); 1857 if (comingtransition=="boxslide") 1858 opt.slots=Math.round(Math.random()*6+3); 1859 } else { 1860 opt.slots=nextli.data('slotamount'); 1861 1862 } 1863 1864 ///////////////////////////////////////////// 1865 // SET THE ACTUAL AMOUNT OF SLIDES !! // 1866 // SET A RANDOM AMOUNT OF SLOTS //
1867 /////////////////////////////////////////// 1868 if (nextli.data('rotate')==undefined) 1869 opt.rotate = 0 1870 else 1871 if (nextli.data('rotate')==999) 1872 opt.rotate=Math.round(Math.random()*360); 1873 else 1874 opt.rotate=nextli.data('rotate'); 1875 if (!jQuery.support.transition || opt.ie || opt.ie9) opt.rotate=0; 1876 1877 1878 1879 ////////////////////////////// 1880 // FIRST START // 1881 ////////////////////////////// 1882 1883 if (opt.firststart==1) { 1884 actli.css({'opacity':0}); 1885 opt.firststart=0; 1886 } 1887 1888 1889 ///////////////////////////////////// 1890 // THE SLOTSLIDE - TRANSITION I. // 1891 //////////////////////////////////// 1892 if (nexttrans==0) { // BOXSLIDE 1893 1894 masterspeed = masterspeed + 100; 1895 if (opt.slots>10) opt.slots=10; 1896 1897 nextli.css({'opacity':1}); 1898 1899 // PREPARE THE SLOTS HERE 1900 prepareOneSlideBox(actsh,opt,true); 1901 prepareOneSlideBox(nextsh,opt,false); 1902 1903 //SET DEFAULT IMG UNVISIBLE 1904 nextsh.find('.defaultimg').css({'opacity':0}); 1905 //actsh.find('.defaultimg').css({'opacity':0}); 1906 1907 1908 // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT 1909 1910 1911 nextsh.find('.slotslide').each(function(j) { 1912 var ss=jQuery(this); 1913 if (opt.ie9) 1914 ss.transition({top:(0-opt.sloth),left:(0-opt.slotw)},0); 1915 else 1916 ss.transition({top:(0-opt.sloth),left:(0-opt.slotw), rotate:opt.rotate},0); 1917 setTimeout(function() { 1918 ss.transition({top:0, left:0, scale:1, rotate:0},masterspeed*1.5,function() { 1919 1920 if (j==(opt.slots*opt.slots)-1) { 1921 removeSlots(container,opt); 1922 nextsh.find('.defaultimg').css({'opacity':1}); 1923 1924 if (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0}); 1925 opt.act=opt.next; 1926 moveSelectedThumb(container); 1927 1928 } 1929 }); 1930 },j*15); 1931 }); 1932 } 1933 1934 1935 1936 ///////////////////////////////////// 1937 // THE SLOTSLIDE - TRANSITION I. // 1938 //////////////////////////////////// 1939 if (nexttrans==1) { 1940 1941 1942 if (opt.slots>5) opt.slots=5; 1943 nextli.css({'opacity':1}); 1944 1945 // PREPARE THE SLOTS HERE 1946 //prepareOneSlideBox(actsh,opt,true); 1947 prepareOneSlideBox(nextsh,opt,false); 1948 1949 //SET DEFAULT IMG UNVISIBLE 1950 nextsh.find('.defaultimg').css({'opacity':0}); 1951 //actsh.find('.defaultimg').css({'opacity':0}); 1952 1953 1954 // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT 1955 1956 nextsh.find('.slotslide').each(function(j) { 1957 var ss=jQuery(this); 1958 ss.css({'opacity':0}); 1959 ss.find('img').css({'opacity':0}); 1960 if (opt.ie9) 1961 ss.find('img').transition({'top':(Math.random()*opt.slotw-opt.slotw)+"px",'left':(Math.random()*opt.slotw-opt.slotw)+"px"},0); 1962 else 1963 ss.find('img').transition({'top':(Math.random()*opt.slotw-opt.slotw)+"px",'left':(Math.random()*opt.slotw-opt.slotw)+"px", rotate:opt.rotate},0); 1964 1965 var rand=Math.random()*1000+(masterspeed + 200); 1966 if (j==(opt.slots*opt.slots)-1) rand=1500; 1967 1968 ss.find('img').transition({'opacity':1,'top':(0-ss.data('y'))+"px",'left':(0-ss.data('x'))+'px', rotate:0},rand); 1969 ss.transition({'opacity':1},rand,function() { 1970 if (j==(opt.slots*opt.slots)-1) { 1971 removeSlots(container,opt); 1972 nextsh.find('.defaultimg').css({'opacity':1}); 1973 if (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0}); 1974 opt.act=opt.next; 1975 1976 moveSelectedThumb(container); 1977 } 1978 1979 }); 1980 1981 1982 }); 1983 } 1984 1985 1986 ///////////////////////////////////// 1987 // THE SLOTSLIDE - TRANSITION I. // 1988 //////////////////////////////////// 1989 if (nexttrans==2) { 1990 1991 1992 masterspeed = masterspeed + 200; 1993 1994 nextli.css({'opacity':1}); 1995 1996 // PREPARE THE SLOTS HERE 1997 prepareOneSlide(actsh,opt,true); 1998 prepareOneSlide(nextsh,opt,false); 1999 2000 //SET DEFAULT IMG UNVISIBLE 2001 nextsh.find('.defaultimg').css({'opacity':0}); 2002 //actsh.find('.defaultimg').css({'opacity':0}); 2003 2004 2005 // ALL OLD SLOTS SHOULD BE SLIDED TO THE RIGHT 2006 actsh.find('.slotslide').each(function() { 2007 var ss=jQuery(this); 2008 2009 2010 //ss.animate({'left':opt.slotw+'px'},{duration:masterspeed,queue:false,complete:function() { 2011 ss.transit({'left':opt.slotw+'px',rotate:(0-opt.rotate)},masterspeed,function() { 2012 removeSlots(container,opt); 2013 nextsh.find('.defaultimg').css({'opacity':1}); 2014 if (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0}); 2015 opt.act=opt.next; 2016 moveSelectedThumb(container); 2017 2018 }); 2019 2020 }); 2021 2022 // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT 2023 nextsh.find('.slotslide').each(function() { 2024 var ss=jQuery(this); 2025 if (opt.ie9) 2026 ss.transit({'left':(0-opt.slotw)+"px"},0); 2027 else 2028 ss.transit({'left':(0-opt.slotw)+"px",rotate:opt.rotate},0); 2029 2030 ss.transit({'left':'0px',rotate:0},masterspeed,function() { 2031 removeSlots(container,opt); 2032 nextsh.find('.defaultimg').css({'opacity':1}); 2033 if (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0}); 2034 if (opt.ie) actsh.find('.defaultimg').css({'opacity':1}); 2035 opt.act=opt.next; 2036 2037 moveSelectedThumb(container); 2038 2039 }); 2040 2041 }); 2042 } 2043 2044 2045
2046 ///////////////////////////////////// 2047 // THE SLOTSLIDE - TRANSITION I. // 2048 //////////////////////////////////// 2049 if (nexttrans==3) { 2050 2051 2052 masterspeed = masterspeed + 200; 2053 nextli.css({'opacity':1}); 2054 2055 // PREPARE THE SLOTS HERE 2056 prepareOneSlideV(actsh,opt,true); 2057 prepareOneSlideV(nextsh,opt,false); 2058 2059 //SET DEFAULT IMG UNVISIBLE 2060 nextsh.find('.defaultimg').css({'opacity':0}); 2061 //actsh.find('.defaultimg').css({'opacity':0}); 2062 2063 // ALL OLD SLOTS SHOULD BE SLIDED TO THE RIGHT 2064 actsh.find('.slotslide').each(function() { 2065 var ss=jQuery(this); 2066 2067 ss.transit({'top':opt.sloth+'px',rotate:opt.rotate},masterspeed,function() { 2068 removeSlots(container,opt); 2069 nextsh.find('.defaultimg').css({'opacity':1}); 2070 if (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0}); 2071 opt.act=opt.next; 2072 moveSelectedThumb(container); 2073 2074 }); 2075 2076 }); 2077 2078 // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT 2079 nextsh.find('.slotslide').each(function() { 2080 var ss=jQuery(this); 2081 if (opt.ie9) 2082 ss.transit({'top':(0-opt.sloth)+"px"},0); 2083 else 2084 ss.transit({'top':(0-opt.sloth)+"px",rotate:opt.rotate},0); 2085 ss.transit({'top':'0px',rotate:0},masterspeed,function() { 2086 removeSlots(container,opt); 2087 nextsh.find('.defaultimg').css({'opacity':1}); 2088 if (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0}); 2089 opt.act=opt.next; 2090 moveSelectedThumb(container); 2091 2092 }); 2093 2094 }); 2095 } 2096 2097 2098 2099 ///////////////////////////////////// 2100 // THE SLOTSLIDE - TRANSITION I. // 2101 //////////////////////////////////// 2102 if (nexttrans==4) { 2103 2104 2105 2106 nextli.css({'opacity':1}); 2107 2108 // PREPARE THE SLOTS HERE 2109 prepareOneSlide(actsh,opt,true); 2110 prepareOneSlide(nextsh,opt,true); 2111 2112 //SET DEFAULT IMG UNVISIBLE 2113 nextsh.find('.defaultimg').css({'opacity':0}); 2114 actsh.find('.defaultimg').css({'opacity':0}); 2115 2116 2117 // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT 2118 actsh.find('.slotslide').each(function(i) { 2119 var ss=jQuery(this); 2120 2121 ss.transit({'top':(0+(opt.height))+"px",'opacity':1,rotate:opt.rotate},masterspeed+(i*(70-opt.slots))); 2122 }); 2123 2124 // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT 2125 nextsh.find('.slotslide').each(function(i) { 2126 var ss=jQuery(this); 2127 if (opt.ie9) 2128 ss.transition({'top':(0-(opt.height))+"px",'opacity':0},0); 2129 else 2130 ss.transition({'top':(0-(opt.height))+"px",'opacity':0,rotate:opt.rotate},0); 2131 2132 ss.transition({'top':'0px','opacity':1,rotate:0},masterspeed+(i*(70-opt.slots)),function() { 2133 if (i==opt.slots-1) { 2134 removeSlots(container,opt); 2135 nextsh.find('.defaultimg').css({'opacity':1}); 2136 if (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0}); 2137 opt.act=opt.next; 2138 moveSelectedThumb(container); 2139 } 2140 2141 }); 2142 2143 }); 2144 } 2145 2146 2147 ///////////////////////////////////// 2148 // THE SLOTSLIDE - TRANSITION I. // 2149 //////////////////////////////////// 2150 if (nexttrans==5) { 2151 2152 2153 2154 nextli.css({'opacity':1}); 2155 2156 // PREPARE THE SLOTS HERE 2157 prepareOneSlide(actsh,opt,true); 2158 prepareOneSlide(nextsh,opt,true); 2159 2160 //SET DEFAULT IMG UNVISIBLE 2161 nextsh.find('.defaultimg').css({'opacity':0}); 2162 actsh.find('.defaultimg').css({'opacity':0}); 2163 2164 // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT 2165 actsh.find('.slotslide').each(function(i) { 2166 var ss=jQuery(this); 2167 2168 ss.transition({'top':(0+(opt.height))+"px",'opacity':1,rotate:opt.rotate},masterspeed+((opt.slots-i)*(70-opt.slots))); 2169 2170 }); 2171 2172 // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT 2173 nextsh.find('.slotslide').each(function(i) { 2174 var ss=jQuery(this); 2175 if (opt.ie9) 2176 ss.transition({'top':(0-(opt.height))+"px",'opacity':0},0); 2177 else 2178 ss.transition({'top':(0-(opt.height))+"px",'opacity':0,rotate:opt.rotate},0); 2179 2180 ss.transition({'top':'0px','opacity':1,rotate:0},masterspeed+((opt.slots-i)*(70-opt.slots)),function() { 2181 if (i==0) { 2182 removeSlots(container,opt); 2183 nextsh.find('.defaultimg').css({'opacity':1}); 2184 if (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0}); 2185 opt.act=opt.next; 2186 moveSelectedThumb(container); 2187 } 2188 2189 }); 2190 2191 }); 2192 } 2193 2194
2195 ///////////////////////////////////// 2196 // THE SLOTSLIDE - TRANSITION I. // 2197 //////////////////////////////////// 2198 if (nexttrans==6) { 2199 2200 2201 2202 nextli.css({'opacity':1}); 2203 if (opt.slots<2) opt.slots=2; 2204 // PREPARE THE SLOTS HERE 2205 prepareOneSlide(actsh,opt,true); 2206 prepareOneSlide(nextsh,opt,true); 2207 2208 //SET DEFAULT IMG UNVISIBLE 2209 nextsh.find('.defaultimg').css({'opacity':0}); 2210 actsh.find('.defaultimg').css({'opacity':0}); 2211 2212 2213 actsh.find('.slotslide').each(function(i) { 2214 var ss=jQuery(this); 2215 2216 if (i<opt.slots/2) 2217 var tempo = (i+2)*60; 2218 else 2219 var tempo = (2+opt.slots-i)*60; 2220 2221 2222 ss.transition({'top':(0+(opt.height))+"px",'opacity':1},masterspeed+tempo); 2223 2224 }); 2225 2226 // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT 2227 nextsh.find('.slotslide').each(function(i) { 2228 var ss=jQuery(this); 2229 if (opt.ie9) 2230 ss.transition({'top':(0-(opt.height))+"px",'opacity':0},0); 2231 else 2232 ss.transition({'top':(0-(opt.height))+"px",'opacity':0,rotate:opt.rotate},0); 2233 if (i<opt.slots/2) 2234 var tempo = (i+2)*60; 2235 else 2236 var tempo = (2+opt.slots-i)*60; 2237 2238 2239 ss.transition({'top':'0px','opacity':1,rotate:0},masterspeed+tempo,function() { 2240 if (i==Math.round(opt.slots/2)) { 2241 removeSlots(container,opt); 2242 nextsh.find('.defaultimg').css({'opacity':1}); 2243 if (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0}); 2244 opt.act=opt.next; 2245 moveSelectedThumb(container); 2246 } 2247 2248 }); 2249 2250 }); 2251 } 2252 2253 2254 //////////////////////////////////// 2255 // THE SLOTSZOOM - TRANSITION II. // 2256 //////////////////////////////////// 2257 if (nexttrans==7) { 2258 2259 masterspeed = masterspeed * 3; 2260 nextli.css({'opacity':1}); 2261 2262 // PREPARE THE SLOTS HERE 2263 prepareOneSlide(actsh,opt,true); 2264 prepareOneSlide(nextsh,opt,true); 2265 2266 //SET DEFAULT IMG UNVISIBLE 2267 nextsh.find('.defaultimg').css({'opacity':0}); 2268 //actsh.find('.defaultimg').css({'opacity':0}); 2269 2270 // ALL OLD SLOTS SHOULD BE SLIDED TO THE RIGHT 2271 actsh.find('.slotslide').each(function() { 2272 var ss=jQuery(this).find('img'); 2273 2274 ss.transition({'left':(0-opt.slotw/2)+'px', 2275 'top':(0-opt.height/2)+'px', 2276 'width':(opt.slotw*2)+"px", 2277 'height':(opt.height*2)+"px", 2278 opacity:0, 2279 rotate:opt.rotate 2280 },masterspeed,function() { 2281 removeSlots(container,opt); 2282 nextsh.find('.defaultimg').css({'opacity':1}); 2283 if (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0}); 2284 opt.act = opt.next; 2285 moveSelectedThumb(container); 2286 }); 2287 2288 }); 2289 2290/ ////////////////////////////////////////////////////////////// 2291 // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT // 2292 /////////////////////////////////////////////////////////////// 2293 nextsh.find('.slotslide').each(function(i) { 2294 var ss=jQuery(this).find('img'); 2295 2296 if (opt.ie9) 2297 ss.transition({'left':(0)+'px','top':(0)+'px',opacity:0},0); 2298 else 2299 ss.transition({'left':(0)+'px','top':(0)+'px',opacity:0,rotate:opt.rotate},0); 2300 ss.transition({'left':(0-i*opt.slotw)+'px', 2301 'top':(0)+'px', 2302 'width':(nextsh.find('.defaultimg').data('neww'))+"px", 2303 'height':(nextsh.find('.defaultimg').data('newh'))+"px", 2304 opacity:1,rotate:0 2305 2306 },masterspeed,function() { 2307 removeSlots(container,opt); 2308 nextsh.find('.defaultimg').css({'opacity':1}); 2309 if (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0}); 2310 opt.act = opt.next; 2311 moveSelectedThumb(container); 2312 }); 2313 2314 2315 }); 2316 } 2317 2318 2319 2320 2321 //////////////////////////////////// 2322 // THE SLOTSZOOM - TRANSITION II. // 2323 //////////////////////////////////// 2324 if (nexttrans==8) { 2325 2326 masterspeed = masterspeed * 3; 2327 nextli.css({'opacity':1}); 2328 2329 // PREPARE THE SLOTS HERE 2330 prepareOneSlideV(actsh,opt,true); 2331 prepareOneSlideV(nextsh,opt,true); 2332 2333 //SET DEFAULT IMG UNVISIBLE 2334 nextsh.find('.defaultimg').css({'opacity':0}); 2335 //actsh.find('.defaultimg').css({'opacity':0}); 2336 2337 // ALL OLD SLOTS SHOULD BE SLIDED TO THE RIGHT 2338 actsh.find('.slotslide').each(function() { 2339 var ss=jQuery(this).find('img'); 2340 2341 ss.transition({'left':(0-opt.width/2)+'px', 2342 'top':(0-opt.sloth/2)+'px', 2343 'width':(opt.width*2)+"px", 2344 'height':(opt.sloth*2)+"px", 2345 opacity:0,rotate:opt.rotate 2346 },masterspeed,function() { 2347 removeSlots(container,opt); 2348 nextsh.find('.defaultimg').css({'opacity':1}); 2349 if (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0}); 2350 2351 opt.act = opt.next; 2352 moveSelectedThumb(container); 2353 }); 2354 2355 }); 2356 2357 2358 // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT //
2359 /////////////////////////////////////////////////////////////// 2360 nextsh.find('.slotslide').each(function(i) { 2361 var ss=jQuery(this).find('img'); 2362 if (opt.ie9) 2363 ss.transition({'left':(0)+'px','top':(0)+'px',opacity:0},0); 2364 else 2365 ss.transition({'left':(0)+'px','top':(0)+'px',opacity:0,rotate:opt.rotate},0); 2366 ss.transition({'left':(0)+'px', 2367 'top':(0-i*opt.sloth)+'px', 2368 'width':(nextsh.find('.defaultimg').data('neww'))+"px", 2369 'height':(nextsh.find('.defaultimg').data('newh'))+"px", 2370 opacity:1,rotate:0 2371 },masterspeed,function() { 2372 removeSlots(container,opt); 2373 nextsh.find('.defaultimg').css({'opacity':1}); 2374 if (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0}); 2375 2376 opt.act = opt.next; 2377 moveSelectedThumb(container); 2378 }); 2379 2380 }); 2381 } 2382 2383 2384 //////////////////////////////////////// 2385 // THE SLOTSFADE - TRANSITION III. // 2386 ////////////////////////////////////// 2387 if (nexttrans==9) { 2388 2389 2390 2391 nextli.css({'opacity':1}); 2392 2393 opt.slots = opt.width/20; 2394 2395 prepareOneSlide(nextsh,opt,true); 2396 2397 2398 //actsh.find('.defaultimg').css({'opacity':0}); 2399 nextsh.find('.defaultimg').css({'opacity':0}); 2400 2401 var ssamount=0; 2402 // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT 2403 nextsh.find('.slotslide').each(function(i) { 2404 var ss=jQuery(this); 2405 ssamount++; 2406 ss.transition({'opacity':0,x:0,y:0},0); 2407 ss.data('tout',setTimeout(function() { 2408 ss.transition({x:0,y:0,'opacity':1},masterspeed); 2409 2410 },i*4) 2411 ); 2412 2413 }); 2414 2415 //nextsh.find('.defaultimg').transition({'opacity':1},(masterspeed+(ssamount*4))); 2416 2417 setTimeout(function() { 2418 removeSlots(container,opt); 2419 nextsh.find('.defaultimg').css({'opacity':1}); 2420 if (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0}); 2421 if (opt.ie) actsh.find('.defaultimg').css({'opacity':1}); 2422 2423 opt.act = opt.next; 2424 moveSelectedThumb(container); 2425 },(masterspeed+(ssamount*4))); 2426 } 2427 2428 2429 2430 2431 //////////////////////////////////////// 2432 // THE SLOTSFADE - TRANSITION III. // 2433 ////////////////////////////////////// 2434 if (nexttrans==10) { 2435 2436 2437 2438 nextli.css({'opacity':1}); 2439 2440 opt.slots = opt.height/20; 2441 2442 prepareOneSlideV(nextsh,opt,true); 2443 2444 2445 //actsh.find('.defaultimg').css({'opacity':0}); 2446 nextsh.find('.defaultimg').css({'opacity':0}); 2447 2448 var ssamount=0; 2449 // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT 2450 nextsh.find('.slotslide').each(function(i) { 2451 var ss=jQuery(this); 2452 ssamount++; 2453 ss.transition({'opacity':0,x:0,y:0},0); 2454 ss.data('tout',setTimeout(function() { 2455 ss.transition({x:0,y:0,'opacity':1},masterspeed); 2456 2457 },i*4) 2458 ); 2459 2460 }); 2461 2462 //nextsh.find('.defaultimg').transition({'opacity':1},(masterspeed+(ssamount*4))); 2463 2464 setTimeout(function() { 2465 removeSlots(container,opt); 2466 nextsh.find('.defaultimg').css({'opacity':1}); 2467 if (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0}); 2468 if (opt.ie) actsh.find('.defaultimg').css({'opacity':1}); 2469 2470 opt.act = opt.next; 2471 moveSelectedThumb(container); 2472 },(masterspeed+(ssamount*4))); 2473 } 2474 2475 2476 /////////////////////////// 2477 // SIMPLE FADE ANIMATION // 2478 /////////////////////////// 2479 2480 if (nexttrans==11) { 2481 2482 2483 2484 nextli.css({'opacity':1}); 2485 2486 opt.slots = 1; 2487 2488 prepareOneSlide(nextsh,opt,true); 2489 2490 2491 //actsh.find('.defaultimg').css({'opacity':0}); 2492 nextsh.find('.defaultimg').css({'opacity':0,'position':'relative'}); 2493 2494 var ssamount=0; 2495 // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT 2496 2497 nextsh.find('.slotslide').each(function(i) { 2498 var ss=jQuery(this); 2499 ssamount++; 2500 2501 if (opt.ie9 ||opt.ie) { 2502 if (opt.ie) nextli.css({'opacity':'0'}); 2503 ss.css({'opacity':0}); 2504 2505 } else 2506 ss.transition({'opacity':0,rotate:opt.rotate},0); 2507 2508 2509 setTimeout(function() { 2510 if (opt.ie9 ||opt.ie) { 2511 if (opt.ie) 2512 nextli.animate({'opacity':1},{duration:masterspeed}); 2513 else 2514 ss.transition({'opacity':1},masterspeed); 2515 2516 } else { 2517 ss.transition({'opacity':1,rotate:0},masterspeed); 2518 } 2519 },10); 2520 }); 2521 2522 setTimeout(function() { 2523 removeSlots(container,opt); 2524 nextsh.find('.defaultimg').css({'opacity':1}); 2525 if (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0}); 2526 if (opt.ie) actsh.find('.defaultimg').css({'opacity':1}); 2527 2528 opt.act = opt.next; 2529 moveSelectedThumb(container); 2530 },masterspeed+15); 2531 } 2532 2533 2534 2535 2536 2537 2538 if (nexttrans==12 || nexttrans==13 || nexttrans==14 || nexttrans==15) { 2539 2540 masterspeed = masterspeed * 3; 2541 nextli.css({'opacity':1}); 2542 2543 opt.slots = 1; 2544 2545 prepareOneSlide(nextsh,opt,true); 2546 prepareOneSlide(actsh,opt,true); 2547 2548 2549 actsh.find('.defaultimg').css({'opacity':0}); 2550 nextsh.find('.defaultimg').css({'opacity':0}); 2551 2552 var oow = opt.width; 2553 var ooh = opt.height; 2554 2555 2556 // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT 2557 var ssn=nextsh.find('.slotslide') 2558 2559 if (opt.fullWidth=="on" || opt.fullSreen=="on") { 2560 oow=ssn.width(); 2561 ooh=ssn.height(); 2562 } 2563 2564 if (nexttrans==12) 2565 if (opt.ie9) { 2566 ssn.transition({'left':oow+"px"},0); 2567 2568 } else { 2569 ssn.transition({'left':oow+"px",rotate:opt.rotate},0); 2570 2571 } 2572 else 2573 if (nexttrans==15) 2574 if (opt.ie9) 2575 ssn.transition({'left':(0-oow)+"px"},0); 2576 else 2577 ssn.transition({'left':(0-oow)+"px",rotate:opt.rotate},0); 2578 else 2579 if (nexttrans==13) 2580 if (opt.ie9) 2581 ssn.transition({'top':(ooh)+"px"},0); 2582 else 2583 ssn.transition({'top':(ooh)+"px",rotate:opt.rotate},0); 2584 else 2585 if (nexttrans==14) 2586 if (opt.ie9) 2587 ssn.transition({'top':(0-ooh)+"px"},0); 2588 else 2589 ssn.transition({'top':(0-ooh)+"px",rotate:opt.rotate},0); 2590 2591 2592 ssn.transition({'left':'0px','top':'0px',opacity:1,rotate:0},masterspeed,function() { 2593 2594 2595 removeSlots(container,opt,0); 2596 if (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0}); 2597 nextsh.find('.defaultimg').css({'opacity':1}); 2598 opt.act = opt.next; 2599 moveSelectedThumb(container); 2600 }); 2601 2602 2603 2604 var ssa=actsh.find('.slotslide'); 2605 2606 if (nexttrans==12) 2607 ssa.transition({'left':(0-oow)+'px',opacity:1,rotate:0},masterspeed); 2608 else 2609 if (nexttrans==15) 2610 ssa.transition({'left':(oow)+'px',opacity:1,rotate:0},masterspeed); 2611 else 2612 if (nexttrans==13) 2613 ssa.transition({'top':(0-ooh)+'px',opacity:1,rotate:0},masterspeed); 2614 else 2615 if (nexttrans==14) 2616 ssa.transition({'top':(ooh)+'px',opacity:1,rotate:0},masterspeed); 2617 2618 2619 2620 } 2621 2622
2623 ////////////////////////////////////// 2624 // THE SLOTSLIDE - TRANSITION XVI. // 2625 ////////////////////////////////////// 2626 if (nexttrans==16) { // PAPERCUT 2627 2628 if (masterspeed<600) masterspeed=600; 2629 2630 actli.css({'position':'absolute','z-index':20}); 2631 nextli.css({'position':'absolute','z-index':15}); 2632 // PREPARE THE CUTS 2633 actli.wrapInner('<div class="tp-half-one"></div>'); 2634 actli.find('.tp-half-one').clone(true).appendTo(actli).addClass("tp-half-two"); 2635 actli.find('.tp-half-two').removeClass('tp-half-one'); 2636 actli.find('.tp-half-two').wrapInner('<div class="tp-offset"></div>'); 2637 2638 var oow = opt.width; 2639 var ooh = opt.height; 2640 if (opt.fullWidth=="on" || opt.fullSreen=="on") { 2641 oow=opt.container.parent().width(); 2642 ooh=opt.container.parent().height(); 2643 } 2644 2645 2646 // ANIMATE THE CUTS 2647 var img=actli.find('.defaultimg'); 2648 if (img.length>0 && img.data("fullwidthcentering")=="on") { 2649 var imgh=ooh/2; 2650 var to=img.position().top; 2651 } else { 2652 2653 var imgh=ooh/2; 2654 var to=0; 2655 } 2656 actli.find('.tp-half-one').css({'width':oow+"px",'height':(imgh)+"px",'overflow':'hidden','position':'absolute','top':'0px','left':'0px'}); 2657 actli.find('.tp-half-two').css({'width':oow+"px",'height':(imgh)+"px",'overflow':'hidden','position':'absolute','top':(imgh)+'px','left':'0px'}); 2658 actli.find('.tp-half-two .tp-offset').css({'position':'absolute','top':(0-imgh)+'px','left':'0px'}); 2659 2660 2661 2662 2663 // Delegate .transition() calls to .animate() 2664 // if the browser can't do CSS transitions. 2665 if (!jQuery.support.transition) { 2666 2667 actli.find('.tp-half-one').animate({'opacity':0,'top':(0-ooh/2)+"px"},{duration: masterspeed,queue:false}); 2668 actli.find('.tp-half-two').animate({'opacity':0,'top':(ooh)+"px"},{duration: masterspeed,queue:false}); 2669 } else { 2670 var ro1=Math.round(Math.random()*40-20); 2671 var ro2=Math.round(Math.random()*40-20); 2672 var sc1=Math.random()*1+1; 2673 var sc2=Math.random()*1+1; 2674 actli.find('.tp-half-one').transition({opacity:1, scale:sc1, rotate:ro1,y:(0-ooh/1.4)+"px"},masterspeed,'in'); 2675 actli.find('.tp-half-two').transition({opacity:1, scale:sc2, rotate:ro2,y:(0+ooh/1.4)+"px"},masterspeed,'in'); 2676 2677 if (actli.html()!=null) nextli.transition({scale:0.8,x:opt.width*0.1, y:ooh*0.1, rotate:ro1},0).transition({rotate:0, scale:1,x:0,y:0},(masterspeed-100),'snap'); 2678 } 2679 nextsh.find('.defaultimg').css({'opacity':1}); 2680 setTimeout(function() { 2681 2682 2683 // CLEAN UP BEFORE WE START 2684 actli.css({'position':'absolute','z-index':18}); 2685 nextli.css({'position':'absolute','z-index':20}); 2686 nextsh.find('.defaultimg').css({'opacity':1}); 2687 actsh.find('.defaultimg').css({'opacity':0}); 2688 if (actli.find('.tp-half-one').length>0) { 2689 actli.find('.tp-half-one >img, .tp-half-one >div').unwrap(); 2690 2691 } 2692 actli.find('.tp-half-two').remove(); 2693 opt.transition = 0; 2694 opt.act = opt.next; 2695 2696 },masterspeed); 2697 nextli.css({'opacity':1}); 2698 2699 } 2700 2701 //////////////////////////////////////// 2702 // THE SLOTSLIDE - TRANSITION XVII. // 2703 /////////////////////////////////////// 2704 if (nexttrans==17) { // 3D CURTAIN HORIZONTAL 2705 2706 masterspeed = masterspeed + 100; 2707 if (opt.slots>10) opt.slots=10; 2708 2709 nextli.css({'opacity':1}); 2710 2711 // PREPARE THE SLOTS HERE 2712 prepareOneSlideV(actsh,opt,true); 2713 prepareOneSlideV(nextsh,opt,false); 2714 2715 //SET DEFAULT IMG UNVISIBLE 2716 nextsh.find('.defaultimg').css({'opacity':0}); 2717 //actsh.find('.defaultimg').css({'opacity':0}); 2718 2719 2720 // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT 2721 2722 2723 nextsh.find('.slotslide').each(function(j) { 2724 var ss=jQuery(this); 2725 ss.transition({ opacity:0, rotateY:350 ,rotateX:40, perspective:'1400px'},0); 2726 setTimeout(function() { 2727 ss.transition({opacity:1, top:0, left:0, scale:1, perspective:'150px', rotate:0,rotateY:0, rotateX:0},masterspeed*2,function() { 2728 2729 if (j==opt.slots-1) { 2730 removeSlots(container,opt); 2731 nextsh.find('.defaultimg').css({'opacity':1}); 2732 2733 if (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0}); 2734 opt.act=opt.next; 2735 moveSelectedThumb(container); 2736 2737 } 2738 }); 2739 },j*100); 2740 }); 2741 } 2742 2743 2744
2745 //////////////////////////////////////// 2746 // THE SLOTSLIDE - TRANSITION XVIII. // 2747 /////////////////////////////////////// 2748 if (nexttrans==18) { // 3D CURTAIN VERTICAL 2749 2750 masterspeed = masterspeed + 100; 2751 if (opt.slots>10) opt.slots=10; 2752 2753 nextli.css({'opacity':1}); 2754 2755 // PREPARE THE SLOTS HERE 2756 prepareOneSlide(actsh,opt,true); 2757 prepareOneSlide(nextsh,opt,false); 2758 2759 //SET DEFAULT IMG UNVISIBLE 2760 nextsh.find('.defaultimg').css({'opacity':0}); 2761 //actsh.find('.defaultimg').css({'opacity':0}); 2762 2763 2764 // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT 2765 2766 2767 nextsh.find('.slotslide').each(function(j) { 2768 var ss=jQuery(this); 2769 ss.transition({ rotateX:10 ,rotateY:310, perspective:'1400px', rotate:0,opacity:0},0); 2770 setTimeout(function() { 2771 ss.transition({top:0, left:0, scale:1, perspective:'150px', rotate:0,rotateY:0, rotateX:0,opacity:1},masterspeed*2,function() { 2772 2773 if (j==opt.slots-1) { 2774 removeSlots(container,opt); 2775 nextsh.find('.defaultimg').css({'opacity':1}); 2776 2777 if (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0}); 2778 opt.act=opt.next; 2779 moveSelectedThumb(container); 2780 2781 } 2782 }); 2783 },j*100); 2784 }); 2785 } 2786 2787 //////////////////////////////////////// 2788 // THE SLOTSLIDE - TRANSITION XIX. // 2789 /////////////////////////////////////// 2790 if (nexttrans==19) { // CUBIC VERTICAL 2791 masterspeed = masterspeed + 100; 2792 if (opt.slots>10) opt.slots=10; 2793 nextli.css({'opacity':1}); 2794 2795 // PREPARE THE SLOTS HERE 2796 prepareOneSlide(actsh,opt,true); 2797 prepareOneSlide(nextsh,opt,false); 2798 2799 //SET DEFAULT IMG UNVISIBLE 2800 nextsh.find('.defaultimg').css({'opacity':0}); 2801 //actsh.find('.defaultimg').css({'opacity':0}); 2802 var chix=nextli.css('z-index'); 2803 var chix2=actli.css('z-index'); 2804 2805 //actli.css({'z-index':22}); 2806 2807 2808 2809 // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT 2810 2811 2812 nextsh.find('.slotslide').each(function(j) { 2813 var ss=jQuery(this); 2814 //ss.css({'overflow':'visible'}); 2815 ss.parent().css({'overflow':'visible'}); 2816 ss.css({'background':'#333'}); 2817 if (direction==1) 2818 ss.transition({ opacity:0,left:0,top:opt.height/2,rotate3d:'1, 0, 0, -90deg '},0); 2819 else 2820 ss.transition({ opacity:0,left:0,top:0-opt.height/2,rotate3d:'1, 0, 0, 90deg '},0); 2821 2822 setTimeout(function() { 2823 2824 ss.transition({opacity:1,top:0,perspective:opt.height*2,rotate3d:' 1, 0, 0, 0deg '},masterspeed*2,function() { 2825 2826 if (j==opt.slots-1) { 2827 removeSlots(container,opt); 2828 nextsh.find('.defaultimg').css({'opacity':1}); 2829 2830 if (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0}); 2831 opt.act=opt.next; 2832 moveSelectedThumb(container); 2833 2834 } 2835 }); 2836 },j*150); 2837 2838 }); 2839 2840 actsh.find('.slotslide').each(function(j) { 2841 var ss=jQuery(this); 2842 ss.parent().css({'overflow':'visible'}); 2843 ss.css({'background':'#333'}); 2844 ss.transition({ top:0,rotate3d: '1, 0, 0, 0deg'},0); 2845 actsh.find('.defaultimg').css({'opacity':0}); 2846 setTimeout(function() { 2847 if (direction==1) 2848 ss.transition({opacity:0.6,left:0,perspective: opt.height*2,top:0-opt.height/2,rotate3d: '1, 0, 0, 90deg'},masterspeed*2,function() {}); 2849 else 2850 ss.transition({opacity:0.6,left:0,perspective: opt.height*2,top:(0+opt.height/2),rotate3d: '1, 0, 0, -90deg'},masterspeed*2,function() {}); 2851 },j*150); 2852 }); 2853 } 2854 2855 //////////////////////////////////////// 2856 // THE SLOTSLIDE - TRANSITION XX. // 2857 /////////////////////////////////////// 2858 if (nexttrans==20) { // FLYIN 2859 masterspeed = masterspeed + 100; 2860 if (opt.slots>10) opt.slots=10; 2861 2862 2863 2864 nextli.css({'opacity':1}); 2865 2866 // PREPARE THE SLOTS HERE 2867 prepareOneSlideV(actsh,opt,true); 2868 prepareOneSlideV(nextsh,opt,false); 2869 2870 //SET DEFAULT IMG UNVISIBLE 2871 nextsh.find('.defaultimg').css({'opacity':0}); 2872 //actsh.find('.defaultimg').css({'opacity':0}); 2873 2874 2875 // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT 2876 2877 2878 nextsh.find('.slotslide').each(function(j) { 2879 var ss=jQuery(this); 2880 ss.parent().css({'overflow':'visible'}); 2881 2882 if (direction==1) 2883 ss.transition({ scale:0.8,top:0,left:0-opt.width,rotate3d: '2, 5, 0, 110deg'},0); 2884 else 2885 ss.transition({ scale:0.8,top:0,left:0+opt.width,rotate3d: '2, 5, 0, -110deg'},0); 2886 setTimeout(function() { 2887 ss.transition({ scale:0.8,left:0,perspective: opt.width,rotate3d: '1, 5, 0, 0deg'},masterspeed*2,'ease').transition({scale:1},200,'out',function() { 2888 2889 if (j==opt.slots-1) { 2890 removeSlots(container,opt); 2891 nextsh.find('.defaultimg').css({'opacity':1}); 2892 2893 if (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0}); 2894 opt.act=opt.next; 2895 moveSelectedThumb(container); 2896 2897 } 2898 }); 2899 },j*100); 2900 }); 2901 2902 actsh.find('.slotslide').each(function(j) { 2903 var ss=jQuery(this); 2904 ss.transition({ scale:0.5,left:0,rotate3d: '1, 5, 0, 5deg'},300,'in-out'); 2905 actsh.find('.defaultimg').css({'opacity':0}); 2906 setTimeout(function() { 2907 if (direction==1) 2908 ss.transition({top:0,left:opt.width/2,perspective: opt.width,rotate3d: '0, -3, 0, 70deg',opacity:0}
2908,masterspeed*2,'out',function() {}); 2909 else 2910 ss.transition({top:0,left:0-opt.width/2,perspective: opt.width,rotate3d: '0, -3, 0, -70deg',opacity:0},masterspeed*2,'out',function() {}); 2911 },j*100); 2912 }); 2913 } 2914 2915 2916 //////////////////////////////////////// 2917 // THE SLOTSLIDE - TRANSITION XX. // 2918 /////////////////////////////////////// 2919 if (nexttrans==21) { // TURNOFF 2920 masterspeed = masterspeed + 100; 2921 if (opt.slots>10) opt.slots=10; 2922 2923 nextli.css({'opacity':1}); 2924 2925 // PREPARE THE SLOTS HERE 2926 prepareOneSlideV(actsh,opt,true); 2927 prepareOneSlideV(nextsh,opt,false); 2928 2929 //SET DEFAULT IMG UNVISIBLE 2930 nextsh.find('.defaultimg').css({'opacity':0}); 2931 //actsh.find('.defaultimg').css({'opacity':0}); 2932 2933 2934 // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT 2935 2936 2937 nextsh.find('.slotslide').each(function(j) { 2938 var ss=jQuery(this); 2939 if (direction==1) 2940 ss.transition({ top:0,left:0-(opt.width),rotate3d: '0, 1, 0, 90deg'},0); 2941 else 2942 ss.transition({ top:0,left:0+(opt.width),rotate3d: '0, 1, 0, -90deg'},0); 2943 setTimeout(function() { 2944 ss.transition({left:0,perspective: opt.width*2,rotate3d: '0, 0, 0, 0deg'},masterspeed*2,function() { 2945 2946 if (j==opt.slots-1) { 2947 removeSlots(container,opt); 2948 nextsh.find('.defaultimg').css({'opacity':1}); 2949 2950 if (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0}); 2951 opt.act=opt.next; 2952 moveSelectedThumb(container); 2953 2954 } 2955 }); 2956 },j*100); 2957 }); 2958 2959 actsh.find('.slotslide').each(function(j) { 2960 var ss=jQuery(this); 2961 ss.transition({ left:0,rotate3d: '0, 0, 0, 0deg'},0); 2962 actsh.find('.defaultimg').css({'opacity':0}); 2963 setTimeout(function() { 2964 if (direction==1) 2965 ss.transition({top:0,left:(opt.width/2),perspective: opt.width,rotate3d: '0, 1, 0, -90deg'},masterspeed*1.5,function() {}); 2966 else 2967 ss.transition({top:0,left:(0-opt.width/2),perspective: opt.width,rotate3d: '0, 1, 0, +90deg'},masterspeed*1.5,function() {}); 2968 2969 },j*100); 2970 }); 2971 } 2972 2973 2974 var data={}; 2975 data.slideIndex=opt.next+1; 2976 container.trigger('revolution.slide.onchange',data); 2977 setTimeout(function() { container.trigger('revolution.slide.onafterswap'); },masterspeed); 2978 container.trigger('revolution.slide.onvideostop'); 2979 2980 2981 } 2982 2983 2984 2985 2986 function onYouTubePlayerAPIReady() { 2987 2988 } 2989 2990 2991 ////////////////////////////////////////// 2992 // CHANG THE YOUTUBE PLAYER STATE HERE // 2993 //////////////////////////////////////// 2994 function onPlayerStateChange(event) { 2995 2996 var embedCode = event.target.getVideoEmbedCode(); 2997 var container = jQuery('#'+embedCode.split('id="')[1].split('"')[0]).closest('.tp-simpleresponsive'); 2998 2999 if (event.data == YT.PlayerState.PLAYING) { 3000 3001 var bt = container.find('.tp-bannertimer'); 3002 var opt = bt.data('opt'); 3003 bt.stop(); 3004 3005 opt.videoplaying=true; 3006 //console.log("VideoPlay set to True due onPlayerStateChange PLAYING"); 3007 opt.videostartednow=1; 3008 3009 } else { 3010 var bt = container.find('.tp-bannertimer'); 3011 var opt = bt.data('opt'); 3012 3013 if (event.data!=-1) { 3014 if (opt.conthover==0) 3015 bt.animate({'width':"100%"},{duration:((opt.delay-opt.cd)-100),queue:false, easing:"linear"}); 3016 opt.videoplaying=false; 3017 opt.videostoppednow=1; 3018 //console.log("VideoPlay set to False due onPlayerStateChange PAUSE"); 3019 } 3020 3021 } 3022 if (event.data==0 && opt.nextslideatend==true) 3023 opt.container.revnext(); 3024 3025 3026 } 3027
3028 /////////////////////////////// 3029 // YOUTUBE VIDEO AUTOPLAY // 3030 /////////////////////////////// 3031 function onPlayerReady(event) { 3032 event.target.playVideo(); 3033 } 3034 3035 //////////////////////// 3036 // VIMEO ADD EVENT ///// 3037 //////////////////////// 3038 function addEvent(element, eventName, callback) { 3039 3040 if (element.addEventListener) { 3041 3042 element.addEventListener(eventName, callback, false); 3043 } 3044 else { 3045 3046 element.attachEvent(eventName, callback, false); 3047 } 3048 3049 3050 } 3051 3052 ////////////////////////////////////////// 3053 // CHANGE THE YOUTUBE PLAYER STATE HERE // 3054 //////////////////////////////////////// 3055 function vimeoready(player_id) { 3056 3057 var froogaloop = $f(player_id); 3058 var container = jQuery('#'+player_id).closest('.tp-simpleresponsive'); 3059 3060 //jQuery('#debug').html(jQuery('#debug').html()+" <br>Frooga Func"+Math.round(Math.random()*100)); 3061 3062 froogaloop.addEvent('ready', function(data) { 3063 //jQuery('#debug').html(jQuery('#debug').html()+" <br>Ready"+Math.round(Math.random()*100)); 3064 froogaloop.addEvent('play', function(data) { 3065 //jQuery('#debug').html(jQuery('#debug').html()+" <br>Play"+Math.round(Math.random()*100)); 3066 3067 var bt = container.find('.tp-bannertimer'); 3068 var opt = bt.data('opt'); 3069 bt.stop(); 3070 opt.videoplaying=true; 3071 //console.log("VideoPlay set to True due vimeoready PLAYING"); 3072 }); 3073 3074 froogaloop.addEvent('finish', function(data) { 3075 var bt = container.find('.tp-bannertimer'); 3076 var opt = bt.data('opt'); 3077 if (opt.conthover==0) 3078 bt.animate({'width':"100%"},{duration:((opt.delay-opt.cd)-100),queue:false, easing:"linear"}); 3079 opt.videoplaying=false; 3080 //console.log("VideoPlay set to False due vimeoready FINNSIH"); 3081 opt.videostartednow=1; 3082 if (opt.nextslideatend==true) 3083 opt.container.revnext(); 3084 3085 }); 3086 3087 froogaloop.addEvent('pause', function(data) { 3088 var bt = container.find('.tp-bannertimer'); 3089 var opt = bt.data('opt'); 3090 if (opt.conthover==0) 3091 bt.animate({'width':"100%"},{duration:((opt.delay-opt.cd)-100),queue:false, easing:"linear"}); 3092 opt.videoplaying=false; 3093 //console.log("VideoPlay set to False due vimeoready PAUSE"); 3094 opt.videostoppednow=1; 3095 }); 3096 }); 3097 3098 3099 3100 3101 } 3102 3103 ///////////////////////////////////// 3104 // EVENT HANDLING FOR VIMEO VIDEOS // 3105 ///////////////////////////////////// 3106 3107 function vimeoready_auto(player_id) { 3108 3109 var froogaloop = $f(player_id); 3110 var container = jQuery('#'+player_id).closest('.tp-simpleresponsive'); 3111 3112 froogaloop.addEvent('ready', function(data) { 3113 froogaloop.api('play'); 3114 }); 3115 3116 froogaloop.addEvent('play', function(data) { 3117 var bt = container.find('.tp-bannertimer'); 3118 var opt = bt.data('opt'); 3119 bt.stop(); 3120 opt.videoplaying=true; 3121 //console.log("VideoPlay set to True due vimeoready_auto PLAYING"); 3122 }); 3123 3124 froogaloop.addEvent('finish', function(data) { 3125 var bt = container.find('.tp-bannertimer'); 3126 var opt = bt.data('opt'); 3127 if (opt.conthover==0) 3128 bt.animate({'width':"100%"},{duration:((opt.delay-opt.cd)-100),queue:false, easing:"linear"}); 3129 opt.videoplaying=false; 3130 //console.log("VideoPlay set to False due vimeoready_auto FINISH"); 3131 opt.videostartednow=1; 3132 if (opt.nextslideatend==true) 3133 opt.container.revnext(); 3134 3135 }); 3136 3137 froogaloop.addEvent('pause', function(data) { 3138 var bt = container.find('.tp-bannertimer'); 3139 var opt = bt.data('opt'); 3140 if (opt.conthover==0) 3141 bt.animate({'width':"100%"},{duration:((opt.delay-opt.cd)-100),queue:false, easing:"linear"}); 3142 opt.videoplaying=false; 3143 //console.log("VideoPlay set to False due vimeoready_auto PAUSE"); 3144 opt.videostoppednow=1; 3145 }); 3146 } 3147 3148 3149 /////////////////////////////////////// 3150 // EVENT HANDLING FOR VIDEO JS VIDEOS //
3151 //////////////////////////////////////// 3152 function html5vidready(myPlayer) { 3153 3154 myPlayer.on("play",function() { 3155 var bt = jQuery('body').find('.tp-bannertimer'); 3156 var opt = bt.data('opt'); 3157 bt.stop(); 3158 try{ 3159 opt.videoplaying=true; 3160 } catch(e) {} 3161 //console.log("VideoPlay set to True due html5vidready PLAYING"); 3162 }); 3163 3164 myPlayer.on("pause",function() { 3165 var bt = jQuery('body').find('.tp-bannertimer'); 3166 var opt = bt.data('opt'); 3167 if (opt.conthover==0) 3168 bt.animate({'width':"100%"},{duration:((opt.delay-opt.cd)-100),queue:false, easing:"linear"}); 3169 opt.videoplaying=false; 3170 //console.log("VideoPlay set to False due html5vidready pause"); 3171 opt.videostoppednow=1; 3172 }); 3173 3174 myPlayer.on("ended",function() { 3175 var bt = jQuery('body').find('.tp-bannertimer'); 3176 var opt = bt.data('opt'); 3177 if (opt.conthover==0) 3178 bt.animate({'width':"100%"},{duration:((opt.delay-opt.cd)-100),queue:false, easing:"linear"}); 3179 opt.videoplaying=false; 3180 //console.log("VideoPlay set to False due html5vidready pause"); 3181 opt.videostoppednow=1; 3182 if (opt.nextslideatend==true) 3183 opt.container.revnext(); 3184 }); 3185 3186 } 3187 3188 3189 3190 3191 //////////////////////// 3192 // SHOW THE CAPTION // 3193 /////////////////////// 3194 function animateTheCaptions(nextli, opt,actli) { 3195 3196 3197 //if (jQuery("body").find('#debug').length==0) 3198 // jQuery("body").append('<div id="debug" style="background:#000;z-index:1000;position:fixed;top:5px;left:5px;width:100px;height:500px;color:#fff;font-size:10px;font-family:Arial;"</div>'); 3199 3200 3201 var offsetx=0; 3202 var offsety=0; 3203 3204 nextli.find('.tp-caption').each(function(i) { 3205 3206 offsetx = opt.width/2 - opt.startwidth/2; 3207 3208 3209 3210 if (opt.bh>1) { 3211 opt.bw=1; 3212 opt.bh=1; 3213 } 3214 3215 if (opt.bw>1) { 3216 opt.bw=1; 3217 opt.bh=1; 3218 } 3219 3220 var xbw = opt.bw; 3221 var xbh = opt.bh; 3222 3223 3224 if (opt.fullScreen=="on") 3225 offsety = opt.height/2 - (opt.startheight*opt.bh)/2; 3226 3227 if (offsety<0) offsety=0; 3228 3229 3230 3231 var nextcaption=nextli.find('.tp-caption:eq('+i+')'); 3232 3233 var handlecaption=0; 3234 3235 // HIDE CAPTION IF RESOLUTION IS TOO LOW 3236 if (opt.width<opt.hideCaptionAtLimit && nextcaption.data('captionhidden')=="on") { 3237 nextcaption.addClass("tp-hidden-caption") 3238 handlecaption=1; 3239 } else { 3240 if (opt.width<opt.hideAllCaptionAtLilmit) { 3241 nextcaption.addClass("tp-hidden-caption") 3242 handlecaption=1; 3243 } else { 3244 nextcaption.removeClass("tp-hidden-caption") 3245 } 3246 } 3247 3248 3249 3250 3251 nextcaption.stop(true,true); 3252 if (handlecaption==0) { 3253 if (nextcaption.data('linktoslide')!=undefined) { 3254 nextcaption.css({'cursor':'pointer'}); 3255 if (nextcaption.data('linktoslide')!="no") { 3256 nextcaption.click(function() { 3257 var nextcaption=jQuery(this); 3258 var dir = nextcaption.data('linktoslide'); 3259 if (dir!="next" && dir!="prev") { 3260 opt.container.data('showus',dir); 3261 opt.container.parent().find('.tp-rightarrow').click(); 3262 } else 3263 if (dir=="next") 3264 opt.container.parent().find('.tp-rightarrow').click(); 3265 else 3266 if (dir=="prev") 3267 opt.container.parent().find('.tp-leftarrow').click(); 3268 }); 3269 } 3270 } 3271 3272 3273 if (nextcaption.hasClass("coloredbg")) offsetx=0; 3274 if (offsetx<0) offsetx=0; 3275 3276 //var offsety = 0; //opt.height/2 - (opt.startheight*xbh)/2; 3277 3278 clearTimeout(nextcaption.data('timer')); 3279 clearTimeout(nextcaption.data('timer-end')); 3280 3281 3282 3283 // YOUTUBE AND VIMEO LISTENRES INITIALISATION 3284 3285 var frameID = "iframe"+Math.round(Math.random()*1000+1); 3286 3287 if (nextcaption.find('iframe').length>0) { 3288 3289 nextcaption.find('iframe').each(function() { 3290 var ifr=jQuery(this); 3291 3292 if (ifr.attr('src').toLowerCase().indexOf('youtube')>=0) { 3293 opt.nextslideatend = nextcaption.data('nextslideatend'); 3294 if (!ifr.hasClass("HasListener")) { 3295 try { 3296 ifr.attr('id',frameID); 3297 3298 var player; 3299 if (nextcaption.data('autoplay')==true) 3300 player = new YT.Player(frameID, { 3301 events: { 3302 "onStateChange": onPlayerStateChange, 3303 'onReady': onPlayerReady 3304 } 3305 }); 3306 else 3307 player = new YT.Player(frameID, { 3308 events: { 3309 "onStateChange": onPlayerStateChange 3310 } 3311 }); 3312 ifr.addClass("HasListener"); 3313 3314 nextcaption.data('player',player); 3315 3316 if (nextcaption.data('autoplay')==true) { 3317 var bt=jQuery('body').find('#'+opt.container.attr('id')).find('.tp-bannertimer'); 3318 setTimeout(function(){ 3319 bt.stop(); 3320 opt.videoplaying=true; 3321 },200); 3322 3323 3324 //console.log("VideoPlay set to True due youtube 1st load AutoPlay"); 3325 } 3326 } catch(e) {} 3327 } else { 3328 if (nextcaption.data('autoplay')==true) { 3329 3330 3331 var player=nextcaption.data('player'); 3332 nextcaption.data('timerplay',setTimeout(function() { 3333 player.playVideo(); 3334 },nextcaption.data('start'))); 3335 3336 var bt=jQuery('body').find('#'+opt.container.attr('id')).find('.tp-bannertimer'); 3337 setTimeout(function(){ 3338 bt.stop(); 3339 opt.videoplaying=true; 3340 },200); 3341 3342 3343 //console.log("VideoPlay set to True due youtube 2nd load AutoPlay"); 3344 } 3345 } 3346 3347 } else { 3348 if (ifr.attr('src').toLowerCase().indexOf('vimeo')>=0) { 3349 opt.nextslideatend = nextcaption.data('nextslideatend'); 3350 if (!ifr.hasClass("HasListener")) { 3351 ifr.addClass("HasListener"); 3352 ifr.attr('id',frameID);
3353 var isrc = ifr.attr('src'); 3354 var queryParameters = {}, queryString = isrc, 3355 re = /([^&=]+)=([^&]*)/g, m; 3356 // Creates a map with the query string parameters 3357 while (m = re.exec(queryString)) { 3358 queryParameters[decodeURIComponent(m[1])] = decodeURIComponent(m[2]); 3359 } 3360 3361 3362 if (queryParameters['player_id']!=undefined) { 3363 3364 isrc = isrc.replace(queryParameters['player_id'],frameID); 3365 } else { 3366 isrc=isrc+"&player_id="+frameID; 3367 } 3368 3369 try{ 3370 isrc = isrc.replace('api=0','api=1'); 3371 } catch(e) {} 3372 3373 isrc=isrc+"&api=1"; 3374 3375 3376 3377 ifr.attr('src',isrc); 3378 var player = nextcaption.find('iframe')[0]; 3379 if (nextcaption.data('autoplay')==true) { 3380 3381 $f(player).addEvent('ready', vimeoready_auto); 3382 //console.log('#'+opt.container.attr('id')); 3383 var bt=jQuery('body').find('#'+opt.container.attr('id')).find('.tp-bannertimer'); 3384 setTimeout(function(){ 3385 bt.stop(); 3386 opt.videoplaying=true; 3387 },200); 3388 3389 3390 //console.log("VideoPlay set to True due vimeo 1st load AutoPlay"); 3391 } else { 3392 $f(player).addEvent('ready', vimeoready); 3393 } 3394 3395 3396 } else { 3397 if (nextcaption.data('autoplay')==true) { 3398 3399 var ifr = nextcaption.find('iframe'); 3400 var id = ifr.attr('id'); 3401 var froogaloop = $f(id); 3402 nextcaption.data('timerplay',setTimeout(function() { 3403 froogaloop.api("play"); 3404 },nextcaption.data('start'))); 3405 var bt=jQuery('body').find('#'+opt.container.attr('id')).find('.tp-bannertimer'); 3406 setTimeout(function(){ 3407 bt.stop(); 3408 opt.videoplaying=true; 3409 },200); 3410 3411 3412 //console.log("VideoPlay set to True due youtube 2nd load AutoPlay"); 3413 } 3414 } 3415 3416 } 3417 } 3418 }); 3419 } 3420 3421 // IF HTML5 VIDEO IS EMBEDED 3422 if (nextcaption.find('video').length>0) { 3423 nextcaption.find('video').each(function(i) { 3424 var html5vid = jQuery(this).parent(); 3425 3426 if (html5vid.hasClass("video-js")) { 3427 opt.nextslideatend = nextcaption.data('nextslideatend'); 3428 if (!html5vid.hasClass("HasListener")) { 3429 html5vid.addClass("HasListener"); 3430 var videoID = "videoid_"+Math.round(Math.random()*1000+1); 3431 html5vid.attr('id',videoID); 3432 videojs(videoID).ready(function(){ 3433 html5vidready(this) 3434 }); 3435 } else { 3436 videoID = html5vid.attr('id'); 3437 } 3438 if (nextcaption.data('autoplay')==true) { 3439 3440 var bt=jQuery('body').find('#'+opt.container.attr('id')).find('.tp-bannertimer'); 3441 setTimeout(function(){ 3442 bt.stop(); 3443 opt.videoplaying=true; 3444 },200); 3445 3446 //console.log("VideoPlay set to True due HTML5 VIDEO 1st/2nd load AutoPlay"); 3447 3448 videojs(videoID).ready(function(){ 3449 var myPlayer = this; 3450 html5vid.data('timerplay',setTimeout(function() { 3451 myPlayer.play(); 3452 },nextcaption.data('start'))); 3453 }); 3454 } 3455 3456 3457 if (html5vid.data('ww') == undefined) html5vid.data('ww',html5vid.width()); 3458 if (html5vid.data('hh') == undefined) html5vid.data('hh',html5vid.height()); 3459 3460 videojs(videoID).ready(function(){ 3461 if (!nextcaption.hasClass("fullscreenvideo")) { 3462 var myPlayer = videojs(videoID); 3463 3464 try{ 3465 myPlayer.width(html5vid.data('ww')*opt.bw); 3466 myPlayer.height(html5vid.data('hh')*opt.bh); 3467 } catch(e) {} 3468 } 3469 }); 3470 3471 3472 } 3473 3474 }); 3475 } // END OF VIDEO JS FUNCTIONS 3476 3477 3478 3479 if (nextcaption.hasClass("randomrotate") && (opt.ie || opt.ie9)) nextcaption.removeClass("randomrotate").addClass("sfb"); 3480 nextcaption.removeClass('noFilterClass'); 3481 3482 3483 3484 var imw =0; 3485 var imh = 0; 3486 3487 if (nextcaption.find('img').length>0) { 3488 var im = nextcaption.find('img'); 3489 if (im.data('ww') == undefined) im.data('ww',im.width()); 3490 if (im.data('hh') == undefined) im.data('hh',im.height()); 3491 3492 var ww = im.data('ww'); 3493 var hh = im.data('hh'); 3494 3495 3496 im.width(ww*opt.bw); 3497 im.height(hh*opt.bh); 3498 imw = im.width(); 3499 imh = im.height(); 3500 } else { 3501 3502 if (nextcaption.find('iframe').length>0) { 3503 3504 var im = nextcaption.find('iframe'); 3505 if (nextcaption.data('ww') == undefined) { 3506 nextcaption.data('ww',im.width()); 3507 } 3508 if (nextcaption.data('hh') == undefined) nextcaption.data('hh',im.height()); 3509 3510 var ww = nextcaption.data('ww'); 3511 var hh = nextcaption.data('hh'); 3512 3513 var nc =nextcaption; 3514 if (nc.data('fsize') == undefined) nc.data('fsize',parseInt(nc.css('font-size'),0) || 0); 3515 if (nc.data('pt') == undefined) nc.data('pt',parseInt(nc.css('paddingTop'),0) || 0); 3516 if (nc.data('pb') == undefined) nc.data('pb',parseInt(nc.css('paddingBottom'),0) || 0); 3517 if (nc.data('pl') == undefined) nc.data('pl',parseInt(nc.css('paddingLeft'),0) || 0); 3518 if (nc.data('pr') == undefined) nc.data('pr',parseInt(nc.css('paddingRight'),0) || 0); 3519 3520 if (nc.data('mt') == undefined) nc.data('mt',parseInt(nc.css('marginTop'),0) || 0); 3521 if (nc.data('mb') == undefined) nc.data('mb',parseInt(nc.css('marginBottom'),0) || 0); 3522 if (nc.data('ml') == undefined) nc.data('ml',parseInt(nc.css('marginLeft'),0) || 0); 3523 if (nc.data('mr') == undefined) nc.data('mr',parseInt(nc.css('marginRight'),0) || 0); 3524 3525 if (nc.data('bt') == undefined) nc.data('bt',parseInt(nc.css('borderTop'),0) || 0); 3526 if (nc.data('bb') == undefined) nc.data('bb',parseInt(nc.css('borderBottom'),0) || 0); 3527 if (nc.data('bl') == undefined) nc.data('bl',parseInt(nc.css('borderLeft'),0) || 0); 3528 if (nc.data('br') == undefined) nc.data('br',parseInt(nc.css('borderRight'),0) || 0); 3529 3530 if (nc.data('lh') == undefined) nc.data('lh',parseInt(nc.css('lineHeight'),0) || 0); 3531 3532 var fvwidth=opt.width; 3533 var fvheight=opt.height; 3534 if (fvwidth>opt.startwidth) fvwidth=opt.startwidth; 3535 if (fvheight>
3535opt.startheight) fvheight=opt.startheight; 3536 3537 if (!nextcaption.hasClass('fullscreenvideo')) 3538 nextcaption.css({ 3539 3540 'font-size': (nc.data('fsize') * opt.bw)+"px", 3541 3542 'padding-top': (nc.data('pt') * opt.bh) + "px", 3543 'padding-bottom': (nc.data('pb') * opt.bh) + "px", 3544 'padding-left': (nc.data('pl') * opt.bw) + "px", 3545 'padding-right': (nc.data('pr') * opt.bw) + "px", 3546 3547 'margin-top': (nc.data('mt') * opt.bh) + "px", 3548 'margin-bottom': (nc.data('mb') * opt.bh) + "px", 3549 'margin-left': (nc.data('ml') * opt.bw) + "px", 3550 'margin-right': (nc.data('mr') * opt.bw) + "px", 3551 3552 'border-top': (nc.data('bt') * opt.bh) + "px", 3553 'border-bottom': (nc.data('bb') * opt.bh) + "px", 3554 'border-left': (nc.data('bl') * opt.bw) + "px", 3555 'border-right': (nc.data('br') * opt.bw) + "px", 3556 3557 'line-height': (nc.data('lh') * opt.bh) + "px", 3558 'height':(hh*opt.bh)+'px', 3559 'white-space':"nowrap" 3560 }); 3561 else { 3562 offsetx=0; offsety=0; 3563 nextcaption.css({ 3564 'width':opt.width, 3565 'height':opt.height 3566 }); 3567 } 3568 3569 3570 im.width(ww*opt.bw); 3571 im.height(hh*opt.bh); 3572 imw = im.width(); 3573 imh = im.height(); 3574 } else { 3575 3576 3577 nextcaption.find('.tp-resizeme, .tp-resizeme *').each(function() { 3578 calcCaptionResponsive(jQuery(this),opt); 3579 }); 3580 3581 if (nextcaption.hasClass("tp-resizeme")) { 3582 nextcaption.find('*').each(function() { 3583 calcCaptionResponsive(jQuery(this),opt); 3584 }); 3585 } 3586 3587 calcCaptionResponsive(nextcaption,opt); 3588 3589 imh=nextcaption.outerHeight(true); 3590 imw=nextcaption.outerWidth(true); 3591 3592 // NEXTCAPTION FRONTCORNER CHANGES 3593 var ncch = nextcaption.outerHeight(); 3594 var bgcol = nextcaption.css('backgroundColor'); 3595 nextcaption.find('.frontcorner').css({ 3596 'borderWidth':ncch+"px", 3597 'left':(0-ncch)+'px', 3598 'borderRight':'0px solid transparent', 3599 'borderTopColor':bgcol 3600 }); 3601 3602 nextcaption.find('.frontcornertop').css({ 3603 'borderWidth':ncch+"px", 3604 'left':(0-ncch)+'px', 3605 'borderRight':'0px solid transparent', 3606 'borderBottomColor':bgcol 3607 }); 3608 3609 // NEXTCAPTION BACKCORNER CHANGES 3610 nextcaption.find('.backcorner').css({ 3611 'borderWidth':ncch+"px", 3612 'right':(0-ncch)+'px', 3613 'borderLeft':'0px solid transparent', 3614 'borderBottomColor':bgcol 3615 }); 3616 3617 // NEXTCAPTION BACKCORNER CHANGES 3618 nextcaption.find('.backcornertop').css({ 3619 'borderWidth':ncch+"px", 3620 'right':(0-ncch)+'px', 3621 'borderLeft':'0px solid transparent', 3622 'borderTopColor':bgcol 3623 }); 3624 3625 } 3626 } 3627 3628 if (nextcaption.data('voffset')==undefined) nextcaption.data('voffset',0); 3629 if (nextcaption.data('hoffset')==undefined) nextcaption.data('hoffset',0); 3630 3631 var vofs= nextcaption.data('voffset')*xbw; 3632 var hofs= nextcaption.data('hoffset')*xbw; 3633 3634 var crw = opt.startwidth*xbw; 3635 var crh = opt.startheight*xbw; 3636 3637 3638 // CENTER THE CAPTION HORIZONTALLY 3639 if (nextcaption.data('x')=="center" || nextcaption.data('xcenter')=='center') { 3640 nextcaption.data('xcenter','center'); 3641 nextcaption.data('x',(crw/2 - nextcaption.outerWidth(true)/2)/xbw+ hofs); 3642 3643 } 3644 3645 // ALIGN LEFT THE CAPTION HORIZONTALLY 3646 if (nextcaption.data('x')=="left" || nextcaption.data('xleft')=='left') { 3647 nextcaption.data('xleft','left'); 3648 nextcaption.data('x',(0)/xbw+hofs); 3649 3650 } 3651 3652 // ALIGN RIGHT THE CAPTION HORIZONTALLY 3653 if (nextcaption.data('x')=="right" || nextcaption.data('xright')=='right') { 3654 nextcaption.data('xright','right'); 3655 nextcaption.data('x',((crw - nextcaption.outerWidth(true))+hofs)/xbw); 3656 //console.log("crw:"+crw+" width:"+nextcaption.outerWidth(true)+" xbw:"+xbw); 3657 //console.log("x-pos:"+nextcaption.data('x')) 3658 } 3659 3660 3661 // CENTER THE CAPTION VERTICALLY 3662 if (nextcaption.data('y')=="center" || nextcaption.data('ycenter')=='center') { 3663 nextcaption.data('ycenter','center'); 3664 nextcaption.data('y',(crh/2 - nextcaption.outerHeight(true)/2)/opt.bh + vofs); 3665 3666 } 3667 3668 // ALIGN TOP THE CAPTION VERTICALLY 3669 if (nextcaption.data('y')=="top" || nextcaption.data('ytop')=='top') { 3670 nextcaption.data('ytop','top'); 3671 nextcaption.data('y',(0)/opt.bh+vofs); 3672 3673 } 3674 3675 // ALIGN BOTTOM THE CAPTION VERTICALLY 3676 if (nextcaption.data('y')=="bottom" || nextcaption.data('ybottom')=='bottom') { 3677 nextcaption.data('ybottom','bottom'); 3678 nextcaption.data('y',((crh - nextcaption.outerHeight(true))+vofs)/xbw); 3679 } 3680 3681 3682 if (nextcaption.hasClass('fade')) { 3683 3684 nextcaption.css({'opacity':0,'left':(xbw*nextcaption.data('x')+offsetx)+'px','to
3684p':(opt.bh*nextcaption.data('y')+offsety)+"px"}); 3685 } 3686 3687 if (nextcaption.hasClass("randomrotate")) { 3688 3689 nextcaption.css({'left':(xbw*nextcaption.data('x')+offsetx)+'px','top':((xbh*nextcaption.data('y'))+offsety)+"px" }); 3690 var sc=Math.random()*2+1; 3691 var ro=Math.round(Math.random()*200-100); 3692 var xx=Math.round(Math.random()*200-100); 3693 var yy=Math.round(Math.random()*200-100); 3694 nextcaption.data('repx',xx); 3695 nextcaption.data('repy',yy); 3696 nextcaption.data('repo',nextcaption.css('opacity')); 3697 nextcaption.data('rotate',ro); 3698 nextcaption.data('scale',sc); 3699 3700 nextcaption.transition({opacity:0, scale:sc, rotate:ro, x:xx, y: yy,duration: '0ms'}); 3701 } else { 3702 if (opt.ie || opt.ie9 ) 3703 {} 3704 else { 3705 if (nextcaption.find('iframe').length==0) 3706 nextcaption.transition({ scale:1, rotate:0}); 3707 } 3708 } 3709 3710 if (nextcaption.hasClass('lfr')) { 3711 3712 nextcaption.css({'opacity':1,'left':(15+opt.width)+'px','top':(opt.bh*nextcaption.data('y')+offsety)+"px"}); 3713 3714 } 3715 3716 if (nextcaption.hasClass('lfl')) { 3717 3718 nextcaption.css({'opacity':1,'left':(-15-imw)+'px','top':(opt.bh*nextcaption.data('y')+offsety)+"px"}); 3719 3720 } 3721 3722 if (nextcaption.hasClass('sfl')) { 3723 3724 nextcaption.css({'opacity':0,'left':((xbw*nextcaption.data('x'))-50+offsetx)+'px','top':(opt.bh*nextcaption.data('y')+offsety)+"px"}); 3725 } 3726 3727 if (nextcaption.hasClass('sfr')) { 3728 nextcaption.css({'opacity':0,'left':((xbw*nextcaption.data('x'))+50+offsetx)+'px','top':(opt.bh*nextcaption.data('y')+offsety)+"px"}); 3729 } 3730 3731 3732 3733 3734 if (nextcaption.hasClass('lft')) { 3735 3736 nextcaption.css({'opacity':1,'left':(xbw*nextcaption.data('x')+offsetx)+'px','top':(-25 - imh)+"px"}); 3737 3738 } 3739 3740 if (nextcaption.hasClass('lfb')) { 3741 nextcaption.css({'opacity':1,'left':(xbw*nextcaption.data('x')+offsetx)+'px','top':(25+opt.height)+"px"}); 3742 3743 } 3744 3745 if (nextcaption.hasClass('sft')) { 3746 nextcaption.css({'opacity':0,'left':(xbw*nextcaption.data('x')+offsetx)+'px','top':((opt.bh*nextcaption.data('y')+offsety)-50)+"px"}); 3747 } 3748 3749 if (nextcaption.hasClass('sfb')) { 3750 nextcaption.css({'opacity':0,'left':(xbw*nextcaption.data('x')+offsetx)+'px','top':((opt.bh*nextcaption.data('y')+offsety)+50)+"px"}); 3751 } 3752 3753 3754 if (nextcaption.data('start') == undefined) nextcaption.data('start',1000); 3755 3756 3757 3758 nextcaption.data('timer',setTimeout(function() { 3759 var easetype=nextcaption.data('easing'); 3760 if (easetype==undefined) easetype="linear"; 3761 3762 if (nextcaption.hasClass("fullscreenvideo")) 3763 nextcaption.css({'display':'block'}); 3764 3765 3766 3767 nextcaption.css({'visibility':'visible'}); 3768 if (nextcaption.hasClass('fade')) { 3769 nextcaption.data('repo',nextcaption.css('opacity')); 3770 3771 //nextcaption.animate({'opacity':1},{duration:nextcaption.data('speed'),complete:function() { if (opt.ie) jQuery(this).addClass('noFilterClass');}}); 3772 nextcaption.transition({'opacity':1,duration:nextcaption.data('speed')}); 3773 //if (opt.ie) nextcaption.addClass('noFilterClass'); 3774 } 3775 3776 if (nextcaption.hasClass("randomrotate")) { 3777 3778 easetype = easetype.replace('Elastic','Back'); 3779 easetype = easetype.replace('Bounce','Back'); 3780 nextcaption.transition({opacity:1, scale:1, 'left':(xbw*nextcaption.data('x')+offsetx)+'px','top':(xbh*(nextcaption.data('y'))+offsety)+"px", rotate:0, x:0, y:0,duration: nextcaption.data('speed'), easing:easetype}); 3781 if (opt.ie) nextcaption.addClass('noFilterClass'); 3782 } 3783 3784 if (nextcaption.hasClass('lfr') || 3785 nextcaption.hasClass('lfl') || 3786 nextcaption.hasClass('sfr') || 3787 nextcaption.hasClass('sfl') || 3788 nextcaption.hasClass('lft') || 3789 nextcaption.hasClass('lfb') || 3790 nextcaption.hasClass('sft') || 3791 nextcaption.hasClass('sfb') 3792 ) 3793 { 3794 3795 nextcaption.data('repx',nextcaption.position().left); 3796 nextcaption.data('repy',nextcaption.position().top); 3797 3798 nextcaption.data('repo',nextcaption.css('opacity')); 3799 if (easetype.indexOf("Bounce")>=0 || easetype.indexOf("Elastic")>=0) 3800 nextcaption.animate({'opacity':1,'left':(xbw*nextcaption.data('x')+offsetx)+'px','to
3800p':opt.bh*(nextcaption.data('y'))+offsety+"px"},{duration:nextcaption.data('speed'), easing:easetype,complete:function() { if (opt.ie) jQuery(this).addClass('noFilterClass');}}); 3801 else 3802 nextcaption.transition({'opacity':1,'left':(xbw*nextcaption.data('x')+offsetx)+'px','top':opt.bh*(nextcaption.data('y'))+offsety+"px",duration:nextcaption.data('speed'), easing:easetype}); 3803 //if (opt.ie) nextcaption.addClass('noFilterClass'); 3804 } 3805 },nextcaption.data('start'))); 3806 3807 3808 // IF THERE IS ANY EXIT ANIM DEFINED 3809 if (nextcaption.data('end')!=undefined) 3810 3811 nextcaption.data('timer-end',setTimeout(function() { 3812 3813 if ((opt.ie || opt.ie9) && (nextcaption.hasClass("randomrotate") || nextcaption.hasClass("randomrotateout"))) { 3814 nextcaption.removeClass("randomrotate").removeClass("randomrotateout").addClass('fadeout'); 3815 } 3816 3817 endMoveCaption(nextcaption,opt); 3818 3819 },nextcaption.data('end'))); 3820 } 3821 }) 3822 3823 var bt=jQuery('body').find('#'+opt.container.attr('id')).find('.tp-bannertimer'); 3824 bt.data('opt',opt); 3825 } 3826 3827 3828 3829 ///////////////////////////////////////////////////////////////// 3830 // - CALCULATE THE RESPONSIVE SIZES OF THE CAPTIONS - // 3831 ///////////////////////////////////////////////////////////////// 3832 function calcCaptionResponsive(nc,opt) { 3833 if (nc.data('fsize') == undefined) nc.data('fsize',parseInt(nc.css('font-size'),0) || 0); 3834 if (nc.data('pt') == undefined) nc.data('pt',parseInt(nc.css('paddingTop'),0) || 0); 3835 if (nc.data('pb') == undefined) nc.data('pb',parseInt(nc.css('paddingBottom'),0) || 0); 3836 if (nc.data('pl') == undefined) nc.data('pl',parseInt(nc.css('paddingLeft'),0) || 0); 3837 if (nc.data('pr') == undefined) nc.data('pr',parseInt(nc.css('paddingRight'),0) || 0); 3838 3839 if (nc.data('mt') == undefined) nc.data('mt',parseInt(nc.css('marginTop'),0) || 0); 3840 if (nc.data('mb') == undefined) nc.data('mb',parseInt(nc.css('marginBottom'),0) || 0); 3841 if (nc.data('ml') == undefined) nc.data('ml',parseInt(nc.css('marginLeft'),0) || 0); 3842 if (nc.data('mr') == undefined) nc.data('mr',parseInt(nc.css('marginRight'),0) || 0); 3843 3844 if (nc.data('bt') == undefined) nc.data('bt',parseInt(nc.css('borderTopWidth'),0) || 0); 3845 if (nc.data('bb') == undefined) nc.data('bb',parseInt(nc.css('borderBottomWidth'),0) || 0); 3846 if (nc.data('bl') == undefined) nc.data('bl',parseInt(nc.css('borderLeftWidth'),0) || 0); 3847 if (nc.data('br') == undefined) nc.data('br',parseInt(nc.css('borderRightWidth'),0) || 0); 3848 3849 if (nc.data('lh') == undefined) nc.data('lh',parseInt(nc.css('lineHeight'),0) || 0); 3850 if (nc.data('minwidth') == undefined) nc.data('minwidth',parseInt(nc.css('minWidth'),0) || 0); 3851 if (nc.data('minheight') == undefined) nc.data('minheight',parseInt(nc.css('minHeight'),0) || 0); 3852 if (nc.data('maxwidth') == undefined) nc.data('maxwidth',parseInt(nc.css('maxWidth'),0) || "none"); 3853 if (nc.data('maxheight') == undefined) nc.data('maxheight',parseInt(nc.css('maxHeight'),0) || "none"); 3854 3855 3856 nc.css({ 3857 'font-size': Math.round((nc.data('fsize') * opt.bw))+"px", 3858 3859 'padding-top': Math.round((nc.data('pt') * opt.bh)) + "px", 3860 'padding-bottom': Math.round((nc.data('pb') * opt.bh)) + "px", 3861 'padding-left': Math.round((nc.data('pl') * opt.bw)) + "px", 3862 'padding-right': Math.round((nc.data('pr') * opt.bw)) + "px", 3863 3864 'margin-top': (nc.data('mt') * opt.bh) + "px", 3865 'margin-bottom': (nc.data('mb') * opt.bh) + "px", 3866 'margin-left': (nc.data('ml') * opt.bw) + "px", 3867 'margin-right': (nc.data('mr') * opt.bw) + "px", 3868 3869 'borderTopWidth': Math.round((nc.data('bt') * opt.bh)) + "px", 3870 'borderBottomWidth': Math.round((nc.data('bb') * opt.bh)) + "px", 3871 'borderLeftWidth': Math.round((nc.data('bl') * opt.bw)) + "px", 3872 'borderRightWidth': Math.round((nc.data('br') * opt.bw)) + "px", 3873 3874 'line-height': Math.round((nc.data('lh') * opt.bh)) + "px", 3875 'white-space':"nowrap", 3876 'minWidth':(nc.data('minwidth') * opt.bw) + "px", 3877 'minHeight':(nc.data('minheight') * opt.bh) + "px", 3878 }); 3879 3880 //console.log(nc.data('maxwidth')+" "+nc.data('maxheight')); 3881 if (nc.data('maxheight')!='none') 3882 nc.css({'maxHeight':(nc.data('maxheight') * opt.bh) + "px"}); 3883 3884 3885 if (nc.data('maxwidth')!='none') 3886 nc.css({'maxWidth':(nc.data('maxwidth') * opt.bw) + "px"}); 3887 } 3888 3889
3890 ////////////////////////// 3891 // REMOVE THE CAPTIONS // 3892 ///////////////////////// 3893 function removeTheCaptions(actli,opt) { 3894 3895 actli.find('.tp-caption').each(function(i) { 3896 var nextcaption=actli.find('.tp-caption:eq('+i+')'); 3897 nextcaption.stop(true,true); 3898 clearTimeout(nextcaption.data('timer')); 3899 clearTimeout(nextcaption.data('timer-end')); 3900 3901 var easetype=nextcaption.data('easing'); 3902 easetype="easeInOutSine"; 3903 var ll = nextcaption.data('repx'); 3904 var tt = nextcaption.data('repy'); 3905 var oo = nextcaption.data('repo'); 3906 var rot = nextcaption.data('rotate'); 3907 var sca = nextcaption.data('scale'); 3908 3909 3910 if (nextcaption.find('iframe').length>0) { 3911 // VIMEO VIDEO PAUSE 3912 try { 3913 var ifr = nextcaption.find('iframe'); 3914 var id = ifr.attr('id'); 3915 var froogaloop = $f(id); 3916 froogaloop.api("pause"); 3917 clearTimeout(nextcaption.data('timerplay')); 3918 } catch(e) {} 3919 //YOU TUBE PAUSE 3920 try { 3921 var player=nextcaption.data('player'); 3922 player.stopVideo(); 3923 clearTimeout(nextcaption.data('timerplay')); 3924 } catch(e) {} 3925 } 3926 3927 // IF HTML5 VIDEO IS EMBEDED 3928 if (nextcaption.find('video').length>0) { 3929 try{ 3930 nextcaption.find('video').each(function(i) { 3931 var html5vid = jQuery(this).parent(); 3932 var videoID =html5vid.attr('id'); 3933 clearTimeout(html5vid.data('timerplay')); 3934 videojs(videoID).ready(function(){ 3935 var myPlayer = this; 3936 myPlayer.pause(); 3937 }); 3938 }) 3939 }catch(e) {} 3940 } // END OF VIDEO JS FUNCTIONS 3941 try { 3942 /*if (rot!=undefined || sca!=undefined) 3943 { 3944 if (rot==undefined) rot=0; 3945 if (sca==undefined) sca=1; 3946 nextcaption.transition({'rotate':rot, 'scale':sca, 'opacity':0,'left':ll+'px','top':tt+"px"},(nextcaption.data('speed')+10), function() { nextcaption.removeClass('noFilterClass');nextcaption.css({'visibility':'hidden'})}); 3947 } else { 3948 3949 nextcaption.animate({'opacity':0,'left':ll+'px','top':tt+"px"},{duration:(nextcaption.data('speed')+10), easing:easetype, complete:function() { nextcaption.removeClass('noFilterClass');nextcaption.css({'visibility':'hidden'})}}); 3950 }*/ 3951 endMoveCaption(nextcaption,opt); 3952 } catch(e) {} 3953 3954 3955 3956 }); 3957 } 3958 3959 ////////////////////////// 3960 // MOVE OUT THE CAPTIONS // 3961 ///////////////////////// 3962 function endMoveCaption(nextcaption,opt) { 3963 3964 3965 if (nextcaption.hasClass("randomrotate") && (opt.ie || opt.ie9)) nextcaption.removeClass("randomrotate").addClass("sfb"); 3966 if (nextcaption.hasClass("randomrotateout") && (opt.ie || opt.ie9)) nextcaption.removeClass("randomrotateout").addClass("stb"); 3967 3968 var endspeed=nextcaption.data('endspeed'); 3969 if (endspeed==undefined) endspeed=nextcaption.data('speed'); 3970 3971 var xx=nextcaption.data('repx'); 3972 var yy=nextcaption.data('repy'); 3973 var oo=nextcaption.data('repo'); 3974 3975 if (opt.ie) { 3976 nextcaption.css({'opacity':'inherit','filter':'inherit'}); 3977 } 3978 3979 if (nextcaption.hasClass('ltr') || 3980 nextcaption.hasClass('ltl') || 3981 nextcaption.hasClass('str') || 3982 nextcaption.hasClass('stl') || 3983 nextcaption.hasClass('ltt') || 3984 nextcaption.hasClass('ltb') || 3985 nextcaption.hasClass('stt') || 3986 nextcaption.hasClass('stb') 3987 ) 3988 { 3989 3990 xx=nextcaption.position().left; 3991 yy=nextcaption.position().top; 3992 3993 if (nextcaption.hasClass('ltr')) 3994 xx=opt.width+60; 3995 else if (nextcaption.hasClass('ltl')) 3996 xx=0-nextcaption.width()-60; 3997 else if (nextcaption.hasClass('ltt')) 3998 yy=0-nextcaption.height()-60; 3999 else if (nextcaption.hasClass('ltb')) 4000 yy=opt.height+60; 4001 else if (nextcaption.hasClass('str')) { 4002 xx=xx+50;oo=0; 4003 } else if (nextcaption.hasClass('stl')) { 4004 xx=xx-50;oo=0; 4005 } else if (nextcaption.hasClass('stt')) { 4006 yy=yy-50;oo=0; 4007 } else if (nextcaption.hasClass('stb')) { 4008 yy=yy+50;oo=0; 4009 } 4010 4011 var easetype=nextcaption.data('endeasing'); 4012 if (easetype==undefined) easetype="linear"; 4013 if (easetype.indexOf("Bounce")>=0 || easetype.indexOf("Elastic")>=0) 4014 nextcaption.animate({'opacity':oo,'left':xx+'px','to
4014p':yy+"px"},{duration:nextcaption.data('endspeed'), easing:easetype,complete:function() { jQuery(this).css({visibility:'hidden'})}}); 4015 else 4016 nextcaption.transition({'opacity':oo,'left':xx+'px','top':yy+"px",duration:nextcaption.data('endspeed'), easing:easetype}); 4017 if (opt.ie) nextcaption.removeClass('noFilterClass'); 4018 4019 } 4020 4021 else 4022 4023 if ( nextcaption.hasClass("randomrotateout")) { 4024 4025 nextcaption.transition({opacity:0, scale:Math.random()*2+0.3, 'left':Math.random()*opt.width+'px','top':Math.random()*opt.height+"px", rotate:Math.random()*40, duration: endspeed, easing:easetype, complete:function() { jQuery(this).css({visibility:'hidden'})}}); 4026 if (opt.ie) nextcaption.removeClass('noFilterClass'); 4027 4028 } 4029 4030 else 4031 4032 if (nextcaption.hasClass('fadeout')) { 4033 if (opt.ie) nextcaption.removeClass('noFilterClass'); 4034 nextcaption.transition({'opacity':0,duration:200}); 4035 //nextcaption.animate({'opacity':0},{duration:200,complete:function() { jQuery(this).css({visibility:'hidden'})}}); 4036 4037 } 4038 4039 else 4040 4041 if (nextcaption.hasClass('lfr') || 4042 nextcaption.hasClass('lfl') || 4043 nextcaption.hasClass('sfr') || 4044 nextcaption.hasClass('sfl') || 4045 nextcaption.hasClass('lft') || 4046 nextcaption.hasClass('lfb') || 4047 nextcaption.hasClass('sft') || 4048 nextcaption.hasClass('sfb') 4049 ) 4050 { 4051 4052 if (nextcaption.hasClass('lfr')) 4053 xx=opt.width+60; 4054 else if (nextcaption.hasClass('lfl')) 4055 xx=0-nextcaption.width()-60; 4056 else if (nextcaption.hasClass('lft')) 4057 yy=0-nextcaption.height()-60; 4058 else if (nextcaption.hasClass('lfb')) 4059 yy=opt.height+60; 4060 4061 4062 var easetype=nextcaption.data('endeasing'); 4063 if (easetype==undefined) easetype="linear"; 4064 if (easetype.indexOf("Bounce")>=0 || easetype.indexOf("Elastic")>=0) 4065 nextcaption.animate({'opacity':oo,'left':xx+'px','top':yy+"px"},{duration:nextcaption.data('endspeed'), easing:easetype, complete:function() { jQuery(this).css({visibility:'hidden'})}}); 4066 else 4067 nextcaption.transition({'opacity':oo,'left':xx+'px','top':yy+"px",duration:nextcaption.data('endspeed'), easing:easetype}); 4068 if (opt.ie) nextcaption.removeClass('noFilterClass'); 4069 4070 } 4071 4072 else 4073 4074 if (nextcaption.hasClass('fade')) { 4075 4076 //nextcaption.animate({'opacity':0},{duration:endspeed,complete:function() { jQuery(this).css({visibility:'hidden'})} }); 4077 nextcaption.transition({'opacity':0,duration:endspeed }); 4078 if (opt.ie) nextcaption.removeClass('noFilterClass'); 4079 4080 } 4081 4082 else 4083 4084 if (nextcaption.hasClass("randomrotate")) { 4085 4086 nextcaption.transition({opacity:0, scale:Math.random()*2+0.3, 'left':Math.random()*opt.width+'px','top':Math.random()*opt.height+"px", rotate:Math.random()*40, duration: endspeed, easing:easetype }); 4087 if (opt.ie) nextcaption.removeClass('noFilterClass'); 4088 4089 } 4090 } 4091 4092 /////////////////////////// 4093 // REMOVE THE LISTENERS // 4094 /////////////////////////// 4095 function removeAllListeners(container,opt) { 4096 container.children().each(function() { 4097 try{ jQuery(this).die('click'); } catch(e) {} 4098 try{ jQuery(this).die('mouseenter');} catch(e) {} 4099 try{ jQuery(this).die('mouseleave');} catch(e) {} 4100 try{ jQuery(this).unbind('hover');} catch(e) {} 4101 }) 4102 try{ container.die('click','mouseenter','mouseleave');} catch(e) {} 4103 clearInterval(opt.cdint); 4104 container=null; 4105 4106 4107 4108 } 4109 4110 /////////////////////////// 4111 // - COUNTDOWN - // 4112 ///////////////////////// 4113 function countDown(container,opt) { 4114 opt.cd=0; 4115 opt.loop=0; 4116 if (opt.stopAfterLoops!=undefined && opt.stopAfterLoops>-1) 4117 opt.looptogo=opt.stopAfterLoops; 4118 else 4119 opt.looptogo=9999999; 4120 4121 if (opt.stopAtSlide!=undefined && opt.stopAtSlide>-1) 4122 opt.lastslidetoshow=opt.stopAtSlide; 4123 else 4124 opt.lastslidetoshow=999; 4125 4126 opt.stopLoop="off"; 4127 4128 if (opt.looptogo==0) opt.stopLoop="on"; 4129 4130 4131 4132 if (opt.slideamount >1 && !(opt.stopAfterLoops==0 && opt.stopAtSlide==1) ) { 4133 var bt=container.find('.tp-bannertimer'); 4134 if (bt.length>0) { 4135 bt.css({'width':'0%'}); 4136 bt.animate({'width':"100%"},{duration:(opt.delay-100),queue:false, easing:"linear"}); 4137 4138 } 4139 4140 bt.data('opt',opt); 4141 4142 4143 opt.cdint=setInterval(function() { 4144 4145 if (jQuery('body').find(container).length==0) removeAllListeners(container,opt); 4146 if (container.data('conthover-changed') == 1) { 4147 opt.conthover= container.data('conthover'); 4148 container.data('conthover-changed',0); 4149 } 4150 4151 if (opt.conthover!=1 && opt.videoplaying!=true && opt.width>opt.hideSliderAtLimit) opt.cd=opt.cd+100; 4152 4153 4154 if (opt.fullWidth!="on") 4155 if (opt.width>opt.hideSliderAtLimit) 4156 container.parent().removeClass("tp-hide-revslider") 4157 else 4158 container.parent().addClass("tp-hide-revslider") 4159 // EVENT TRIGGERING IN CASE VIDEO HAS BEEN STARTED 4160 if (opt.videostartednow==1) { 4161 container.trigger('revolution.slide.onvideoplay'); 4162 opt.videostartednow=0; 4163 } 4164 4165 // EVENT TRIGGERING IN CASE VIDEO HAS BEEN STOPPED 4166 if (opt.videostoppednow==1) { 4167 container.trigger('revolution.slide.onvideostop'); 4168 opt.videostoppednow=0; 4169 } 4170 4171 4172 if (opt.cd>=opt.delay) { 4173 opt.cd=0; 4174 // SWAP TO NEXT BANNER 4175 opt.act=opt.next; 4176 opt.next=opt.next+1; 4177 if (opt.next>container.find('>ul >li').length-1) { 4178 opt.next=0; 4179 opt.looptogo=opt.looptogo-1; 4180 4181 if (opt.looptogo<=0) { 4182 opt.stopLoop="on"; 4183 4184 } 4185 } 4186 4187 // STOP TIMER IF NO LOOP NO MORE NEEDED. 4188 4189 if (opt.stopLoop=="on" && opt.next==opt.lastslidetoshow-1) { 4190 clearInterval(opt.cdint); 4191 container.find('.tp-bannertimer').css({'visibility':'hidden'}); 4192 container.trigger('revolution.slide.onstop'); 4193 } 4194 4195 // SWAP THE SLIDES 4196 swapSlide(container,opt); 4197 4198 4199 // Clear the Timer 4200 if (bt.length>0) { 4201 bt.css({'width':'0%'}); 4202 bt.animate({'width':"100%"},{duration:(opt.delay-100),queue:false, easing:"linear"}); 4203 } 4204 } 4205 },100); 4206 4207 4208 container.hover( 4209 function() { 4210 4211 if (opt.onHoverStop=="on") { 4212 opt.conthover=1; 4213 bt.stop(); 4214 container.trigger('revolution.slide.onpause'); 4215 } 4216 }, 4217 function() { 4218 if (container.data('conthover')!=1) { 4219 container.trigger('revolution.slide.onresume'); 4220 opt.conthover=0; 4221 if (opt.onHoverStop=="on" && opt.videoplaying!=true) { 4222 bt.animate({'width':"100%"},{duration:((opt.delay-opt.cd)-100),queue:false, easing:"linear"}); 4223 } 4224 } 4225 }); 4226 } 4227 } 4228 4229 4230 4231})(jQuery);
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.