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