1// Camera slideshow v1.3.3 - a jQuery slideshow with many effects, transitions, easy to customize, using canvas and mobile ready, based on jQuery 1.4+ 2// Copyright (c) 2012 by Manuel Masia - www.pixedelic.com 3// Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php 4;(function($){$.fn.camera = function(opts, callback) { 5 6 var defaults = { 7 alignment : 'center', //topLeft, topCenter, topRight, centerLeft, center, centerRight, bottomLeft, bottomCenter, bottomRight 8 9 autoAdvance : true, //true, false 10 11 mobileAutoAdvance : true, //true, false. Auto-advancing for mobile devices 12 13 barDirection : 'leftToRight', //'leftToRight', 'rightToLeft', 'topToBottom', 'bottomToTop' 14 15 barPosition : 'bottom', //'bottom', 'left', 'top', 'right' 16 17 cols : 6, 18 19 easing : 'easeInOutExpo', //for the complete list http://jqueryui.com/demos/effect/easing.html 20 21 mobileEasing : '', //leave empty if you want to display the same easing on mobile devices and on desktop etc. 22 23 fx : 'random', //'random','simpleFade', 'curtainTopLeft', 'curtainTopRight', 'curtainBottomLeft', 'curtainBottomRight', 'curtainSliceLeft', 'curtainSliceRight', 'blindCurtainTopLeft', 'blindCurtainTopRight', 'blindCurtainBottomLeft', 'blindCurtainBottomRight', 'blindCurtainSliceBottom', 'blindCurtainSliceTop', 'stampede', 'mosaic', 'mosaicReverse', 'mosaicRandom', 'mosaicSpiral', 'mosaicSpiralReverse', 'topLeftBottomRight', 'bottomRightTopLeft', 'bottomLeftTopRight', 'bottomLeftTopRight' 24 //you can also use more than one effect, just separate them with commas: 'simpleFade, scrollRight, scrollBottom' 25 26 mobileFx : '', //leave empty if you want to display the same effect on mobile devices and on desktop etc. 27 28 gridDifference : 250, //to make the grid blocks slower than the slices, this value must be smaller than transPeriod 29 30 height : '50%', //here you can type pixels (for instance '300px'), a percentage (relative to the width of the slideshow, for instance '50%') or 'auto' 31 //#4840 32// imagePath : 'images/', //he path to the image folder (it serves for the blank.gif, when you want to display videos) 33 imagePath : 'css/jquery/camera/images/', 34 hover : true, //true, false. Puase on state hover. Not available for mobile devices 35 36 loader : 'pie', //pie, bar, none (even if you choose "pie", old browsers like IE8- can't display it... they will display always a loading bar) 37 38 loaderColor : '#eeeeee', 39 40 loaderBgColor : '#222222', 41 42 loaderOpacity : .8, //0, .1, .2, .3, .4, .5, .6, .7, .8, .9, 1 43 44 loaderPadding : 2, //how many empty pixels you want to display between the loader and its background 45 46 loaderStroke : 7, //the thickness both of the pie loader and of the bar loader. Remember: for the pie, the loader thickness must be less than a half of the pie diameter 47 48 minHeight : '200px', //you can also leave it blank 49 50 navigation : true, //true or false, to display or not the navigation buttons 51 52 navigationHover : true, //if true the navigation button (prev, next and play/stop buttons) will be visible on hover state only, if false they will be visible always 53 54 mobileNavHover : true, //same as above, but only for mobile devices 55 56 opacityOnGrid : false, //true, false. Decide to apply a fade effect to blocks and slices: if your slideshow is fullscreen or simply big, I recommend to set it false to have a smoother effect 57 58 overlayer : true, //a layer on the images to prevent the users grab them simply by clicking the right button of their mouse (.camera_overlayer) 59 60 pagination : true, 61 62 playPause : true, //true or false, to display or not the play/pause buttons 63 64 pauseOnClick : true, //true, false. It stops the slideshow when you click the sliders. 65 66 pieDiameter : 38, 67 68 piePosition : 'rightTop', //'rightTop', 'leftTop', 'leftBottom', 'rightBottom' 69 70 portrait : false, //true, false. Select true if you don't want that your images are cropped 71 72 rows : 4, 73 74 slicedCols : 12, //if 0 the same value of cols 75 76 slicedRows : 8, //if 0 the same value of rows 77 78 slideOn : 'random', //next, prev, random: decide if the transition effect will be applied to the current (prev) or the next slide 79 80 thumbnails : false, 81 82 time : 7000, //milliseconds between the end of the sliding effect and the start of the nex one 83 84 transPeriod : 1500, //lenght of the sliding effect in milliseconds 85 86////////callbacks 87 88 onEndTransition : function() { }, //this callback is invoked when the transition effect ends 89 90 onLoaded : function() { }, //this callback is invoked when the image on a slide has completely loaded 91 92 onStartLoading : function() { }, //this callback is invoked when the image on a slide start loading 93 94 onStartTransition : function() { }, //this callback is invoked when the transition effect starts 95 96 97 onMyStartTransition : function() { }, 98 startSlide : 1, 99 100 mySwipe : true 101 102 }; 103 104 105 function isMobile() { 106 if( navigator.userAgent.match(/Android/i) || 107 navigator.userAgent.match(/webOS/i) || 108 navigator.userAgent.match(/iPad/i) || 109 navigator.userAgent.match(/iPhone/i) || 110 navigator.userAgent.match(/iPod/i) 111 ){ 112 return true; 113 } 114 } 115 116 var opts = $.extend({}, defaults, opts); 117 118 var wrap = $(this).addClass('camera_wrap'); 119 120 wrap.wrapInner( 121 '<div class="camera_src" />' 122 ).wrapInner( 123 '<div class="camera_fakehover" />' 124 ); 125 126 var fakeHover = $('.camera_fakehover',wrap); 127 128 fakeHover.append( 129 '<div class="camera_target"></div>' 130 ); 131 if(opts.overlayer == true){ 132 fakeHover.append( 133 '<div class="camera_overlayer"></div>' 134 ) 135 } 136 fakeHover.append( 137 '<div class="camera_target_content"></div>' 138 ); 139 140 var loader; 141 142 if(opts.loader=='pie' && $.browser.msie && $.browser.version < 9){ 143 loader = 'bar'; 144 } else { 145 loader = opts.loader; 146 } 147 148 if(loader == 'pie'){ 149 fakeHover.append( 150 '<div class="camera_pie"></div>' 151 ) 152 } else if (loader == 'bar') { 153 fakeHover.append( 154 '<div class="camera_bar"></div>' 155 ) 156 } else { 157 fakeHover.append( 158 '<div class="camera_bar" style="display:none"></div>' 159 ) 160 } 161 162 if(opts.playPause==true){ 163 fakeHover.append( 164 '<div class="camera_commands"></div>' 165 ) 166 } 167 168 if(opts.navigation==true){ 169 fakeHover.append( 170 '<div class="camera_prev"><span></span></div>' 171 ).append( 172 '<div class="camera_next"><span></span></div>' 173 ); 174 } 175 176 if(opts.thumbnails==true){ 177 wrap.append( 178 '<div class="camera_thumbs_cont" />' 179 ); 180 } 181 182 if(opts.thumbnails==true && opts.pagination!=true){ 183 $('.camera_thumbs_cont',wrap).wrap( 184 '<div />' 185 ).wrap( 186 '<div class="camera_thumbs" />' 187 ).wrap( 188 '<div />' 189 ).wrap( 190 '<div class="camera_command_wrap" />' 191 ); 192 } 193 194 if(opts.pagination==true){ 195 wrap.append( 196 '<div class="camera_pag"></div>' 197 ); 198 } 199 200 wrap.append( 201 '<div class="camera_loader"></div>' 202 ); 203 204 $('.camera_caption',wrap).each(function(){ 205 $(this).wrapInner('<div />'); 206 }); 207 208 209 var pieID = 'pie_'+wrap.index(), 210 elem = $('.camera_src',wrap), 211 target = $('.camera_target',wrap), 212 content = $('.camera_target_content',wrap), 213 pieContainer = $('.camera_pie',wrap), 214 barContainer = $('.camera_bar',wrap), 215 prevNav = $('.camera_prev',wrap), 216 nextNav = $('.camera_next',wrap), 217 commands = $('.camera_commands',wrap), 218 pagination = $('.camera_pag',wrap), 219 thumbs = $('.camera_thumbs_cont',wrap); 220 221 222 var w, 223 h; 224 225 226 var allImg = new Array(); 227 var allalt = new Array(); 228 $('> div', elem).each( function() { 229 allImg.push($(this).attr('data-src')); 230 allalt.push($(this).attr('data-alt')); 231 }); 232 233 var allLinks = new Array(); 234 $('> div', elem).each( function() { 235 if($(this).attr('data-link')){ 236 allLinks.push($(this).attr('data-link')); 237 } else { 238 allLinks.push(''); 239 } 240 }); 241 242 var allTargets = new Array(); 243 $('> div', elem).each( function() { 244 if($(this).attr('data-target')){ 245 allTargets.push($(this).attr('data-target')); 246 } else { 247 allTargets.push(''); 248 } 249 }); 250 251 var allPor = new Array(); 252 $('> div', elem).each( function() { 253 if($(this).attr('data-portrait')){ 254 allPor.push($(this).attr('data-portrait')); 255 } else { 256 allPor.push(''); 257 } 258 }); 259 260 var allAlign= new Array(); 261 $('> div', elem).each( function() { 262 if($(this).attr('data-alignment')){ 263 allAlign.push($(this).attr('data-alignment')); 264 } else { 265 allAlign.push(''); 266 } 267 }); 268 269 270 var allThumbs = new Array(); 271 $('> div', elem).each( function() { 272 if($(this).attr('data-thumb')){ 273 allThumbs.push($(this).attr('data-thumb')); 274 } else { 275 allThumbs.push(''); 276 } 277 }); 278 279 var amountSlide = allImg.length; 280 281 $(content).append('<div class="cameraContents" />'); 282 var loopMove; 283 for (loopMove=0;loopMove<amountSlide;loopMove++) 284 { 285 $('.cameraContents',content).append('<div class="cameraContent" />');
286 if(allLinks[loopMove]!=''){ 287 //only for Wordpress plugin 288 var dataBox = $('> div ',elem).eq(loopMove).attr('data-box'); 289 if(typeof dataBox !== 'undefined' && dataBox !== false && dataBox != '') { 290 dataBox = 'data-box="'+$('> div ',elem).eq(loopMove).attr('data-box')+'"'; 291 } else { 292 dataBox = ''; 293 } 294 // 295 $('.camera_target_content .cameraContent:eq('+loopMove+')',wrap).append('<a class="camera_link" href="'+allLinks[loopMove]+'" '+dataBox+' target="'+allTargets[loopMove]+'"></a>'); 296 } 297 298 } 299 $('.camera_caption',wrap).each(function(){ 300 var ind = $(this).parent().index(), 301 cont = wrap.find('.cameraContent').eq(ind); 302 $(this).appendTo(cont); 303 }); 304 305 target.append('<div class="cameraCont" />'); 306 var cameraCont = $('.cameraCont',wrap); 307 308 309 310 var loop; 311 for (loop=0;loop<amountSlide;loop++) 312 { 313 cameraCont.append('<div class="cameraSlide cameraSlide_'+loop+'" />'); 314 var div = $('> div:eq('+loop+')',elem); 315 target.find('.cameraSlide_'+loop).clone(div); 316 } 317 318 319 function thumbnailVisible() { 320 var wTh = $(thumbs).width(); 321 $('li', thumbs).removeClass('camera_visThumb'); 322 $('li', thumbs).each(function(){ 323 var pos = $(this).position(), 324 ulW = $('ul', thumbs).outerWidth(), 325 offUl = $('ul', thumbs).offset().left, 326 offDiv = $('> div',thumbs).offset().left, 327 ulLeft = offDiv-offUl; 328 if(ulLeft>0){ 329 $('.camera_prevThumbs',camera_thumbs_wrap).removeClass('hideNav'); 330 } else { 331 $('.camera_prevThumbs',camera_thumbs_wrap).addClass('hideNav'); 332 } 333 if((ulW-ulLeft)>wTh){ 334 $('.camera_nextThumbs',camera_thumbs_wrap).removeClass('hideNav'); 335 } else { 336 $('.camera_nextThumbs',camera_thumbs_wrap).addClass('hideNav'); 337 } 338 var left = pos.left, 339 right = pos.left+($(this).width()); 340 if(right-ulLeft<=wTh && left-ulLeft>=0){ 341 $(this).addClass('camera_visThumb'); 342 } 343 }); 344 } 345 346 $(window).bind('load resize pageshow',function(){ 347 thumbnailPos(); 348 thumbnailVisible(); 349 }); 350 351 352 cameraCont.append('<div class="cameraSlide cameraSlide_'+loop+'" />'); 353 354 355 var started; 356 357 wrap.show(); 358 var w = target.width(); 359 var h = target.height(); 360 361 var setPause; 362 363 $(window).bind('resize pageshow',function(){ 364 if(started == true) { 365 resizeImage(); 366 } 367 $('ul', thumbs).animate({'margin-top':0},0,thumbnailPos); 368 if(!elem.hasClass('paused')){ 369 elem.addClass('paused'); 370 if($('.camera_stop',camera_thumbs_wrap).length){ 371 $('.camera_stop',camera_thumbs_wrap).hide() 372 $('.camera_play',camera_thumbs_wrap).show(); 373 if(loader!='none'){ 374 $('#'+pieID).hide(); 375 } 376 } else { 377 if(loader!='none'){ 378 $('#'+pieID).hide(); 379 } 380 } 381 clearTimeout(setPause); 382 setPause = setTimeout(function(){ 383 elem.removeClass('paused'); 384 if($('.camera_play',camera_thumbs_wrap).length){ 385 $('.camera_play',camera_thumbs_wrap).hide(); 386 $('.camera_stop',camera_thumbs_wrap).show(); 387 if(loader!='none'){ 388 $('#'+pieID).fadeIn(); 389 } 390 } else { 391 if(loader!='none'){ 392 $('#'+pieID).fadeIn(); 393 } 394 } 395 },1500); 396 } 397 }); 398 399 function resizeImage(){ 400 var res; 401 function resizeImageWork(){ 402 w = wrap.width(); 403 if(opts.height.indexOf('%')!=-1) { 404 var startH = Math.round(w / (100/parseFloat(opts.height))); 405 if(opts.minHeight != '' && startH < parseFloat(opts.minHeight)){ 406 h = parseFloat(opts.minHeight); 407 } else { 408 h = startH; 409 } 410 wrap.css({height:h}); 411 } else if (opts.height=='auto') { 412 h = wrap.height(); 413 } else { 414 h = parseFloat(opts.height); 415 wrap.css({height:h}); 416 } 417 $('.camerarelative',target).css({'width':w,'height':h}); 418 $('.imgLoaded',target).each(function(){ 419 var t = $(this), 420 wT = t.attr('width'), 421 hT = t.attr('height'), 422 imgLoadIn = t.index(), 423 mTop, 424 mLeft, 425 alignment = t.attr('data-alignment'), 426 portrait = t.attr('data-portrait'); 427 428 if(typeof alignment === 'undefined' || alignment === false || alignment === ''){ 429 alignment = opts.alignment; 430 } 431 432 if(typeof portrait === 'undefined' || portrait === false || portrait === ''){
433 portrait = opts.portrait; 434 } 435 436 if(portrait==false||portrait=='false'){ 437 if((wT/hT)<(w/h)) { 438 var r = w / wT; 439 var d = (Math.abs(h - (hT*r)))*0.5; 440 switch(alignment){ 441 case 'topLeft': 442 mTop = 0; 443 break; 444 case 'topCenter': 445 mTop = 0; 446 break; 447 case 'topRight': 448 mTop = 0; 449 break; 450 case 'centerLeft': 451 mTop = '-'+d+'px'; 452 break; 453 case 'center': 454 mTop = '-'+d+'px'; 455 break; 456 case 'centerRight': 457 mTop = '-'+d+'px'; 458 break; 459 case 'bottomLeft': 460 mTop = '-'+d*2+'px'; 461 break; 462 case 'bottomCenter': 463 mTop = '-'+d*2+'px'; 464 break; 465 case 'bottomRight': 466 mTop = '-'+d*2+'px'; 467 break; 468 } 469 t.css({ 470 'height' : hT*r, 471 'margin-left' : 0, 472 'margin-top' : mTop, 473 'position' : 'absolute', 474 'visibility' : 'visible', 475 'width' : w 476 }); 477 } 478 else { 479 var r = h / hT; 480 var d = (Math.abs(w - (wT*r)))*0.5; 481 switch(alignment){ 482 case 'topLeft': 483 mLeft = 0; 484 break; 485 case 'topCenter': 486 mLeft = '-'+d+'px'; 487 break; 488 case 'topRight': 489 mLeft = '-'+d*2+'px'; 490 break; 491 case 'centerLeft': 492 mLeft = 0; 493 break; 494 case 'center': 495 mLeft = '-'+d+'px'; 496 break; 497 case 'centerRight': 498 mLeft = '-'+d*2+'px'; 499 break; 500 case 'bottomLeft': 501 mLeft = 0; 502 break; 503 case 'bottomCenter': 504 mLeft = '-'+d+'px'; 505 break; 506 case 'bottomRight': 507 mLeft = '-'+d*2+'px'; 508 break; 509 } 510 t.css({ 511 'height' : h, 512 'margin-left' : mLeft, 513 'margin-top' : 0, 514 'position' : 'absolute', 515 'visibility' : 'visible', 516 'width' : wT*r 517 }); 518 } 519 } else { 520 if((wT/hT)<(w/h)) { 521 var r = h / hT; 522 var d = (Math.abs(w - (wT*r)))*0.5; 523 switch(alignment){ 524 case 'topLeft': 525 mLeft = 0; 526 break; 527 case 'topCenter': 528 mLeft = d+'px'; 529 break; 530 case 'topRight': 531 mLeft = d*2+'px'; 532 break; 533 case 'centerLeft': 534 mLeft = 0; 535 break; 536 case 'center': 537 mLeft = d+'px'; 538 break; 539 case 'centerRight': 540 mLeft = d*2+'px'; 541 break; 542 case 'bottomLeft': 543 mLeft = 0; 544 break; 545 case 'bottomCenter': 546 mLeft = d+'px'; 547 break; 548 case 'bottomRight': 549 mLeft = d*2+'px'; 550 break; 551 } 552 t.css({ 553 'height' : h, 554 'margin-left' : mLeft, 555 'margin-top' : 0, 556 'position' : 'absolute', 557 'visibility' : 'visible', 558 'width' : wT*r 559 }); 560 } 561 else { 562 var r = w / wT; 563 var d = (Math.abs(h - (hT*r)))*0.5; 564 switch(alignment){ 565 case 'topLeft': 566 mTop = 0; 567 break; 568 case 'topCenter': 569 mTop = 0; 570 break; 571 case 'topRight': 572 mTop = 0; 573 break; 574 case 'centerLeft': 575 mTop = d+'px'; 576 break; 577 case 'center': 578 mTop = d+'px'; 579 break; 580 case 'centerRight': 581 mTop = d+'px'; 582 break; 583 case 'bottomLeft': 584 mTop = d*2+'px'; 585 break; 586 case 'bottomCenter': 587 mTop = d*2+'px'; 588 break; 589 case 'bottomRight': 590 mTop = d*2+'px'; 591 break; 592 } 593 t.css({ 594 'height' : hT*r, 595 'margin-left' : 0, 596 'margin-top' : mTop, 597 'position' : 'absolute', 598 'visibility' : 'visible', 599 'width' : w 600 }); 601 } 602 } 603 }); 604 } 605 if (started == true) { 606 clearTimeout(res); 607 res = setTimeout(resizeImageWork,200); 608 } else { 609 resizeImageWork(); 610 } 611 612 started = true; 613 } 614 615 616 var u, 617 setT; 618 619 var clickEv, 620 autoAdv, 621 navHover, 622 commands, 623 pagination; 624 625 var videoHover, 626 videoPresent; 627 628 if(isMobile() && opts.mobileAutoAdvance!=''){ 629 autoAdv = opts.mobileAutoAdvance; 630 } else { 631 autoAdv = opts.autoAdvance; 632 } 633 634 if(autoAdv==false){ 635 elem.addClass('paused'); 636 } 637 638 if(isMobile() && opts.mobileNavHover!=''){ 639 navHover = opts.mobileNavHover; 640 } else { 641 navHover = opts.navigationHover; 642 } 643 644 if(elem.length!=0){ 645 646 var selector = $('.cameraSlide',target); 647 selector.wrapInner('<div class="camerarelative" />'); 648 649 var navSlide; 650 651 var barDirection = opts.barDirection; 652 653 var camera_thumbs_wrap = wrap; 654 655 656 $('iframe',fakeHover).each(function(){ 657 var t = $(this); 658 var src = t.attr('src'); 659 t.attr('data-src',src); 660 var divInd = t.parent().index('.camera_src > div'); 661 $('.camera_target_content .cameraContent:eq('+divInd+')',wrap).append(t); 662 }); 663 function imgFake() { 664 $('iframe',fakeHover).each(function(){ 665 $('.camera_caption',fakeHover).show(); 666 var t = $(this); 667 var cloneSrc = t.attr('data-src'); 668 t.attr('src',cloneSrc); 669 var imgFakeUrl = opts.imagePath+'blank.gif'; 670 var imgFake = new Image(); 671 imgFake.src = imgFakeUrl; 672 if(opts.height.indexOf('%')!=-1) { 673 var startH = Math.round(w / (100/parseFloat(opts.height))); 674 if(opts.minHeight != '' && startH < parseFloat(opts.minHeight)){ 675 h = parseFloat(opts.minHeight); 676 } else { 677 h = startH; 678 } 679 } else if (opts.height=='auto') { 680 h = wrap.height(); 681 } else { 682 h = parseFloat(opts.height); 683 } 684 t.after($(imgFake).attr({'class':'imgFake','width':w,'height':h})); 685 var clone = t.clone(); 686 t.remove(); 687 $(imgFake).bind('click',function(){ 688 if($(this).css('position')=='absolute') { 689 $(this).remove(); 690 if(cloneSrc.indexOf('vimeo') != -1 || cloneSrc.indexOf('youtube') != -1) { 691 if(cloneSrc.indexOf('?') != -1){ 692 autoplay = '&autoplay=1'; 693 } else { 694 autoplay = '?autoplay=1'; 695 } 696 } else if(cloneSrc.indexOf('dailymotion') != -1) { 697 if(cloneSrc.indexOf('?') != -1){ 698 autoplay = '&autoPlay=1'; 699 } else { 700 autoplay = '?autoPlay=1'; 701 } 702 }else{ 703 //#4840 704 autoplay = ""; 705 } 706 clone.attr('src',cloneSrc+autoplay); 707 videoPresent = true; 708 } else { 709 $(this).css({position:'absolute',top:0,left:0,zIndex:10}).after(clone); 710 clone.css({position:'absolute',top:0,left:0,zIndex:9}); 711 } 712 });
713 }); 714 } 715 716 imgFake(); 717 718 719 if(opts.hover==true){ 720 if(!isMobile()){ 721 fakeHover.hover(function(){ 722 elem.addClass('hovered'); 723 },function(){ 724 elem.removeClass('hovered'); 725 }); 726 } 727 } 728 729 if(navHover==true){ 730 $(prevNav,wrap).animate({opacity:0},0); 731 $(nextNav,wrap).animate({opacity:0},0); 732 $(commands,wrap).animate({opacity:0},0); 733 if(isMobile()){ 734 fakeHover.live('vmouseover',function(){ 735 $(prevNav,wrap).animate({opacity:1},200); 736 $(nextNav,wrap).animate({opacity:1},200); 737 $(commands,wrap).animate({opacity:1},200); 738 }); 739 fakeHover.live('vmouseout',function(){ 740 $(prevNav,wrap).delay(500).animate({opacity:0},200); 741 $(nextNav,wrap).delay(500).animate({opacity:0},200); 742 $(commands,wrap).delay(500).animate({opacity:0},200); 743 }); 744 } else { 745 fakeHover.hover(function(){ 746 $(prevNav,wrap).animate({opacity:1},200); 747 $(nextNav,wrap).animate({opacity:1},200); 748 $(commands,wrap).animate({opacity:1},200); 749 },function(){ 750 $(prevNav,wrap).animate({opacity:0}
750,200); 751 $(nextNav,wrap).animate({opacity:0},200); 752 $(commands,wrap).animate({opacity:0},200); 753 }); 754 } 755 } 756 757 758 $('.camera_stop',camera_thumbs_wrap).live('click',function(){ 759 autoAdv = false; 760 elem.addClass('paused'); 761 if($('.camera_stop',camera_thumbs_wrap).length){ 762 $('.camera_stop',camera_thumbs_wrap).hide() 763 $('.camera_play',camera_thumbs_wrap).show(); 764 if(loader!='none'){ 765 $('#'+pieID).hide(); 766 } 767 } else { 768 if(loader!='none'){ 769 $('#'+pieID).hide(); 770 } 771 } 772 }); 773 774 $('.camera_play',camera_thumbs_wrap).live('click',function(){ 775 autoAdv = true; 776 elem.removeClass('paused'); 777 if($('.camera_play',camera_thumbs_wrap).length){ 778 $('.camera_play',camera_thumbs_wrap).hide(); 779 $('.camera_stop',camera_thumbs_wrap).show(); 780 if(loader!='none'){ 781 $('#'+pieID).show(); 782 } 783 } else { 784 if(loader!='none'){ 785 $('#'+pieID).show(); 786 } 787 } 788 }); 789 790 if(opts.pauseOnClick==true){ 791 $('.camera_target_content',fakeHover).mouseup(function(){ 792 autoAdv = false; 793 elem.addClass('paused'); 794 $('.camera_stop',camera_thumbs_wrap).hide() 795 $('.camera_play',camera_thumbs_wrap).show(); 796 $('#'+pieID).hide(); 797 }); 798 } 799 $('.cameraContent, .imgFake',fakeHover).hover(function(){ 800 videoHover = true; 801 },function(){ 802 videoHover = false; 803 }); 804 805 $('.cameraContent, .imgFake',fakeHover).bind('click',function(){ 806 if(videoPresent == true && videoHover == true) { 807 autoAdv = false; 808 $('.camera_caption',fakeHover).hide(); 809 elem.addClass('paused'); 810 $('.camera_stop',camera_thumbs_wrap).hide() 811 $('.camera_play',camera_thumbs_wrap).show(); 812 $('#'+pieID).hide(); 813 } 814 }); 815 816 817 } 818 819 820 function shuffle(arr) { 821 for( 822 var j, x, i = arr.length; i; 823 j = parseInt(Math.random() * i), 824 x = arr[--i], arr[i] = arr[j], arr[j] = x 825 ); 826 return arr; 827 } 828 829 function isInteger(s) { 830 return Math.ceil(s) == Math.floor(s); 831 } 832 833 if (loader != 'pie') { 834 barContainer.append('<span class="camera_bar_cont" />'); 835 $('.camera_bar_cont',barContainer) 836 .animate({opacity:opts.loaderOpacity},0) 837 .css({'position':'absolute', 'left':0, 'right':0, 'top':0, 'bottom':0, 'background-color':opts.loaderBgColor}) 838 .append('<span id="'+pieID+'" />'); 839 $('#'+pieID).animate({opacity:0}
839,0); 840 var canvas = $('#'+pieID); 841 canvas.css({'position':'absolute', 'background-color':opts.loaderColor}); 842 switch(opts.barPosition){ 843 case 'left': 844 barContainer.css({right:'auto',width:opts.loaderStroke}); 845 break; 846 case 'right': 847 barContainer.css({left:'auto',width:opts.loaderStroke}); 848 break; 849 case 'top': 850 barContainer.css({bottom:'auto',height:opts.loaderStroke}); 851 break; 852 case 'bottom': 853 barContainer.css({top:'auto',height:opts.loaderStroke}); 854 break; 855 } 856 switch(barDirection){ 857 case 'leftToRight': 858 canvas.css({'left':0, 'right':0, 'top':opts.loaderPadding, 'bottom':opts.loaderPadding}); 859 break; 860 case 'rightToLeft': 861 canvas.css({'left':0, 'right':0, 'top':opts.loaderPadding, 'bottom':opts.loaderPadding}); 862 break; 863 case 'topToBottom': 864 canvas.css({'left':opts.loaderPadding, 'right':opts.loaderPadding, 'top':0, 'bottom':0}); 865 break; 866 case 'bottomToTop': 867 canvas.css({'left':opts.loaderPadding, 'right':opts.loaderPadding, 'top':0, 'bottom':0}); 868 break; 869 } 870 } else { 871 pieContainer.append('<canvas id="'+pieID+'"></canvas>'); 872 var G_vmlCanvasManager; 873 var canvas = document.getElementById(pieID); 874 canvas.setAttribute("width", opts.pieDiameter); 875 canvas.setAttribute("height", opts.pieDiameter); 876 var piePosition; 877 switch(opts.piePosition){ 878 case 'leftTop' : 879 piePosition = 'left:0; top:0;'; 880 break; 881 case 'rightTop' : 882 piePosition = 'right:0; top:0;'; 883 break; 884 case 'leftBottom' : 885 piePosition = 'left:0; bottom:0;'; 886 break; 887 case 'rightBottom' : 888 piePosition = 'right:0; bottom:0;'; 889 break; 890 } 891 canvas.setAttribute("style", "position:absolute; z-index:1002; "+piePosition); 892 var rad; 893 var radNew; 894 895 if (canvas && canvas.getContext) { 896 var ctx = canvas.getContext("2d"); 897 ctx.rotate(Math.PI*(3/2)); 898 ctx.translate(-opts.pieDiameter,0); 899 } 900 901 } 902 if(loader=='none' || autoAdv==false) { 903 $('#'+pieID).hide(); 904 $('.camera_canvas_wrap',camera_thumbs_wrap).hide(); 905 } 906 907 if($(pagination).length) { 908 $(pagination).append('<ul class="camera_pag_ul" />'); 909 var li; 910 for (li = 0; li < amountSlide; li++){ 911 $('.camera_pag_ul',wrap).append('<li class="pag_nav_'+li+'" style="position:relative; z-index:1002"><span><span>'+li+'</span></span></li>'); 912 } 913 $('.camera_pag_ul li',wrap).hover(function(){ 914 $(this).addClass('camera_hover'); 915 if($('.camera_thumb',this).length){ 916 var wTh = $('.camera_thumb',this).outerWidth(), 917 hTh = $('.camera_thumb',this).outerHeight(), 918 wTt = $(this).outerWidth(); 919 920 //dakeshita 921 //$('.camera_thumb',this).show().css({'top':'-'+hTh+'px','left':'-'+(wTh-wTt)/2+'px'}).animate({'opacity':1,'margin-top':'-3px'},200); 922 //$('.thumb_arrow',this).show().animate({'opacity':1,'margin-top':'-3px'},200); 923 $('.camera_thumb',this).show().css({'top':'25px','left':'-'+(wTh-wTt)/2+'px'}).animate({'opacity':1,'margin-top':'3px'},200); 924 $('.thumb_arrow',this).hide(); 925 } 926 },function(){ 927 $(this).removeClass('camera_hover'); 928 $('.camera_thumb',this).animate({'margin-top':'-20px','opacity':0},200,function(){ 929 $(this).css({marginTop:'5px'}).hide(); 930 }); 931 $('.thumb_arrow',this).animate({'margin-top':'-20px','opacity':0},200,function(){ 932 $(this).css({marginTop:'5px'}).hide(); 933 }); 934 }); 935 } 936 937 938 939 if($(thumbs).length) { 940 var thumbUrl; 941 if(!$(pagination).length) { 942 $(thumbs).append('<div />'); 943 $(thumbs).before('<div class="camera_prevThumbs hideNav"><div></div></div>').before('<div class="camera_nextThumbs hideNav"><div></div></div>'); 944 $('> div',thumbs).append('<ul />'); 945 $.each(allThumbs, function(i, val) { 946 if($('> div', elem).eq(i).attr('data-thumb')!='') { 947 var thumbUrl = $('> div', elem).eq(i).attr('data-thumb'), 948 newImg = new Image(); 949 newImg.src = thumbUrl; 950 $('ul',thumbs).append('<li class="pix_thumb pix_thumb_'+i+'" />'); 951 $('li.pix_thumb_'+i,thumbs).append($(newImg).attr('class','camera_thumb')); 952 } 953 }); 954 } else { 955 $.each(allThumbs, function(i, val) { 956 if($('> div', elem).eq(i).attr('data-thumb')!='') { 957 var thumbUrl = $('> div', elem).eq(i).attr('data-thumb'), 958 newImg = new Image(); 959 newImg.src = thumbUrl; 960 $('li.pag_nav_'+i,pagination).append($(newImg).attr('class','camera_thumb').css({'position':'absolute'}).animate({opacity:0}
960,0)); 961 $('li.pag_nav_'+i+' > img',pagination).after('<div class="thumb_arrow" />'); 962 $('li.pag_nav_'+i+' > .thumb_arrow',pagination).animate({opacity:0},0); 963 } 964 }); 965 //wrap.css({marginBottom:$(pagination).outerHeight()}); 966 } 967 } else if(!$(thumbs).length && $(pagination).length) { 968 //wrap.css({marginBottom:$(pagination).outerHeight()}); 969 } 970 971 972 var firstPos = true; 973 974 function thumbnailPos() { 975 if($(thumbs).length && !$(pagination).length) { 976 var wTh = $(thumbs).outerWidth(), 977 owTh = $('ul > li',thumbs).outerWidth(), 978 pos = $('li.cameracurrent', thumbs).length ? $('li.cameracurrent', thumbs).position() : '', 979 ulW = ($('ul > li', thumbs).length * $('ul > li', thumbs).outerWidth()), 980 offUl = $('ul', thumbs).offset().left, 981 offDiv = $('> div', thumbs).offset().left, 982 ulLeft; 983 984 if(offUl<0){ 985 ulLeft = '-'+ (offDiv-offUl); 986 } else { 987 ulLeft = offDiv-offUl; 988 } 989 990 991 992 if(firstPos == true) { 993 $('ul', thumbs).width($('ul > li', thumbs).length * $('ul > li', thumbs).outerWidth()); 994 if($(thumbs).length && !$(pagination).lenght) { 995 //wrap.css({marginBottom:$(thumbs).outerHeight()}); 996 } 997 thumbnailVisible(); 998 /*I repeat this two lines because of a problem with iPhones*/ 999 $('ul', thumbs).width($('ul > li', thumbs).length * $('ul > li', thumbs).outerWidth()); 1000 if($(thumbs).length && !$(pagination).lenght) { 1001 //wrap.css({marginBottom:$(thumbs).outerHeight()}); 1002 } 1003 /*...*/ 1004 } 1005 firstPos = false; 1006 1007 var left = $('li.cameracurrent', thumbs).length ? pos.left : '', 1008 right = $('li.cameracurrent', thumbs).length ? pos.left+($('li.cameracurrent', thumbs).outerWidth()) : ''; 1009 if(left<$('li.cameracurrent', thumbs).outerWidth()) { 1010 left = 0; 1011 } 1012 if(right-ulLeft>wTh){ 1013 if((left+wTh)<ulW){ 1014 $('ul', thumbs).animate({'margin-left':'-'+(left)+'px'},500,thumbnailVisible); 1015 } else { 1016 $('ul', thumbs).animate({'margin-left':'-'+($('ul', thumbs).outerWidth()-wTh)+'px'},500,thumbnailVisible); 1017 } 1018 } else if(left-ulLeft<0) { 1019 $('ul', thumbs).animate({'margin-left':'-'+(left)+'px'},500,thumbnailVisible); 1020 } else { 1021 $('ul', thumbs).css({'margin-left':'auto', 'margin-right':'auto'}); 1022 setTimeout(thumbnailVisible,100); 1023 } 1024 1025 } 1026 } 1027 1028 if($(commands).length) { 1029 $(commands).append('<div class="camera_play"></div>').append('<div class="camera_stop"></div>'); 1030 if(autoAdv==true){ 1031 $('.camera_play',camera_thumbs_wrap).hide(); 1032 $('.camera_stop',camera_thumbs_wrap).show(); 1033 } else { 1034 $('.camera_stop',camera_thumbs_wrap).hide(); 1035 $('.camera_play',camera_thumbs_wrap).show(); 1036 } 1037 1038 } 1039 1040 1041 function canvasLoader() { 1042 rad = 0; 1043 var barWidth = $('.camera_bar_cont',camera_thumbs_wrap).width(), 1044 barHeight = $('.camera_bar_cont',camera_thumbs_wrap).height(); 1045 1046 if (loader != 'pie') { 1047 switch(barDirection){ 1048 case 'leftToRight': 1049 $('#'+pieID).css({'right':barWidth}); 1050 break; 1051 case 'rightToLeft': 1052 $('#'+pieID).css({'left':barWidth}); 1053 break; 1054 case 'topToBottom': 1055 $('#'+pieID).css({'bottom':barHeight}); 1056 break; 1057 case 'bottomToTop': 1058 $('#'+pieID).css({'top':barHeight}); 1059 break; 1060 } 1061 } else { 1062 ctx.clearRect(0,0,opts.pieDiameter,opts.pieDiameter); 1063 } 1064 } 1065 1066 1067 canvasLoader(); 1068 1069 1070 $('.moveFromLeft, .moveFromRight, .moveFromTop, .moveFromBottom, .fadeIn, .fadeFromLeft, .fadeFromRight, .fadeFromTop, .fadeFromBottom',fakeHover).each(function(){ 1071 $(this).css('visibility','hidden'); 1072 }); 1073 1074 opts.onStartLoading.call(this); 1075 1076 nextSlide(opts.startSlide); 1077 1078 1079 /*************************** FUNCTION nextSlide() ***************************/ 1080 1081 function nextSlide(navSlide){ 1082 elem.addClass('camerasliding'); 1083 1084 videoPresent = false; 1085 var vis = parseFloat($('div.cameraSlide.cameracurrent',target).index()); 1086 1087 if(navSlide>0){ 1088 var slideI = navSlide-1; 1089 } else if (vis == amountSlide-1) { 1090 var slideI = 0; 1091 } else { 1092 var slideI = vis+1; 1093 } 1094 1095 1096 var slide = $('.cameraSlide:eq('+slideI+')',target); 1097 var slideNext = $('.cameraSlide:eq('+(slideI+1)+')',target).addClass('cameranext'); 1098 if( vis != slideI+1 ) { 1099 slideNext.hide(); 1100 } 1101 $('.cameraContent',fakeHover).fadeOut(600); 1102 $('.camera_caption',fakeHover).show(); 1103 1104 $('.camerarelative',slide).append($('> div ',elem).eq(slideI).find('> div.camera_effected')); 1105 1106 $('.camera_target_content .cameraContent:eq('+slideI+')',wrap).append($('> div ',elem).eq(slideI).find('> div')); 1107 1108 if(!$('.imgLoaded',slide).length){ 1109 var imgUrl = allImg[slideI]; 1110 var imgLoaded = new Image(); 1111 if(typeof allalt[slideI] !== 'undefined'){ 1112 var altText = allalt[slideI]; 1113 imgLoaded.alt = altText; 1114 } 1115 imgLoaded.src = imgUrl +"?"+ new Date().getTime(); 1116 slide.css('visibility','hidden');
1117 slide.prepend($(imgLoaded).attr('class','imgLoaded').css('visibility','hidden')); 1118 var wT, hT; 1119 if (!$(imgLoaded).get(0).complete || wT == '0' || hT == '0' || typeof wT === 'undefined' || wT === false || typeof hT === 'undefined' || hT === false) { 1120 $('.camera_loader',wrap).delay(500).fadeIn(400); 1121 imgLoaded.onload = function() { 1122 wT = imgLoaded.naturalWidth; 1123 hT = imgLoaded.naturalHeight; 1124 $(imgLoaded).attr('data-alignment',allAlign[slideI]).attr('data-portrait',allPor[slideI]); 1125 $(imgLoaded).attr('width',wT); 1126 $(imgLoaded).attr('height',hT); 1127 target.find('.cameraSlide_'+slideI).hide().css('visibility','visible'); 1128 resizeImage(); 1129 nextSlide(slideI+1); 1130 }; 1131 } 1132 } else { 1133 if( allImg.length > (slideI+1) && !$('.imgLoaded',slideNext).length ){ 1134 var imgUrl2 = allImg[(slideI+1)]; 1135 var imgLoaded2 = new Image(); 1136 if(typeof allalt[(slideI+1)] !== 'undefined'){ 1137 var altText2 = allalt[(slideI+1)]; 1138 imgLoaded2.alt = altText2; 1139 } 1140 imgLoaded2.src = imgUrl2 +"?"+ new Date().getTime(); 1141 slideNext.prepend($(imgLoaded2).attr('class','imgLoaded').css('visibility','hidden')); 1142 imgLoaded2.onload = function() { 1143 wT = imgLoaded2.naturalWidth; 1144 hT = imgLoaded2.naturalHeight; 1145 $(imgLoaded2).attr('data-alignment',allAlign[slideI+1]).attr('data-portrait',allPor[slideI+1]); 1146 $(imgLoaded2).attr('width',wT); 1147 $(imgLoaded2).attr('height',hT); 1148 resizeImage(); 1149 }; 1150 } 1151 opts.onLoaded.call(this); 1152 if($('.camera_loader',wrap).is(':visible')){ 1153 $('.camera_loader',wrap).fadeOut(400); 1154 } else { 1155 $('.camera_loader',wrap).css({'visibility':'hidden'}); 1156 $('.camera_loader',wrap).fadeOut(400,function(){ 1157 $('.camera_loader',wrap).css({'visibility':'visible'}); 1158 }); 1159 } 1160 var rows = opts.rows, 1161 cols = opts.cols, 1162 couples = 1, 1163 difference = 0, 1164 dataSlideOn, 1165 time, 1166 transPeriod, 1167 fx, 1168 easing, 1169 randomFx = new Array('simpleFade','curtainTopLeft','curtainTopRight','curtainBottomLeft','curtainBottomRight','curtainSliceLeft','curtainSliceRight','blindCurtainTopLeft','blindCurtainTopRight','blindCurtainBottomLeft','blindCurtainBottomRight','blindCurtainSliceBottom','blindCurtainSliceTop','stampede','mosaic','mosaicReverse','mosaicRandom','mosaicSpiral','mosaicSpiralReverse','topLeftBottomRight','bottomRightTopLeft','bottomLeftTopRight','topRightBottomLeft','scrollLeft','scrollRight','scrollTop','scrollBottom','scrollHorz'); 1170 marginLeft = 0, 1171 marginTop = 0, 1172 opacityOnGrid = 0; 1173 1174 if(opts.opacityOnGrid==true){ 1175 opacityOnGrid = 0; 1176 } else { 1177 opacityOnGrid = 1; 1178 } 1179 1180 1181 1182 var dataFx = $(' > div',elem).eq(slideI).attr('data-fx'); 1183 1184 if(isMobile()&&opts.mobileFx!=''&&opts.mobileFx!='default'){ 1185 fx = opts.mobileFx; 1186 } else { 1187 if(typeof dataFx !== 'undefined' && dataFx!== false && dataFx!== 'default'){ 1188 fx = dataFx; 1189 } else { 1190 fx = opts.fx; 1191 } 1192 } 1193 1194 if(fx=='random') { 1195 fx = shuffle(randomFx); 1196 fx = fx[0]; 1197 } else { 1198 fx = fx; 1199 if(fx.indexOf(',')>0){ 1200 fx = fx.replace(/ /g,''); 1201 fx = fx.split(','); 1202 fx = shuffle(fx); 1203 fx = fx[0]; 1204 } 1205 } 1206 1207 dataEasing = $(' > div',elem).eq(slideI).attr('data-easing'); 1208 mobileEasing = $(' > div',elem).eq(slideI).attr('data-mobileEasing'); 1209 1210 if(isMobile()&&opts.mobileEasing!=''&&opts.mobileEasing!='default'){ 1211 if(typeof mobileEasing !== 'undefined' && mobileEasing!== false && mobileEasing!== 'default') { 1212 easing = mobileEasing; 1213 } else { 1214 easing = opts.mobileEasing; 1215 } 1216 } else { 1217 if(typeof dataEasing !== 'undefined' && dataEasing!== false && dataEasing!== 'default') { 1218 easing = dataEasing; 1219 } else { 1220 easing = opts.easing; 1221 } 1222 } 1223 1224 dataSlideOn = $(' > div',elem).eq(slideI).attr('data-slideOn'); 1225 if(typeof dataSlideOn !== 'undefined' && dataSlideOn!== false){ 1226 slideOn = dataSlideOn; 1227 } else { 1228 if(opts.slideOn=='random'){ 1229 var slideOn = new Array('next','prev'); 1230 slideOn = shuffle(slideOn); 1231 slideOn = slideOn[0]; 1232 } else { 1233 slideOn = opts.slideOn; 1234 } 1235 } 1236 1237 var dataTime = $(' > div',elem).eq(slideI).attr('data-time'); 1238 if(typeof dataTime !== 'undefined' && dataTime!== false && dataTime!== ''){
1239 time = parseFloat(dataTime); 1240 } else { 1241 time = opts.time; 1242 } 1243 1244 var dataTransPeriod = $(' > div',elem).eq(slideI).attr('data-transPeriod'); 1245 if(typeof dataTransPeriod !== 'undefined' && dataTransPeriod!== false && dataTransPeriod!== ''){ 1246 transPeriod = parseFloat(dataTransPeriod); 1247 } else { 1248 transPeriod = opts.transPeriod; 1249 } 1250 1251 if(!$(elem).hasClass('camerastarted')){ 1252 fx = 'simpleFade'; 1253 slideOn = 'next'; 1254 easing = ''; 1255 transPeriod = 400; 1256 $(elem).addClass('camerastarted') 1257 } 1258 1259 switch(fx){ 1260 case 'simpleFade': 1261 cols = 1; 1262 rows = 1; 1263 break; 1264 case 'curtainTopLeft': 1265 if(opts.slicedCols == 0) { 1266 cols = opts.cols; 1267 } else { 1268 cols = opts.slicedCols; 1269 } 1270 rows = 1; 1271 break; 1272 case 'curtainTopRight': 1273 if(opts.slicedCols == 0) { 1274 cols = opts.cols; 1275 } else { 1276 cols = opts.slicedCols; 1277 } 1278 rows = 1; 1279 break; 1280 case 'curtainBottomLeft': 1281 if(opts.slicedCols == 0) { 1282 cols = opts.cols; 1283 } else { 1284 cols = opts.slicedCols; 1285 } 1286 rows = 1; 1287 break; 1288 case 'curtainBottomRight': 1289 if(opts.slicedCols == 0) { 1290 cols = opts.cols; 1291 } else { 1292 cols = opts.slicedCols; 1293 } 1294 rows = 1; 1295 break; 1296 case 'curtainSliceLeft': 1297 if(opts.slicedCols == 0) { 1298 cols = opts.cols; 1299 } else { 1300 cols = opts.slicedCols; 1301 } 1302 rows = 1; 1303 break; 1304 case 'curtainSliceRight': 1305 if(opts.slicedCols == 0) { 1306 cols = opts.cols; 1307 } else { 1308 cols = opts.slicedCols; 1309 } 1310 rows = 1; 1311 break; 1312 case 'blindCurtainTopLeft': 1313 if(opts.slicedRows == 0) { 1314 rows = opts.rows; 1315 } else { 1316 rows = opts.slicedRows; 1317 } 1318 cols = 1; 1319 break; 1320 case 'blindCurtainTopRight': 1321 if(opts.slicedRows == 0) { 1322 rows = opts.rows; 1323 } else { 1324 rows = opts.slicedRows; 1325 } 1326 cols = 1; 1327 break; 1328 case 'blindCurtainBottomLeft': 1329 if(opts.slicedRows == 0) { 1330 rows = opts.rows; 1331 } else { 1332 rows = opts.slicedRows; 1333 } 1334 cols = 1; 1335 break; 1336 case 'blindCurtainBottomRight': 1337 if(opts.slicedRows == 0) { 1338 rows = opts.rows; 1339 } else { 1340 rows = opts.slicedRows; 1341 } 1342 cols = 1; 1343 break; 1344 case 'blindCurtainSliceTop': 1345 if(opts.slicedRows == 0) { 1346 rows = opts.rows; 1347 } else { 1348 rows = opts.slicedRows; 1349 } 1350 cols = 1; 1351 break; 1352 case 'blindCurtainSliceBottom': 1353 if(opts.slicedRows == 0) { 1354 rows = opts.rows; 1355 } else { 1356 rows = opts.slicedRows; 1357 } 1358 cols = 1; 1359 break; 1360 case 'stampede': 1361 difference = '-'+transPeriod; 1362 break; 1363 case 'mosaic': 1364 difference = opts.gridDifference; 1365 break; 1366 case 'mosaicReverse': 1367 difference = opts.gridDifference; 1368 break; 1369 case 'mosaicRandom': 1370 break; 1371 case 'mosaicSpiral': 1372 difference = opts.gridDifference; 1373 couples = 1.7; 1374 break; 1375 case 'mosaicSpiralReverse': 1376 difference = opts.gridDifference; 1377 couples = 1.7; 1378 break; 1379 case 'topLeftBottomRight': 1380 difference = opts.gridDifference; 1381 couples = 6; 1382 break; 1383 case 'bottomRightTopLeft': 1384 difference = opts.gridDifference; 1385 couples = 6; 1386 break; 1387 case 'bottomLeftTopRight': 1388 difference = opts.gridDifference; 1389 couples = 6; 1390 break; 1391 case 'topRightBottomLeft': 1392 difference = opts.gridDifference; 1393 couples = 6; 1394 break; 1395 case 'scrollLeft': 1396 cols = 1; 1397 rows = 1; 1398 break; 1399 case 'scrollRight': 1400 cols = 1; 1401 rows = 1; 1402 break; 1403 case 'scrollTop': 1404 cols = 1; 1405 rows = 1; 1406 break; 1407 case 'scrollBottom': 1408 cols = 1; 1409 rows = 1; 1410 break; 1411 case 'scrollHorz': 1412 cols = 1; 1413 rows = 1; 1414 break; 1415 } 1416 1417 var cycle = 0; 1418 var blocks = rows*cols; 1419 var leftScrap = w-(Math.floor(w/cols)*cols); 1420 var topScrap = h-(Math.floor(h/rows)*rows); 1421 var addLeft; 1422 var addTop; 1423 var tAppW = 0; 1424 var tAppH = 0; 1425 var arr = new Array();
1426 var delay = new Array(); 1427 var order = new Array(); 1428 while(cycle < blocks){ 1429 arr.push(cycle); 1430 delay.push(cycle); 1431 cameraCont.append('<div class="cameraappended" style="display:none; overflow:hidden; position:absolute; z-index:1000" />'); 1432 var tApp = $('.cameraappended:eq('+cycle+')',target); 1433 if(fx=='scrollLeft' || fx=='scrollRight' || fx=='scrollTop' || fx=='scrollBottom' || fx=='scrollHorz'){ 1434 selector.eq(slideI).clone().show().appendTo(tApp); 1435 } else { 1436 if(slideOn=='next'){ 1437 selector.eq(slideI).clone().show().appendTo(tApp); 1438 } else { 1439 selector.eq(vis).clone().show().appendTo(tApp); 1440 } 1441 } 1442 1443 if(cycle%cols<leftScrap){ 1444 addLeft = 1; 1445 } else { 1446 addLeft = 0; 1447 } 1448 if(cycle%cols==0){ 1449 tAppW = 0; 1450 } 1451 if(Math.floor(cycle/cols)<topScrap){ 1452 addTop = 1; 1453 } else { 1454 addTop = 0; 1455 } 1456 tApp.css({ 1457 'height': Math.floor((h/rows)+addTop+1), 1458 'left': tAppW, 1459 'top': tAppH, 1460 'width': Math.floor((w/cols)+addLeft+1) 1461 }); 1462 $('> .cameraSlide', tApp).css({ 1463 'height': h, 1464 'margin-left': '-'+tAppW+'px', 1465 'margin-top': '-'+tAppH+'px', 1466 'width': w 1467 }); 1468 tAppW = tAppW+tApp.width()-1; 1469 if(cycle%cols==cols-1){ 1470 tAppH = tAppH + tApp.height() - 1; 1471 } 1472 cycle++; 1473 } 1474 1475 1476 1477 switch(fx){ 1478 case 'curtainTopLeft': 1479 break; 1480 case 'curtainBottomLeft': 1481 break; 1482 case 'curtainSliceLeft': 1483 break; 1484 case 'curtainTopRight': 1485 arr = arr.reverse(); 1486 break; 1487 case 'curtainBottomRight': 1488 arr = arr.reverse(); 1489 break; 1490 case 'curtainSliceRight': 1491 arr = arr.reverse(); 1492 break; 1493 case 'blindCurtainTopLeft': 1494 break; 1495 case 'blindCurtainBottomLeft': 1496 arr = arr.reverse(); 1497 break; 1498 case 'blindCurtainSliceTop': 1499 break; 1500 case 'blindCurtainTopRight': 1501 break; 1502 case 'blindCurtainBottomRight': 1503 arr = arr.reverse(); 1504 break; 1505 case 'blindCurtainSliceBottom': 1506 arr = arr.reverse(); 1507 break; 1508 case 'stampede': 1509 arr = shuffle(arr); 1510 break; 1511 case 'mosaic': 1512 break; 1513 case 'mosaicReverse': 1514 arr = arr.reverse(); 1515 break; 1516 case 'mosaicRandom': 1517 arr = shuffle(arr); 1518 break; 1519 case 'mosaicSpiral': 1520 var rows2 = rows/2, x, y, z, n=0; 1521 for (z = 0; z < rows2; z++){ 1522 y = z; 1523 for (x = z; x < cols - z - 1; x++) { 1524 order[n++] = y * cols + x; 1525 } 1526 x = cols - z - 1; 1527 for (y = z; y < rows - z - 1; y++) { 1528 order[n++] = y * cols + x; 1529 } 1530 y = rows - z - 1; 1531 for (x = cols - z - 1; x > z; x--) { 1532 order[n++] = y * cols + x; 1533 } 1534 x = z; 1535 for (y = rows - z - 1; y > z; y--) { 1536 order[n++] = y * cols + x; 1537 } 1538 } 1539 1540 arr = order; 1541 1542 break; 1543 case 'mosaicSpiralReverse': 1544 var rows2 = rows/2, x, y, z, n=blocks-1; 1545 for (z = 0; z < rows2; z++){ 1546 y = z; 1547 for (x = z; x < cols - z - 1; x++) { 1548 order[n--] = y * cols + x; 1549 } 1550 x = cols - z - 1; 1551 for (y = z; y < rows - z - 1; y++) { 1552 order[n--] = y * cols + x; 1553 } 1554 y = rows - z - 1; 1555 for (x = cols - z - 1; x > z; x--) { 1556 order[n--] = y * cols + x; 1557 } 1558 x = z; 1559 for (y = rows - z - 1; y > z; y--) { 1560 order[n--] = y * cols + x; 1561 } 1562 } 1563 1564 arr = order; 1565 1566 break; 1567 case 'topLeftBottomRight': 1568 for (var y = 0; y < rows; y++) 1569 for (var x = 0; x < cols; x++) { 1570 order.push(x + y); 1571 } 1572 delay = order; 1573 break; 1574 case 'bottomRightTopLeft': 1575 for (var y = 0; y < rows; y++) 1576 for (var x = 0; x < cols; x++) { 1577 order.push(x + y); 1578 } 1579 delay = order.reverse(); 1580 break; 1581 case 'bottomLeftTopRight': 1582 for (var y = rows; y > 0; y--) 1583 for (var x = 0; x < cols; x++) { 1584 order.push(x + y); 1585 } 1586 delay = order; 1587 break; 1588 case 'topRightBottomLeft': 1589 for (var y = 0; y < rows; y++) 1590 for (var x = cols; x > 0; x--) { 1591 order.push(x + y); 1592 }
1593 delay = order; 1594 break; 1595 } 1596 1597 1598 1599 opts.onMyStartTransition.call(this,vis,slideI); 1600 1601 1602 $.each(arr, function(index, value) { 1603 1604 if(value%cols<leftScrap){ 1605 addLeft = 1; 1606 } else { 1607 addLeft = 0; 1608 } 1609 if(value%cols==0){ 1610 tAppW = 0; 1611 } 1612 if(Math.floor(value/cols)<topScrap){ 1613 addTop = 1; 1614 } else { 1615 addTop = 0; 1616 } 1617 1618 switch(fx){ 1619 case 'simpleFade': 1620 height = h; 1621 width = w; 1622 opacityOnGrid = 0; 1623 break; 1624 case 'curtainTopLeft': 1625 height = 0, 1626 width = Math.floor((w/cols)+addLeft+1), 1627 marginTop = '-'+Math.floor((h/rows)+addTop+1)+'px'; 1628 break; 1629 case 'curtainTopRight': 1630 height = 0, 1631 width = Math.floor((w/cols)+addLeft+1), 1632 marginTop = '-'+Math.floor((h/rows)+addTop+1)+'px'; 1633 break; 1634 case 'curtainBottomLeft': 1635 height = 0, 1636 width = Math.floor((w/cols)+addLeft+1), 1637 marginTop = Math.floor((h/rows)+addTop+1)+'px'; 1638 break; 1639 case 'curtainBottomRight': 1640 height = 0, 1641 width = Math.floor((w/cols)+addLeft+1), 1642 marginTop = Math.floor((h/rows)+addTop+1)+'px'; 1643 break; 1644 case 'curtainSliceLeft': 1645 height = 0, 1646 width = Math.floor((w/cols)+addLeft+1); 1647 if(value%2==0){ 1648 marginTop = Math.floor((h/rows)+addTop+1)+'px'; 1649 } else { 1650 marginTop = '-'+Math.floor((h/rows)+addTop+1)+'px'; 1651 } 1652 break; 1653 case 'curtainSliceRight': 1654 height = 0, 1655 width = Math.floor((w/cols)+addLeft+1); 1656 if(value%2==0){ 1657 marginTop = Math.floor((h/rows)+addTop+1)+'px'; 1658 } else { 1659 marginTop = '-'+Math.floor((h/rows)+addTop+1)+'px'; 1660 } 1661 break; 1662 case 'blindCurtainTopLeft': 1663 height = Math.floor((h/rows)+addTop+1), 1664 width = 0, 1665 marginLeft = '-'+Math.floor((w/cols)+addLeft+1)+'px'; 1666 break; 1667 case 'blindCurtainTopRight': 1668 height = Math.floor((h/rows)+addTop+1), 1669 width = 0, 1670 marginLeft = Math.floor((w/cols)+addLeft+1)+'px'; 1671 break; 1672 case 'blindCurtainBottomLeft': 1673 height = Math.floor((h/rows)+addTop+1), 1674 width = 0, 1675 marginLeft = '-'+Math.floor((w/cols)+addLeft+1)+'px'; 1676 break; 1677 case 'blindCurtainBottomRight': 1678 height = Math.floor((h/rows)+addTop+1), 1679 width = 0, 1680 marginLeft = Math.floor((w/cols)+addLeft+1)+'px'; 1681 break; 1682 case 'blindCurtainSliceBottom': 1683 height = Math.floor((h/rows)+addTop+1), 1684 width = 0; 1685 if(value%2==0){ 1686 marginLeft = '-'+Math.floor((w/cols)+addLeft+1)+'px'; 1687 } else { 1688 marginLeft = Math.floor((w/cols)+addLeft+1)+'px'; 1689 } 1690 break; 1691 case 'blindCurtainSliceTop': 1692 height = Math.floor((h/rows)+addTop+1), 1693 width = 0; 1694 if(value%2==0){ 1695 marginLeft = '-'+Math.floor((w/cols)+addLeft+1)+'px'; 1696 } else { 1697 marginLeft = Math.floor((w/cols)+addLeft+1)+'px'; 1698 } 1699 break; 1700 case 'stampede': 1701 height = 0; 1702 width = 0; 1703 marginLeft = (w*0.2)*(((index)%cols)-(cols-(Math.floor(cols/2))))+'px'; 1704 marginTop = (h*0.2)*((Math.floor(index/cols)+1)-(rows-(Math.floor(rows/2))))+'px'; 1705 break; 1706 case 'mosaic': 1707 height = 0; 1708 width = 0; 1709 break; 1710 case 'mosaicReverse': 1711 height = 0; 1712 width = 0; 1713 marginLeft = Math.floor((w/cols)+addLeft+1)+'px'; 1714 marginTop = Math.floor((h/rows)+addTop+1)+'px'; 1715 break; 1716 case 'mosaicRandom': 1717 height = 0; 1718 width = 0; 1719 marginLeft = Math.floor((w/cols)+addLeft+1)*0.5+'px'; 1720 marginTop = Math.floor((h/rows)+addTop+1)*0.5+'px'; 1721 break; 1722 case 'mosaicSpiral': 1723 height = 0; 1724 width = 0; 1725 marginLeft = Math.floor((w/cols)+addLeft+1)*0.5+'px'; 1726 marginTop = Math.floor((h/rows)+addTop+1)*0.5+'px'; 1727 break; 1728 case 'mosaicSpiralReverse': 1729 height = 0; 1730 width = 0; 1731 marginLeft = Math.floor((w/cols)+addLeft+1)*0.5+'px'; 1732 marginTop = Math.floor((h/rows)+addTop+1)*0.5+'px'; 1733 break; 1734 case 'topLeftBottomRight': 1735 height = 0; 1736 width = 0; 1737 break; 1738 case 'bottomRightTopLeft': 1739 height = 0; 1740 width = 0; 1741 marginLeft = Math.floor((w/cols)+addLeft+1)+'px'; 1742 marginTop = Math.floor((h/rows)+addTop+1)+'px'; 1743 break; 1744 case 'bottomLeftTopRight': 1745 height = 0; 1746 width = 0; 1747 marginLeft = 0; 1748 marginTop = Math.floor((h/rows)+addTop+1)+'px'; 1749 break; 1750 case 'topRightBottomLeft': 1751 height = 0; 1752 width = 0; 1753 marginLeft = Math.floor((w/cols)+addLeft+1)+'px'; 1754 marginTop = 0; 1755 break; 1756 case 'scrollRight': 1757 height = h; 1758 width = w; 1759 marginLeft = -w; 1760 break; 1761 case 'scrollLeft': 1762 height = h; 1763 width = w; 1764 marginLeft = w; 1765 break; 1766 case 'scrollTop': 1767 height = h; 1768 width = w; 1769 marginTop = h; 1770 break; 1771 case 'scrollBottom': 1772 height = h; 1773 width = w; 1774 marginTop = -h; 1775 break; 1776 case 'scrollHorz': 1777 height = h; 1778 width = w; 1779 if(vis==0 && slideI==amountSlide-1) { 1780 marginLeft = -w; 1781 } else if(vis<slideI || (vis==amountSlide-1 && slideI==0)) { 1782 marginLeft = w; 1783 } else { 1784 marginLeft = -w; 1785 } 1786 break; 1787 } 1788 1789 1790 var tApp = $('.cameraappended:eq('+value+')',target); 1791 1792 if(typeof u !== 'undefined'){ 1793 clearInterval(u); 1794 clearTimeout(setT); 1795 setT = setTimeout(canvasLoader,transPeriod+difference); 1796 } 1797 1798 1799 if($(pagination).length){ 1800 $('.camera_pag li',wrap).removeClass('cameracurrent'); 1801 $('.camera_pag li',wrap).eq(slideI).addClass('cameracurrent'); 1802 } 1803 1804 if($(thumbs).length){ 1805 $('li', thumbs).removeClass('cameracurrent'); 1806 $('li', thumbs).eq(slideI).addClass('cameracurrent'); 1807 $('li', thumbs).not('.cameracurrent').find('img').animate({opacity:.5},0); 1808 $('li.cameracurrent img', thumbs).animate({opacity:1},0); 1809 $('li', thumbs).hover(function(){
1810 $('img',this).stop(true,false).animate({opacity:1},150); 1811 },function(){ 1812 if(!$(this).hasClass('cameracurrent')){ 1813 $('img',this).stop(true,false).animate({opacity:.5},150); 1814 } 1815 }); 1816 } 1817 1818 1819 var easedTime = parseFloat(transPeriod)+parseFloat(difference); 1820 1821 function cameraeased() { 1822 1823 $(this).addClass('cameraeased'); 1824 if($('.cameraeased',target).length>=0){ 1825 $(thumbs).css({visibility:'visible'}); 1826 } 1827 if($('.cameraeased',target).length==blocks){ 1828 1829 thumbnailPos(); 1830 1831 $('.moveFromLeft, .moveFromRight, .moveFromTop, .moveFromBottom, .fadeIn, .fadeFromLeft, .fadeFromRight, .fadeFromTop, .fadeFromBottom',fakeHover).each(function(){ 1832 $(this).css('visibility','hidden'); 1833 }); 1834 1835 selector.eq(slideI).show().css('z-index','999').removeClass('cameranext').addClass('cameracurrent'); 1836 selector.eq(vis).css('z-index','1').removeClass('cameracurrent'); 1837 $('.cameraContent',fakeHover).eq(slideI).addClass('cameracurrent'); 1838 if (vis >= 0) { 1839 $('.cameraContent',fakeHover).eq(vis).removeClass('cameracurrent'); 1840 } 1841 1842 opts.onEndTransition.call(this); 1843 1844 if($('> div', elem).eq(slideI).attr('data-video')!='hide' && $('.cameraContent.cameracurrent .imgFake',fakeHover).length ){ 1845 $('.cameraContent.cameracurrent .imgFake',fakeHover).click(); 1846 } 1847 1848 1849 var lMoveIn = selector.eq(slideI).find('.fadeIn').length; 1850 var lMoveInContent = $('.cameraContent',fakeHover).eq(slideI).find('.moveFromLeft, .moveFromRight, .moveFromTop, .moveFromBottom, .fadeIn, .fadeFromLeft, .fadeFromRight, .fadeFromTop, .fadeFromBottom').length; 1851 1852 if (lMoveIn!=0){ 1853 $('.cameraSlide.cameracurrent .fadeIn',fakeHover).each(function(){ 1854 if($(this).attr('data-easing')!=''){ 1855 var easeMove = $(this).attr('data-easing'); 1856 } else { 1857 var easeMove = easing; 1858 } 1859 var t = $(this); 1860 if(typeof t.attr('data-outerWidth') === 'undefined' || t.attr('data-outerWidth') === false || t.attr('data-outerWidth') === '') { 1861 var wMoveIn = t.outerWidth(); 1862 t.attr('data-outerWidth',wMoveIn); 1863 } else { 1864 var wMoveIn = t.attr('data-outerWidth'); 1865 } 1866 if(typeof t.attr('data-outerHeight') === 'undefined' || t.attr('data-outerHeight') === false || t.attr('data-outerHeight') === '') { 1867 var hMoveIn = t.outerHeight(); 1868 t.attr('data-outerHeight',hMoveIn); 1869 } else { 1870 var hMoveIn = t.attr('data-outerHeight'); 1871 } 1872 //t.css('width',wMoveIn); 1873 var pos = t.position(); 1874 var left = pos.left; 1875 var top = pos.top; 1876 var tClass = t.attr('class'); 1877 var ind = t.index(); 1878 var hRel = t.parents('.camerarelative').outerHeight(); 1879 var wRel = t.parents('.camerarelative').outerWidth(); 1880 if(tClass.indexOf("fadeIn") != -1) { 1881 t.animate({opacity:0}
1881,0).css('visibility','visible').delay((time/lMoveIn)*(0.1*(ind-1))).animate({opacity:1},(time/lMoveIn)*0.15,easeMove); 1882 } else { 1883 t.css('visibility','visible'); 1884 } 1885 }); 1886 } 1887 1888 $('.cameraContent.cameracurrent',fakeHover).show(); 1889 if (lMoveInContent!=0){ 1890 1891 $('.cameraContent.cameracurrent .moveFromLeft, .cameraContent.cameracurrent .moveFromRight, .cameraContent.cameracurrent .moveFromTop, .cameraContent.cameracurrent .moveFromBottom, .cameraContent.cameracurrent .fadeIn, .cameraContent.cameracurrent .fadeFromLeft, .cameraContent.cameracurrent .fadeFromRight, .cameraContent.cameracurrent .fadeFromTop, .cameraContent.cameracurrent .fadeFromBottom',fakeHover).each(function(){ 1892 if($(this).attr('data-easing')!=''){ 1893 var easeMove = $(this).attr('data-easing'); 1894 } else { 1895 var easeMove = easing; 1896 } 1897 var t = $(this); 1898 var pos = t.position(); 1899 var left = pos.left; 1900 var top = pos.top; 1901 var tClass = t.attr('class'); 1902 var ind = t.index(); 1903 var thisH = t.outerHeight(); 1904 if(tClass.indexOf("moveFromLeft") != -1) { 1905 t.css({'left':'-'+(w)+'px','right':'auto'}); 1906 t.css('visibility','visible').delay((time/lMoveInContent)*(0.1*(ind-1))).animate({'left':pos.left},(time/lMoveInContent)*0.15,easeMove); 1907 } else if(tClass.indexOf("moveFromRight") != -1) { 1908 t.css({'left':w+'px','right':'auto'}); 1909 t.css('visibility','visible').delay((time/lMoveInContent)*(0.1*(ind-1))).animate({'left':pos.left},(time/lMoveInContent)*0.15,easeMove); 1910 } else if(tClass.indexOf("moveFromTop") != -1) { 1911 t.css({'top':'-'+h+'px','bottom':'auto'}); 1912 t.css('visibility','visible').delay((time/lMoveInContent)*(0.1*(ind-1))).animate({'top':pos.top},(time/lMoveInContent)*0.15,easeMove,function(){ 1913 t.css({top:'auto',bottom:0}); 1914 }); 1915 } else if(tClass.indexOf("moveFromBottom") != -1) { 1916 t.css({'top':h+'px','bottom':'auto'}); 1917 t.css('visibility','visible').delay((time/lMoveInContent)*(0.1*(ind-1))).animate({'top':pos.top},(time/lMoveInContent)*0.15,easeMove); 1918 } else if(tClass.indexOf("fadeFromLeft") != -1) { 1919 t.animate({opacity:0}
1919,0).css({'left':'-'+(w)+'px','right':'auto'}); 1920 t.css('visibility','visible').delay((time/lMoveInContent)*(0.1*(ind-1))).animate({'left':pos.left,opacity:1},(time/lMoveInContent)*0.15,easeMove); 1921 } else if(tClass.indexOf("fadeFromRight") != -1) { 1922 t.animate({opacity:0},0).css({'left':(w)+'px','right':'auto'}); 1923 t.css('visibility','visible').delay((time/lMoveInContent)*(0.1*(ind-1))).animate({'left':pos.left,opacity:1},(time/lMoveInContent)*0.15,easeMove); 1924 } else if(tClass.indexOf("fadeFromTop") != -1) { 1925 t.animate({opacity:0},0).css({'top':'-'+(h)+'px','bottom':'auto'}); 1926 t.css('visibility','visible').delay((time/lMoveInContent)*(0.1*(ind-1))).animate({'top':pos.top,opacity:1},(time/lMoveInContent)*0.15,easeMove,function(){ 1927 t.css({top:'auto',bottom:0}); 1928 }); 1929 } else if(tClass.indexOf("fadeFromBottom") != -1) { 1930 t.animate({opacity:0},0).css({'bottom':'-'+thisH+'px'}); 1931 t.css('visibility','visible').delay((time/lMoveInContent)*(0.1*(ind-1))).animate({'bottom':'0',opacity:1},(time/lMoveInContent)*0.15,easeMove); 1932 } else if(tClass.indexOf("fadeIn") != -1) { 1933 t.animate({opacity:0}
1933,0).css('visibility','visible').delay((time/lMoveInContent)*(0.1*(ind-1))).animate({opacity:1},(time/lMoveInContent)*0.15,easeMove); 1934 } else { 1935 t.css('visibility','visible'); 1936 } 1937 }); 1938 } 1939 1940 1941 $('.cameraappended',target).remove(); 1942 elem.removeClass('camerasliding'); 1943 selector.eq(vis).hide(); 1944 var barWidth = $('.camera_bar_cont',camera_thumbs_wrap).width(), 1945 barHeight = $('.camera_bar_cont',camera_thumbs_wrap).height(), 1946 radSum; 1947 if (loader != 'pie') { 1948 radSum = 0.05; 1949 } else { 1950 radSum = 0.005; 1951 } 1952 $('#'+pieID).animate({opacity:opts.loaderOpacity},200); 1953 u = setInterval( 1954 function(){ 1955 if(elem.hasClass('stopped')){ 1956 clearInterval(u); 1957 } 1958 if (loader != 'pie') { 1959 if(rad<=1.002 && !elem.hasClass('stopped') && !elem.hasClass('paused') && !elem.hasClass('hovered')){ 1960 rad = (rad+radSum); 1961 } else if (rad<=1 && (elem.hasClass('stopped') || elem.hasClass('paused') || elem.hasClass('stopped') || elem.hasClass('hovered'))){ 1962 rad = rad; 1963 } else { 1964 if(!elem.hasClass('stopped') && !elem.hasClass('paused') && !elem.hasClass('hovered')) { 1965 clearInterval(u); 1966 imgFake(); 1967 $('#'+pieID).animate({opacity:0}
1967,200,function(){ 1968 clearTimeout(setT); 1969 setT = setTimeout(canvasLoader,easedTime); 1970 nextSlide(); 1971 opts.onStartLoading.call(this); 1972 }); 1973 } 1974 } 1975 switch(barDirection){ 1976 case 'leftToRight': 1977 $('#'+pieID).animate({'right':barWidth-(barWidth*rad)},(time*radSum),'linear'); 1978 break; 1979 case 'rightToLeft': 1980 $('#'+pieID).animate({'left':barWidth-(barWidth*rad)},(time*radSum),'linear'); 1981 break; 1982 case 'topToBottom': 1983 $('#'+pieID).animate({'bottom':barHeight-(barHeight*rad)},(time*radSum),'linear'); 1984 break; 1985 case 'bottomToTop': 1986 $('#'+pieID).animate({'bottom':barHeight-(barHeight*rad)},(time*radSum),'linear'); 1987 break; 1988 } 1989 1990 } else { 1991 radNew = rad; 1992 ctx.clearRect(0,0,opts.pieDiameter,opts.pieDiameter); 1993 ctx.globalCompositeOperation = 'destination-over'; 1994 ctx.beginPath(); 1995 ctx.arc((opts.pieDiameter)/2, (opts.pieDiameter)/2, (opts.pieDiameter)/2-opts.loaderStroke,0,Math.PI*2,false); 1996 ctx.lineWidth = opts.loaderStroke; 1997 ctx.strokeStyle = opts.loaderBgColor; 1998 ctx.stroke(); 1999 ctx.closePath(); 2000 ctx.globalCompositeOperation = 'source-over'; 2001 ctx.beginPath(); 2002 ctx.arc((opts.pieDiameter)/2, (opts.pieDiameter)/2, (opts.pieDiameter)/2-opts.loaderStroke,0,Math.PI*2*radNew,false); 2003 ctx.lineWidth = opts.loaderStroke-(opts.loaderPadding*2); 2004 ctx.strokeStyle = opts.loaderColor; 2005 ctx.stroke(); 2006 ctx.closePath(); 2007 2008 if(rad<=1.002 && !elem.hasClass('stopped') && !elem.hasClass('paused') && !elem.hasClass('hovered')){ 2009 rad = (rad+radSum); 2010 } else if (rad<=1 && (elem.hasClass('stopped') || elem.hasClass('paused') || elem.hasClass('hovered'))){ 2011 rad = rad; 2012 } else { 2013 if(!elem.hasClass('stopped') && !elem.hasClass('paused') && !elem.hasClass('hovered')) { 2014 clearInterval(u); 2015 imgFake(); 2016 $('#'+pieID+', .camera_canvas_wrap',camera_thumbs_wrap).animate({opacity:0}
2016,200,function(){ 2017 clearTimeout(setT); 2018 setT = setTimeout(canvasLoader,easedTime); 2019 nextSlide(); 2020 opts.onStartLoading.call(this); 2021 }); 2022 } 2023 } 2024 } 2025 },time*radSum 2026 ); 2027 } 2028 2029 } 2030 2031 if(fx=='scrollLeft' || fx=='scrollRight' || fx=='scrollTop' || fx=='scrollBottom' || fx=='scrollHorz'){ 2032 opts.onStartTransition.call(this); 2033 easedTime = 0; 2034 tApp.delay((((transPeriod+difference)/blocks)*delay[index]*couples)*0.5).css({ 2035 'display' : 'block', 2036 'height': height, 2037 'margin-left': marginLeft, 2038 'margin-top': marginTop, 2039 'width': width 2040 }).animate({ 2041 'height': Math.floor((h/rows)+addTop+1), 2042 'margin-top' : 0, 2043 'margin-left' : 0, 2044 'width' : Math.floor((w/cols)+addLeft+1) 2045 },(transPeriod-difference),easing,cameraeased); 2046 selector.eq(vis).delay((((transPeriod+difference)/blocks)*delay[index]*couples)*0.5).animate({ 2047 'margin-left': marginLeft*(-1), 2048 'margin-top': marginTop*(-1) 2049 },(transPeriod-difference),easing,function(){ 2050 $(this).css({'margin-top' : 0,'margin-left' : 0}); 2051 }); 2052 } else { 2053 opts.onStartTransition.call(this); 2054 easedTime = parseFloat(transPeriod)+parseFloat(difference); 2055 if(slideOn=='next'){ 2056 tApp.delay((((transPeriod+difference)/blocks)*delay[index]*couples)*0.5).css({ 2057 'display' : 'block', 2058 'height': height, 2059 'margin-left': marginLeft, 2060 'margin-top': marginTop, 2061 'width': width, 2062 'opacity' : opacityOnGrid 2063 }).animate({ 2064 'height': Math.floor((h/rows)+addTop+1), 2065 'margin-top' : 0, 2066 'margin-left' : 0, 2067 'opacity' : 1, 2068 'width' : Math.floor((w/cols)+addLeft+1) 2069 },(transPeriod-difference),easing,cameraeased); 2070 } else { 2071 selector.eq(slideI).show().css('z-index','999').addClass('cameracurrent'); 2072 selector.eq(vis).css('z-index','1').removeClass('cameracurrent'); 2073 $('.cameraContent',fakeHover).eq(slideI).addClass('cameracurrent'); 2074 $('.cameraContent',fakeHover).eq(vis).removeClass('cameracurrent'); 2075 tApp.delay((((transPeriod+difference)/blocks)*delay[index]*couples)*0.5).css({ 2076 'display' : 'block', 2077 'height': Math.floor((h/rows)+addTop+1), 2078 'margin-top' : 0, 2079 'margin-left' : 0, 2080 'opacity' : 1, 2081 'width' : Math.floor((w/cols)+addLeft+1) 2082 }).animate({ 2083 'height': height, 2084 'margin-left': marginLeft, 2085 'margin-top': marginTop, 2086 'width': width, 2087 'opacity' : opacityOnGrid 2088 },(transPeriod-difference),easing,cameraeased); 2089 } 2090 } 2091 2092 2093 2094 2095 2096 }); 2097 2098 2099 2100 2101 } 2102 } 2103 2104 2105 if($(prevNav).length){ 2106 $(prevNav).click(function(){ 2107 if(!elem.hasClass('camerasliding')){ 2108 var idNum = parseFloat($('.cameraSlide.cameracurrent',target).index()); 2109 clearInterval(u); 2110 imgFake(); 2111 $('#'+pieID+', .camera_canvas_wrap',wrap).animate({opacity:0}
2111,0); 2112 canvasLoader(); 2113 if(idNum!=0){ 2114 nextSlide(idNum); 2115 } else { 2116 nextSlide(amountSlide); 2117 } 2118 opts.onStartLoading.call(this); 2119 } 2120 }); 2121 } 2122 2123 if($(nextNav).length){ 2124 $(nextNav).click(function(){ 2125 if(!elem.hasClass('camerasliding')){ 2126 var idNum = parseFloat($('.cameraSlide.cameracurrent',target).index()); 2127 clearInterval(u); 2128 imgFake(); 2129 $('#'+pieID+', .camera_canvas_wrap',camera_thumbs_wrap).animate({opacity:0},0); 2130 canvasLoader(); 2131 if(idNum==amountSlide-1){ 2132 nextSlide(1); 2133 } else { 2134 nextSlide(idNum+2); 2135 } 2136 opts.onStartLoading.call(this); 2137 } 2138 }); 2139 } 2140 2141 if(isMobile() && opts.mySwipe){ 2142 fakeHover.swipe( { 2143 swipeLeft:function(event, direction, distance, duration, fingerCount, fingerData) { 2144 if(!elem.hasClass('camerasliding')){ 2145 var idNum = parseFloat($('.cameraSlide.cameracurrent',target).index()); 2146 clearInterval(u); 2147 imgFake(); 2148 $('#'+pieID+', .camera_canvas_wrap',camera_thumbs_wrap).animate({opacity:0}
2148,0); 2149 canvasLoader(); 2150 if(idNum==amountSlide-1){ 2151 nextSlide(1); 2152 } else { 2153 nextSlide(idNum+2); 2154 } 2155 opts.onStartLoading.call(this); 2156 } 2157 }, 2158 swipeRight:function(event, direction, distance, duration, fingerCount, fingerData) { 2159 if(!elem.hasClass('camerasliding')){ 2160 var idNum = parseFloat($('.cameraSlide.cameracurrent',target).index()); 2161 clearInterval(u); 2162 imgFake(); 2163 $('#'+pieID+', .camera_canvas_wrap',camera_thumbs_wrap).animate({opacity:0},0); 2164 canvasLoader(); 2165 if(idNum!=0){ 2166 nextSlide(idNum); 2167 } else { 2168 nextSlide(amountSlide); 2169 } 2170 opts.onStartLoading.call(this); 2171 } 2172 }, 2173 threshold:0 2174 }); 2175 } 2176 2177 if($(pagination).length){ 2178 $('.camera_pag li',wrap).click(function(){ 2179 if(!elem.hasClass('camerasliding')){ 2180 var idNum = parseFloat($(this).index()); 2181 var curNum = parseFloat($('.cameraSlide.cameracurrent',target).index()); 2182 if(idNum!=curNum) { 2183 clearInterval(u); 2184 imgFake(); 2185 $('#'+pieID+', .camera_canvas_wrap',camera_thumbs_wrap).animate({opacity:0}
2185,0); 2186 canvasLoader(); 2187 nextSlide(idNum+1); 2188 opts.onStartLoading.call(this); 2189 } 2190 } 2191 }); 2192 } 2193 2194 if($(thumbs).length) { 2195 2196 $('.pix_thumb img',thumbs).click(function(){ 2197 if(!elem.hasClass('camerasliding')){ 2198 var idNum = parseFloat($(this).parents('li').index()); 2199 var curNum = parseFloat($('.cameracurrent',target).index()); 2200 if(idNum!=curNum) { 2201 clearInterval(u); 2202 imgFake(); 2203 $('#'+pieID+', .camera_canvas_wrap',camera_thumbs_wrap).animate({opacity:0},0); 2204 $('.pix_thumb',thumbs).removeClass('cameracurrent'); 2205 $(this).parents('li').addClass('cameracurrent'); 2206 canvasLoader(); 2207 nextSlide(idNum+1); 2208 thumbnailPos(); 2209 opts.onStartLoading.call(this); 2210 } 2211 } 2212 }); 2213 2214 $('.camera_thumbs_cont .camera_prevThumbs',camera_thumbs_wrap).hover(function(){ 2215 $(this).stop(true,false).animate({opacity:1},250); 2216 },function(){ 2217 $(this).stop(true,false).animate({opacity:.7},250); 2218 }); 2219 $('.camera_prevThumbs',camera_thumbs_wrap).click(function(){ 2220 var sum = 0, 2221 wTh = $(thumbs).outerWidth(), 2222 offUl = $('ul', thumbs).offset().left, 2223 offDiv = $('> div', thumbs).offset().left, 2224 ulLeft = offDiv-offUl; 2225 $('.camera_visThumb',thumbs).each(function(){ 2226 var tW = $(this).outerWidth(); 2227 sum = sum+tW; 2228 }); 2229 if(ulLeft-sum>0){ 2230 $('ul', thumbs).animate({'margin-left':'-'+(ulLeft-sum)+'px'},500,thumbnailVisible); 2231 } else { 2232 $('ul', thumbs).animate({'margin-left':0},500,thumbnailVisible); 2233 } 2234 }); 2235 2236 $('.camera_thumbs_cont .camera_nextThumbs',camera_thumbs_wrap).hover(function(){ 2237 $(this).stop(true,false).animate({opacity:1},250); 2238 },function(){ 2239 $(this).stop(true,false).animate({opacity:.7},250); 2240 }); 2241 $('.camera_nextThumbs',camera_thumbs_wrap).click(function(){ 2242 var sum = 0, 2243 wTh = $(thumbs).outerWidth(), 2244 ulW = $('ul', thumbs).outerWidth(), 2245 offUl = $('ul', thumbs).offset().left, 2246 offDiv = $('> div', thumbs).offset().left, 2247 ulLeft = offDiv-offUl; 2248 $('.camera_visThumb',thumbs).each(function(){ 2249 var tW = $(this).outerWidth(); 2250 sum = sum+tW; 2251 }); 2252 if(ulLeft+sum+sum<ulW){ 2253 $('ul', thumbs).animate({'margin-left':'-'+(ulLeft+sum)+'px'},500,thumbnailVisible); 2254 } else { 2255 $('ul', thumbs).animate({'margin-left':'-'+(ulW-wTh)+'px'},500,thumbnailVisible); 2256 } 2257 }); 2258 2259 } 2260 2261 2262 2263} 2264 2265})(jQuery); 2266 2267;(function($){$.fn.cameraStop = function() { 2268 var wrap = $(this), 2269 elem = $('.camera_src',wrap), 2270 pieID = 'pie_'+wrap.index(); 2271 elem.addClass('stopped'); 2272 if($('.camera_showcommands').length) { 2273 var camera_thumbs_wrap = $('.camera_thumbs_wrap',wrap); 2274 } else { 2275 var camera_thumbs_wrap = wrap; 2276 } 2277} 2278})(jQuery); 2279 2280;(function($){$.fn.cameraPause = function() { 2281 var wrap = $(this); 2282 var elem = $('.camera_src',wrap); 2283 elem.addClass('paused'); 2284} 2285})(jQuery); 2286 2287;(function($){$.fn.cameraResume = function() { 2288 var wrap = $(this); 2289 var elem = $('.camera_src',wrap); 2290 if(typeof autoAdv === 'undefined' || autoAdv!==true){ 2291 elem.removeClass('paused'); 2292 } 2293} 2294})(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.