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