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