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