1/* 2 * Special thanks to Sachin Choolur 3 * for original Slider script. 4 * https://github.com/sachinchoolur/lightslider 5 */ 6 7(function ($) { 8 9 'use strict'; 10 11 var defaults = { 12 item: 1, 13 view: 'thumb_view', 14 maxWidth: 900, 15 maxHeight: 700, 16 mode: 'slide', 17 speed: 400, 18 pauseOnHover: false, 19 pause: 2000, 20 controls: false, 21 fullscreen: false, 22 vertical: false, 23 sliderHeight: 500, 24 vThumbWidth: 100, 25 hThumbHeight: 80, 26 thumbItem: 10, 27 thumbMargin: 5, 28 thumbPosition: false, 29 thumbControls: false, 30 pager: false, 31 gallery: false, 32 dragdrop: false, 33 swipe: false, 34 thumbdragdrop: false, 35 thumbswipe: false, 36 title: false, 37 description: false, 38 titlesymbollimit: 20, 39 descsymbollimit: 30 40 }; 41 42 $.fn.RSlider = function (options) { 43 if (this.length === 0) { 44 return this; 45 } 46 47 if (this.length > 1) { 48 this.each(function () { 49 $(this).RSlider(options); 50 }); 51 return this; 52 } 53 54 var plugin = {}, 55 settings = $.extend(true, {}, defaults, options), 56 $el = this; 57 58 plugin.$el = this; 59 60 if (settings.mode === 'fade') { 61 settings.vertical = false; 62 } 63 var $children = $el.children(), 64 length = 0, 65 w = 0, 66 on = false, 67 elSize = 0, 68 $slide = '', 69 scene = 0, 70 property = (settings.vertical === true) ? 'height' : 'width', 71 gutter = (settings.vertical === true) ? 'margin-bottom' : 'margin-right', 72 slideValue = 0, 73 pagerWidth = 0, 74 slideWidth = 0, 75 thumbWidth = 0, 76 interval = null, 77 isTouch = ('ontouchstart' in document.documentElement); 78 79 var refresh = {}; 80 81 refresh.calSW = function () { 82 if(settings.vertical){ 83 if(!$slide.hasClass('rwd-fullscreen-on')){ 84 elSize = settings.sliderHeight; 85 slideWidth = elSize / settings.item; 86 $('.rwd-SlideOuter.vertical .thumbAction > .thumbPrev').css('top', -settings.sliderHeight + 20 + 'px'); 87 } else { 88 slideWidth = ($(window).height() - 30) / settings.item; 89 $('.rwd-SlideOuter.vertical .thumbAction > .thumbPrev').css('top', -($(window).height() - 40) + 'px'); 90 $(window).resize(); 91 setTimeout(function(){ 92 $(window).one('resize'); 93 }, 0) 94 } 95 } else { 96 slideWidth = elSize / settings.item; 97 } 98 }; 99 refresh.calWidth = function (cln) { 100 var ln = cln === true ? $slide.find('.rwd-slide').length : $children.length; 101 w = ln * slideWidth; 102 103 return w; 104 }; 105 plugin.doCss = function () { 106 function support() { 107 var transition = ['transition', 'MozTransition', 'WebkitTransition', 'OTransition', 'msTransition', 'KhtmlTransition']; 108 var root = document.documentElement; 109 for (var i = 0; i < transition.length; i++) { 110 if (transition[i] in root.style) { 111 return true; 112 } 113 } 114 } 115 116 return support(); 117 }; 118 plugin.videoControl = function(){ 119 $('.rslider_iframe_cover').on('click', function(){ 120 $('.rslider_iframe_cover').hide(); 121 122 var $iframe = $(this).parent().find('iframe'); 123 124 if($iframe && $iframe.attr('src')){ 125 if($iframe.attr('src').indexOf('youtube') !== -1){ 126 $iframe.get(0).contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}', '*'); 127 } else if($iframe.attr('src').indexOf('vimeo') !== -1){ 128 try { 129 $f($iframe.get(0)).api('play'); 130 } catch (e) { 131 console.error('Make sure you have included froogaloop2 js'); 132 } 133 } 134 } 135 136 $('.rwd-SlideWrapper').addClass('videoIsPlay'); 137 138 $el.pause(); 139 }); 140 }; 141 plugin.keyPress = function () { 142 $(document).on('keyup', function (e) { 143 if (!$(':focus').is('input, textarea')) { 144 if (e.preventDefault) { 145 e.preventDefault(); 146 } else { 147 e.returnValue = false; 148 } 149 if (e.keyCode === 37) { 150 $el.goToPrevSlide(); 151 } else if (e.keyCode === 39) { 152 $el.goToNextSlide(); 153 } 154 } 155 }); 156 }; 157 plugin.controls = function () { 158 if (settings.controls) { 159 $el.after('<div class="rwd-Action"><a class="rwd-Prev"></a><a class="rwd-Next"></a></div>'); 160 if (length <= settings.item) { 161 $slide.find('.rwd-Action').hide(); 162 } 163 164 $slide.find('.rwd-Action a').on('click', function (e) { 165 if (e.preventDefault) { 166 e.preventDefault(); 167 } else { 168 e.returnValue = false; 169 } 170 if ($(this).attr('class') === 'rwd-Prev') { 171 $el.goToPrevSlide(); 172 } else { 173 $el.goToNextSlide(); 174 } 175 return false; 176 }); 177 } 178 }; 179 plugin.thumbControls = function () { 180 var $this = this; 181 182 if (settings.thumbControls) { 183 if (!settings.vertical && settings.thumbPosition) { 184 setTimeout(function(){ 185 $el.parent().parent().prepend('<div class="thumbAction"><a class="thumbPrev"></a><a class="thumbNext"></a></div>'); 186 }, 0); 187 } else { 188 $el.parent().after('<div class="thumbAction"><a class="thumbPrev"></a><a class="thumbNext"></a></div>'); 189 } 190 if (length <= settings.item) { 191 $slide.find('.thumbAction').hide(); 192 } 193 $(document).on('click', '.thumbAction a', function (e) { 194 if (e.preventDefault) { 195 e.preventDefault(); 196 } else { 197 e.returnValue = false; 198 } 199 if ($(this).hasClass('thumbPrev')) { 200 $this.prevThumb(); 201 } else { 202 $this.nextThumb(); 203 } 204 return false; 205 }); 206 207 if(settings.vertical){ 208 if(settings.thumbPosition){ 209 $('.rwd-SlideOuter.vertical .thumbAction > a').css('left', settings.vThumbWidth / 2 - 15 + 'px'); 210 } else { 211 $('.rwd-SlideOuter.vertical .thumbAction > a').css('right', -settings.vThumbWidth / 2 - 15 + 'px'); 212 } 213 } else { 214 setTimeout(function(){ 215 $('.thumbAction').css('top', (settings.hThumbHeight - 5) / 2 + 'px'); 216 $('.thumbPrev').css('left', '10px'); 217 $('.thumbNext').css('right', '10px'); 218 }, 0); 219 } 220 } 221 }; 222 plugin.prevThumb = function(){ 223 var thumbMove = 0, $pager; 224 225 $slide.addClass('thumb_move'); 226 227 $pager = $slide.parent().find('.rwd-Pager'); 228 229 thumbMove = (+$pager.attr('data-move') || 0) - thumbWidth - settings.thumbMargin; 230 231 if (thumbMove < 0) { 232 if(!$('.rwd-SlideWrapper').hasClass('rwd-fullscreen-on')){ 233 thumbMove = ($('.rwd-Pager.rwd-Gallery li').length - settings.thumbItem) * (thumbWidth + settings.thumbMargin); 234 } else { 235 thumbMove = ($('.rwd-Pager.rwd-Gallery li').length - $('.rwd-SlideWrapper').height() / (thumbWidth + settings.thumbMargin)) * (thumbWidth + settings.thumbMargin); 236 } 237 } 238 239 $pager.attr('data-move', +thumbMove); 240 241 this.move($pager, thumbMove); 242 }; 243 plugin.nextThumb = function(){ 244 var thumbMove = 0, $pager; 245 246 $slide.addClass('thumb_move'); 247 248 $pager = $slide.parent().find('.rwd-Pager'); 249 250 thumbMove = thumbWidth + settings.thumbMargin + (+$pager.attr('data-move') || 0); 251 252 if(settings.vertical){ 253 if (thumbMove + $('.rwd-SlideWrapper').height() > $('.rwd-Pager.rwd-Gallery').height()) { 254 thumbMove = 0; 255 } 256 } else { 257 if (thumbMove + $('.rwd-SlideWrapper').width() > $('.rwd-Pager.rwd-Gallery').width()) { 258 thumbMove = 0; 259 } 260 } 261 262 $pager.attr('data-move', +thumbMove); 263 264 this.move($pager, thumbMove); 265 }; 266 plugin.fullscreen = function () { 267 var $this = this; 268 269 if (settings.fullscreen) { 270 var fullScreen = '<span class="rwd-fullscreen rwd-icon">' + 271 '<svg id="rwd-fullscreen-on" width="20px" height="20px" version="1.1" x="0px" y="0px"' + 272 'viewBox="0 0 35.9 35.9" style="enable-background:new 0 0 35.9 35.9;" xml:space="preserve">' + 273 '<style type="text/css">.st0{stroke:#FFFFFF;stroke-width:2;stroke-miterlimit:10;}</style><g id="fullscreen">' + 274 '<path class="st0" d="M6.5,22.4H1.8v11.7h11.7v-4.7h-7V22.4z M1.8,13h4.7v-7h7V1.3H1.8V13z M30,29.4h-7v4.7h11.7V22.4H30V29.4z' + 275 'M22.9,1.3v4.7h7v7h4.7V1.3H22.9z M22.9,1.3"/></g></svg>
275' + 276 '<svg id="rwd-fullscreen-off" width="20px" height="20px" x="0px" y="0px"' + 277 'viewBox="0 0 35.9 35.9" style="enable-background:new 0 0 35.9 35.9;" xml:space="preserve">' + 278 '<style type="text/css">.st0{stroke:#FFFFFF;stroke-width:2;stroke-miterlimit:10;}</style><g id="fullscreen-exit">' + 279 '<path class="st0" d="M2.6,27h6.8v6.8h4.5V22.5H2.6V27z M9.4,8.9H2.6v4.5h11.3V2.1H9.4V8.9z M23,33.8h4.5V27h6.8v-4.5H23V33.8z' + 280 'M27.5,8.9V2.1H23v11.3h11.3V8.9H27.5z M27.5,8.9"/></g></svg>' + 281 '</span>'; 282 283 $el.after('<div class="fullscreen">' + fullScreen + '</div>'); 284 285 $(document).on('fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange', function() { 286 $('.rwd-SlideWrapper').toggleClass('rwd-fullscreen-on'); 287 $('.rwd-Pager.rwd-Gallery').toggleClass('rwd-fullscreen-on'); 288 289 if(!$('.rwd-SlideWrapper').hasClass('rwd-fullscreen-on')){ 290 $('.rwd-fullscreen').toggleClass('active'); 291 $this.exitFullscreen(); 292 } 293 }); 294 295 $('.rwd-fullscreen svg').on('click', function() { 296 $('.rwd-fullscreen').toggleClass('active'); 297 if (!document.fullscreenElement && !document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement) { 298 $this.requestFullscreen(); 299 } else { 300 $this.exitFullscreen(); 301 } 302 }); 303 } 304 }; 305 plugin.requestFullscreen = function() { 306 var el = document.documentElement; 307 308 if (el.requestFullscreen) { 309 el.requestFullscreen(); 310 } else if (el.msRequestFullscreen) { 311 el.msRequestFullscreen(); 312 } else if (el.mozRequestFullScreen) { 313 el.mozRequestFullScreen(); 314 } else if (el.webkitRequestFullscreen) { 315 el.webkitRequestFullscreen(); 316 } 317 318 var $sl = $el.parent().parent().parent(); 319 320 $('body').prepend($sl); 321 322 var $h = 0; 323 324 $h = settings.hThumbHeight; 325 326 if($h > 50 && $h <= 100){ 327 $h *= 1.5; 328 } else if($h <= 50){ 329 $h *= 2; 330 } else if($h > 100){ 331 $h *= 1.25; 332 } 333 334 if(settings.title || settings.description) { 335 $h += 45; 336 } 337 338 setTimeout(function(){ 339 $('html, body').css('overflow', 'hidden'); 340 341 $sl.css({ 342 'max-width': 'none', 343 'width': '100%', 344 'height': $(window).height() + 'px', 345 'position': 'fixed', 346 'z-index': '999999999' 347 }); 348 349 if(!settings.vertical){ 350 if(settings.thumbPosition){ 351 $('.rwd-SlideWrapper').css({ 352 'height': $(window).height() + 'px' 353 }); 354 } else { 355 $('.rwd-SlideWrapper').css({ 356 'height': $(window).height() - $h + 'px' 357 }); 358 } 359 } 360 361 $('.rwd-SlideOuter').parent().css({ 362 'background': 'white' 363 }); 364 365 if(!settings.vertical && settings.thumbPosition){ 366 setTimeout(function(){ 367 $('.rwd-SlideOuter').prepend($('.thumbAction')); 368 }, 300) 369 } 370 371 }, 360); 372 373 $('.rwd-SlideOuter').css({ 374 visibility: 'hidden', 375 opacity: '0' 376 }); 377 378 for(var i = 0; i < 5; i++){ 379 setTimeout(function(){ 380 refresh.init(); 381 }, i * 400);
382 } 383 384 setTimeout(function(){ 385 $('.rwd-SlideOuter').css({ 386 visibility: 'visible', 387 opacity: '1' 388 }); 389 }, 1600); 390 391 $('div[class*=share_buttons_]').hide(); 392 }; 393 plugin.exitFullscreen = function() { 394 if (document.exitFullscreen) { 395 document.exitFullscreen(); 396 } else if (document.msExitFullscreen) { 397 document.msExitFullscreen(); 398 } else if (document.mozCancelFullScreen) { 399 document.mozCancelFullScreen(); 400 } else if (document.webkitExitFullscreen) { 401 document.webkitExitFullscreen(); 402 } 403 404 var $sl = $el.parent().parent().parent(), 405 $p = $('.slider-parent'); 406 407 $p.after($sl); 408 409 $('html, body').css('overflow', ''); 410 411 $sl.css({ 412 'max-width': '', 413 'width': '', 414 'height': '', 415 'position': '', 416 'z-index': '' 417 }); 418 419 $('.rwd-SlideWrapper').css({ 420 'height': '' 421 }); 422 423 $('.rwd-SlideOuter').parent().css({ 424 'background': '' 425 }); 426 427 if(!settings.vertical && settings.thumbPosition){ 428 setTimeout(function(){ 429 $('.rwd-SlideOuter').prepend($('.thumbAction')); 430 }, 320); 431 } 432 433 $('.rwd-SlideOuter').css({ 434 visibility: 'hidden', 435 opacity: '0' 436 }); 437 438 for(var i = 0; i < 5; i++){ 439 setTimeout(function(){ 440 refresh.init(); 441 }, i * 400); 442 } 443 444 setTimeout(function(){ 445 $('.rwd-SlideOuter').css({ 446 visibility: 'visible', 447 opacity: '1' 448 }); 449 }, 1600); 450 451 $('div[class*=share_buttons_]').show(); 452 }; 453 plugin.initialStyle = function () { 454 var $this = this; 455 456 $el.addClass('huge_it_slider').wrap('<div class="rwd-SlideOuter"><div class="rwd-SlideWrapper"></div></div>'); 457 $slide = $el.parent('.rwd-SlideWrapper'); 458 if (settings.vertical) { 459 $slide.parent().addClass('vertical'); 460 elSize = settings.sliderHeight; 461 $slide.css('height', elSize + 'px'); 462 } else { 463 elSize = $el.outerWidth(); 464 } 465 $children.addClass('rwd-slide'); 466 if (settings.mode === 'slide') { 467 refresh.calSW(); 468 refresh.clone = function () { 469 if (refresh.calWidth(true) > elSize) { 470 var tWr = 0, 471 tI = 0; 472 for (var k = 0; k < $children.length; k++) { 473 tWr += parseInt($el.find('.rwd-slide').eq(k).width()); 474 tI++; 475 if (tWr >= elSize) { 476 break; 477 } 478 } 479 var tItem = settings.item; 480 481 if (tItem < $el.find('.clone.left').length) { 482 for (var i = 0; i < $el.find('.clone.left').length - tItem; i++) { 483 $children.eq(i).remove(); 484 } 485 } 486 if (tItem < $el.find('.clone.right').length) { 487 for (var j = $children.length - 1; j > ($children.length - 1 - $el.find('.clone.right').length); j--) { 488 scene--; 489 $children.eq(j).remove(); 490 } 491 } 492 493 for (var n = $el.find('.clone.right').length; n < tItem; n++) { 494 $el.find('.rwd-slide').eq(n).clone().removeClass('rwd-slide').addClass('clone right').appendTo($el); 495 scene++; 496 } 497 for (var m = $el.find('.rwd-slide').length - $el.find('.clone.left').length; m > ($el.find('.rwd-slide').length - tItem); m--) { 498 $el.find('.rwd-slide').eq(m - 1).clone().removeClass('rwd-slide').addClass('clone left').prependTo($el); 499 } 500 $children = $el.children();
501 } else { 502 if ($children.hasClass('clone')) { 503 $el.find('.clone').remove(); 504 $this.move($el, 0); 505 } 506 } 507 }; 508 refresh.clone(); 509 } 510 refresh.sSW = function () { 511 length = $children.length; 512 $children.css(property, slideWidth + 'px'); 513 $children.css(gutter, '0px'); 514 w = refresh.calWidth(false); 515 $el.css(property, w + 'px'); 516 if (settings.mode === 'slide') { 517 if (on === false) { 518 scene = $el.find('.clone.left').length; 519 } 520 } 521 }; 522 refresh.calL = function () { 523 $children = $el.children(); 524 length = $children.length; 525 }; 526 if (this.doCss()) { 527 $slide.addClass('usingCss'); 528 } 529 refresh.calL(); 530 if (settings.mode === 'slide') { 531 refresh.calSW(); 532 refresh.sSW(); 533 534 slideValue = $this.slideValue(); 535 this.move($el, slideValue); 536 537 if (settings.vertical === false) { 538 this.setHeight($el, false); 539 } 540 541 } else { 542 this.setHeight($el, true); 543 $el.addClass('rwd-Fade'); 544 if (!this.doCss()) { 545 $children.fadeOut(0); 546 $children.eq(scene).fadeIn(0); 547 } 548 } 549 if (settings.mode === 'slide') { 550 $children.eq(scene).addClass('active'); 551 } else { 552 $children.first().addClass('active'); 553 } 554 555 $('.rslider_iframe_cover').height($('.rslider_iframe_cover').parent().height()); 556 }; 557 plugin.pager = function () { 558 var $this = this; 559 refresh.createPager = function () { 560 var $size; 561 562 if (settings.vertical) { 563 $size = settings.sliderHeight; 564 } else { 565 $size = elSize; 566 } 567 568 thumbWidth = ($size - ((settings.thumbItem * (settings.thumbMargin)) - settings.thumbMargin)) / settings.thumbItem; 569 570 var $children = $slide.find('.rwd-slide'); 571 var length = $slide.find('.rwd-slide').length; 572 var i = 0, 573 pagers = '', 574 v = 0; 575 576 for (i = 0; i < length; i++) { 577 if (settings.mode === 'slide') { 578 v = i * slideWidth; 579 } 580 var thumb = $children.eq(i).attr('data-thumb'); 581 var title = $children.eq(i).attr('data-title') || ''; 582 var description = $children.eq(i).attr('data-description') || ''; 583 584 if(settings.title && !settings.vertical){ 585 title = title.substring(0, settings.titlesymbollimit); 586 } 587 588 if(settings.description && !settings.vertical){ 589 description = description.substring(0, settings.descsymbollimit); 590 } 591 592 var $shift = '', $wT = ''; 593 594 if(settings.vertical && (settings.title || settings.description)){ 595 $shift = 'margin-left'; 596 $wT = settings.vThumbWidth + 5; 597 } 598 599 var $t = '', $d = '', $dH = ''; 600 601 if(settings.vertical){ 602 var $h = Math.floor(($('.rwd-Pager.rwd-Gallery li').height() - 21.5) / 16.5) * 16.5; 603 $dH = 'height: ' + $h + 'px;'; 604 } 605 606 if(settings.title){ 607 $t= '<p class="thumb_title" style="' + $shift + ':' + $wT + 'px">' + title + '</p>'; 608 } 609 610 if(settings.description){ 611 $d = '<p class="thumb_description" style="'+ $dH + $shift + ':' + $wT + 'px">' + description + '</p>'; 612 } 613 614 if (settings.gallery === true) { 615 pagers += '<li style="width:100%;' + property + ':' + thumbWidth + 'px;
615' + gutter + ':' + settings.thumbMargin + 'px">' + 616 '<a href="#"><img src="' + thumb + '"/>' + 617 $t + 618 $d + 619 '</a></li>'; 620 } else { 621 pagers += '<li><a href="#">' + (i + 1) + '</a></li>'; 622 } 623 624 if (settings.mode === 'slide') { 625 if ((v) >= w - elSize) { 626 i = i + 1; 627 var minPgr = 2; 628 if (i < minPgr) { 629 pagers = null; 630 $slide.parent().addClass('noPager'); 631 } else { 632 $slide.parent().removeClass('noPager'); 633 } 634 break; 635 } 636 } 637 } 638 var $cSouter = $slide.parent(); 639 $cSouter.find('.rwd-Pager').html(pagers); 640 if (settings.gallery === true) { 641 if (settings.vertical === true) { 642 if(settings.title || settings.description) { 643 $cSouter.find('.rwd-Pager img').css({ 644 'width': settings.vThumbWidth + 'px', 645 'float': 'left' 646 }); 647 648 if($el.parent().parent().parent().parent().width() > 600) { 649 $cSouter.find('.rwd-Pager').css('width', (settings.vThumbWidth + 150) + 'px'); 650 } else { 651 $cSouter.find('.rwd-Pager').css('width', '100%'); 652 $cSouter.find('.rwd-Pager p').css('width', 'calc(100% - 105px)'); 653 } 654 } else { 655 $cSouter.find('.rwd-Pager').css('width', settings.vThumbWidth + 'px'); 656 } 657 } else { 658 $cSouter.find('.rwd-Pager img').css({ 659 'height': settings.hThumbHeight + 'px' 660 }); 661 } 662 663 pagerWidth = (i * (settings.thumbMargin + thumbWidth)) + 0.5; 664 $cSouter.find('.rwd-Pager').css({ 665 property: pagerWidth + 'px', 666 'transition-duration': settings.speed + 'ms' 667 }); 668 669 if($el.parent().parent().parent().parent().width() > 600){ 670 if (settings.vertical === true && settings.thumbPosition === false) { 671 if(settings.title || settings.description){ 672 $slide.parent().css('padding-right', (settings.vThumbWidth + 155) + 'px'); 673 } else { 674 $slide.parent().css('padding-right', settings.vThumbWidth + 5 + 'px'); 675 } 676 } 677 678 if(!settings.vertical && !$('.rwd-Pager.rwd-Gallery').hasClass('rwd-fullscreen-on')){ 679 $('.thumb_description').show(); 680 } 681 } else { 682 if (settings.vertical === true && settings.thumbPosition === false) { 683 $slide.parent().css('padding-right', ''); 684 } 685 if(!settings.vertical){ 686 $('.thumb_description').hide(); 687 } 688 } 689 690 $cSouter.find('.rwd-Pager').css(property, pagerWidth + 'px'); 691 } 692 var $pager = $cSouter.find('.rwd-Pager').find('li'); 693 $pager.first().addClass('active'); 694 $pager.on('click', function () { 695 if(!$slide.hasClass('thumb_moving')){ 696 $slide.removeClass('thumb_move'); 697 } 698 if (settings.mode === 'slide') { 699 scene = scene + ($pager.index(this) - $cSouter.find('.rwd-Pager').find('li.active').index()); 700 } else { 701 scene = $pager.index(this); 702 } 703 $el.mode(false); 704 if (settings.gallery === true) { 705 $this.slideThumb(); 706 } 707 return false; 708 }); 709 710 if(settings.view === 'carousel1') { 711 var $h = (settings.maxHeight / settings.maxWidth) * jQuery('.rwd-SlideOuter').width(); 712 jQuery('.rwd-SlideOuter').height($h); 713 if (settings.dotsPos === 'top') { 714 jQuery('.rwd-Pager.rwd-pg').css({ 715 top: (jQuery('.rwd-SlideWrapper').height() - jQuery('.rwd-SlideOuter').height()) / 2 + 10 + 'px' 716 }); 717 } else { 718 jQuery('.rwd-Pager.rwd-pg').css({ 719 bottom: (jQuery('.rwd-SlideWrapper').height() - jQuery('.rwd-SlideOuter').height()) / 2 - jQuery('.rwd-SlideWrapper').height() + 15 + 'px' 720 }); 721 } 722 } 723 724 if(settings.thumbdragdrop){ 725 plugin.enableThumbDrag(); 726 } 727 728 if(settings.thumbswipe){ 729 plugin.enableThumbTouch(); 730 } 731 732 if(settings.pager){ 733 var gMargin = '', $s = '', gM = 5; 734 735 if(settings.vertical){ 736 if(settings.thumbPosition){ 737 gMargin = 'margin-left'; 738 gM = 0; 739 $slide.parent().find('.rwd-Pager').css({'left': '0px', 'position': 'absolute'}); 740 if(settings.title || settings.description){ 741 $slide.parent().find('.rwd-SlideWrapper').css('margin-left', (settings.vThumbWidth + 155) + 'px'); 742 } else { 743 $slide.parent().find('.rwd-SlideWrapper').css('margin-left', settings.vThumbWidth + 5 + 'px'); 744 } 745 if($el.parent().parent().parent().parent().width() > 600) { 746 if (settings.title || settings.description) { 747 $slide.parent().find('.rwd-SlideWrapper').css('margin-left', (settings.vThumbWidth + 155) + 'px'); 748 } 749 750 $slide.parent().find('.rwd-Pager').css({'position': 'absolute'}); 751 752 $('.rwd-SlideOuter.vertical').prepend($('.rwd-SlideOuter.vertical .rwd-Gallery').parent()); 753 754 $('.rwd-SlideOuter.vertical .rwd-Gallery').parent().css({ 755 'overflow': '', 756 'margin-top': '' 757 }); 758 759 $('.thumbAction').show(); 760 } else { 761 if (settings.title || settings.description) { 762 $slide.parent().find('.rwd-SlideWrapper').css('margin-left', ''); 763 } 764 765 $slide.parent().find('.rwd-Pager').css({'position': ''}); 766 767 $('.rwd-SlideOuter.vertical').append($('.rwd-SlideOuter.vertical .rwd-Gallery').parent()); 768 769 $('.rwd-SlideOuter.vertical .rwd-Gallery').parent().css({ 770 'overflow': 'hidden', 771 'margin-top': '5px' 772 }); 773 774 $('.thumbAction').hide(); 775 } 776 } else { 777 if($el.parent().parent().parent().parent().width() > 600) { 778 $slide.parent().find('.rwd-Pager').css({'position': 'absolute'}); 779 if (settings.title || settings.description) { 780 $('.rwd-SlideOuter.vertical .rwd-Gallery').css({ 781 'margin-top': -$('.rwd-SlideWrapper').height() + 'px', 782 'margin-left': 'calc(100% - ' + (settings.vThumbWidth + 150) + 'px)' 783 }); 784 } else { 785 $('.rwd-SlideOuter.vertical .rwd-Gallery').css({ 786 'margin-top': -$('.rwd-SlideWrapper').height() + 'px', 787 'margin-left': 'calc(100% - ' + settings.vThumbWidth + 'px)' 788 }); 789 } 790 $('.rwd-SlideOuter.vertical .rwd-Gallery').parent().css({ 791 'overflow': '', 792 'margin-top': '' 793 }); 794 795 $('.thumbAction').show(); 796 } else { 797 $('.rwd-SlideOuter.vertical .rwd-Gallery').css({ 798 'margin-top': '', 799 'margin-left': '', 800 'position': '' 801 }); 802 $('.rwd-SlideOuter.vertical .rwd-Gallery').parent().css({ 803 'overflow': 'hidden', 804 'margin-top': '5px' 805 }); 806 807 $('.thumbAction').hide(); 808 } 809 } 810 811 if($el.parent().parent().parent().parent().width() <= 600){ 812 $('.rwd-SlideOuter.vertical').css('height', (settings.sliderHeight + 5 + 4 * (settings.sliderHeight - settings.thumbItem * settings.thumbMargin + settings.thumbMargin) / settings.thumbItem) + 'px'); 813 } else { 814 $('.rwd-SlideOuter.vertical').css('height', ''); 815 } 816 } else { 817 if(settings.thumbPosition){ 818 gMargin = 'margin-bottom'; 819 $s = $slide.parent().find('.rwd-Pager'); 820 $('.rwd-SlideOuter').prepend($s); 821 } else { 822 gMargin = 'margin-top'; 823 } 824 } 825 826 $slide.parent().find('.rwd-Pager').css(gMargin, gM + 'px'); 827 } 828 }; 829 830 if (settings.pager) { 831 var cl = 'rwd-pg'; 832 if (settings.gallery) { 833 cl = 'rwd-Gallery'; 834 } 835 836 if((hugeitSliderObj.navigation_position === 'top' && !sett
836ings.gallery) || (settings.vertical && settings.thumbPosition)){ 837 $slide.before('<div><ul class="rwd-Pager ' + cl + '"></ul></div>'); 838 } else { 839 $slide.after('<div><ul class="rwd-Pager ' + cl + '"></ul></div>'); 840 } 841 842 refresh.createPager(); 843 } 844 845 setTimeout(function () { 846 refresh.init(); 847 }, 0); 848 }; 849 plugin.setHeight = function (ob, fade) { 850 var obj = null, 851 $this = this; 852 853 obj = ob.children('.rwd-slide ').first(); 854 855 var setCss = function () { 856 var tH = obj.outerHeight(), 857 tP = 0, 858 tHT = tH, 859 tH_; 860 861 tH_ = obj.parent().find('li:not(.video_iframe)').outerHeight(); 862 863 if(tH < tH_){ 864 tH = tH_; 865 } 866 867 if (fade) { 868 tH = settings.sliderHeight; 869 tP = ((tHT) * 100) / elSize; 870 } 871 872 if(settings.view === 'carousel1'){ 873 $('.rwd-SlideWrapper').css({ 874 height: tH + 20 + 'px' 875 }); 876 } 877 878 if(!$slide.hasClass('rwd-fullscreen-on')){ 879 ob.css({ 880 'height': tH + 'px', 881 'padding-bottom': tP + '%' 882 }); 883 } else { 884 ob.css({ 885 'height': '100%', 886 'padding-bottom': tP + '%' 887 }); 888 } 889 }; 890 setCss(); 891 if (obj.find('img, iframe').length) { 892 if ( obj.find('img, iframe')[0].complete) { 893 setCss(); 894 if (!interval) { 895 $this.auto(); 896 } 897 }else{ 898 obj.find('img, iframe').on('load', function () { 899 setTimeout(function () { 900 setCss(); 901 if (!interval) { 902 $this.auto(); 903 } 904 }, 100); 905 }); 906 } 907 }else{ 908 if (!interval) { 909 $this.auto(); 910 } 911 } 912 }; 913 plugin.active = function (ob, t) { 914 if (this.doCss() && settings.mode === 'fade') { 915 $slide.addClass('on'); 916 } 917 var sc = 0; 918 if (scene < length) { 919 ob.removeClass('active'); 920 if (!this.doCss() && settings.mode === 'fade' && t === false) { 921 ob.fadeOut(settings.speed); 922 } 923 924 sc = scene; 925 926 var l, nl; 927 if (t === true) { 928 l = ob.length; 929 nl = l - 1; 930 if (sc + 1 >= l) { 931 sc = nl; 932 } 933 } 934 if (settings.mode === 'slide') { 935 if (t === true) { 936 sc = scene - $el.find('.clone.left').length; 937 } else { 938 sc = scene; 939 } 940 if (t === true) { 941 l = ob.length; 942 nl = l - 1; 943 if (sc + 1 === l) { 944 sc = nl; 945 } else if (sc + 1 > l) { 946 sc = 0; 947 } 948 } 949 } 950 951 if (!this.doCss() && settings.mode === 'fade' && t === false) { 952 ob.eq(sc).fadeIn(settings.speed); 953 } 954 ob.eq(sc).addClass('active'); 955 } else { 956 ob.removeClass('active'); 957 ob.eq(ob.length - 1).addClass('active'); 958 if (!this.doCss() && settings.mode === 'fade' && t === false) { 959 ob.fadeOut(settings.speed); 960 ob.eq(sc).fadeIn(settings.speed); 961 } 962 } 963 }; 964 plugin.move = function (ob, v) { 965 ob.attr('data-left', v); 966 967 if(settings.view === 'carousel1') { 968 if (settings.item === 3) { 969 settings.slideMargin = 20; 970 } 971
972 v = v - Math.floor(settings.item / 2) * slideWidth; 973 } 974 975 if (this.doCss()) { 976 if (settings.vertical === true) { 977 ob.css({ 978 'transform': 'translate3d(0px, ' + (-v) + 'px, 0px)', 979 '-webkit-transform': 'translate3d(0px, ' + (-v) + 'px, 0px)' 980 }); 981 } else { 982 ob.css({ 983 'transform': 'translate3d(' + (-v) + 'px, 0px, 0px)', 984 '-webkit-transform': 'translate3d(' + (-v) + 'px, 0px, 0px)' 985 }); 986 } 987 } else { 988 if (settings.vertical === true) { 989 ob.css('position', 'relative').animate({ 990 top: -v + 'px' 991 }, settings.speed, 'linear'); 992 } else { 993 ob.css('position', 'relative').animate({ 994 left: -v + 'px' 995 }, settings.speed, 'linear'); 996 } 997 } 998 var $thumb = $slide.parent().find('.rwd-Pager').find('li'); 999 this.active($thumb, true); 1000 }; 1001 plugin.move_ = function (ob, v) { 1002 if (settings.rtl === true) { 1003 v = -v; 1004 } 1005 1006 if (this.doCss()) { 1007 ob.css({ 1008 'transform': 'translate3d(' + (-v) + 'px, 0px, 0px)', 1009 '-webkit-transform': 'translate3d(' + (-v) + 'px, 0px, 0px)' 1010 }); 1011 } else { 1012 ob.css('position', 'relative').animate({ 1013 left: -v + 'px' 1014 }, settings.speed, settings.easing); 1015 } 1016 var $thumb = $slide.parent().find('.rwd-Pager').find('li'); 1017 this.active($thumb, true); 1018 }; 1019 plugin.fade = function () { 1020 this.active($children, false); 1021 var $thumb = $slide.parent().find('.rwd-Pager').find('li'); 1022 this.active($thumb, true); 1023 }; 1024 plugin.slide = function () { 1025 var $this = this; 1026 refresh.calSlide = function () { 1027 if (w > elSize) { 1028 slideValue = $this.slideValue(); 1029 $this.active($children, false); 1030 if ((slideValue) > w - elSize) { 1031 slideValue = w - elSize; 1032 } else if (slideValue < 0) { 1033 slideValue = 0; 1034 } 1035 $this.move($el, slideValue); 1036 if (settings.mode === 'slide') { 1037 if (scene >= length - $el.find('.clone.left').length) { 1038 $this.resetSlide($el.find('.clone.left').length); 1039 } 1040 if (scene === 0) { 1041 $this.resetSlide($slide.find('.rwd-slide').length); 1042 } 1043 } 1044 } 1045 }; 1046 refresh.calSlide(); 1047 }; 1048 plugin.resetSlide = function (s) { 1049 var $this = this; 1050 $slide.find('.rwd-Action a').addClass('disabled'); 1051 setTimeout(function () { 1052 scene = s; 1053 $slide.css('transition-duration', '0ms'); 1054 slideValue = $this.slideValue(); 1055 $this.active($children, false); 1056 plugin.move($el, slideValue); 1057 setTimeout(function () { 1058 $slide.css('transition-duration', settings.speed + 'ms'); 1059 $slide.find('.rwd-Action a').removeClass('disabled'); 1060 }, 50); 1061 }, settings.speed + 100); 1062 }; 1063 plugin.slideValue = function () { 1064 var _sV = 0; 1065 _sV = scene * slideWidth; 1066 1067 return _sV; 1068 }; 1069 plugin.slideThumb = function () { 1070 var position; 1071 1072 position = (elSize / 2) - (thumbWidth / 2); 1073 1074 var sc = scene - $el.find('.clone.left').length; 1075 var $pager = $slide.parent().find('.rwd-Pager'); 1076 if (settings.mode === 'slide') { 1077 if (sc >= $pager.children().length) { 1078 sc = 0; 1079 } else if (sc < 0) { 1080 sc = $pager.children().length; 1081 } 1082 } 1083 var thumbSlide = sc * ((thumbWidth + settings.thumbMargin)) - (position); 1084 if ((thumbSlide + elSize) > pagerWidth) { 1085 thumbSlide = pagerWidth - elSize - settings.thumbMargin; 1086 } 1087 if (thumbSlide < 0) { 1088 thumbSlide = 0; 1089 } 1090 if(settings.view === 'carousel1'){ 1091 this.move_($pager, thumbSlide); 1092 } else { 1093 if(!$slide.hasClass('thumb_move')){ 1094 this.move($pager, thumbSlide); 1095 } 1096 } 1097 }; 1098 plugin.auto = function () { 1099 clearInterval(interval); 1100 interval = setInterval(function () { 1101 $el.goToNextSlide(); 1102 }, settings.pause); 1103 }; 1104 plugin.pauseOnHover = function(){ 1105 var $this = this; 1106 if (settings.pauseOnHover) { 1107 $slide.on('mouseenter', function(){ 1108 $(this).addClass('isHover'); 1109 $el.pause(); 1110 }); 1111 $slide.on('mouseleave',function(){ 1112 $(this).removeClass('isHover'); 1113 if (!$slide.find('.huge_it_slider').hasClass('isGrabbing')) { 1114 if(!$('.rwd-SlideWrapper').hasClass('videoIsPlay')){ 1115 $this.auto(); 1116 } 1117 } 1118 }); 1119 } 1120 }; 1121 plugin.touchMove = function (endCoords, startCoords) { 1122 $slide.css('transition-duration', '0ms'); 1123 if (settings.mode === 'slide') { 1124 var distance = endCoords - startCoords; 1125 var swipeVal = slideValue - distance; 1126 if ((swipeVal) >= w - elSize) { 1127 var swipeValT = w - elSize; 1128 swipeVal = swipeValT + ((swipeVal - swipeValT) / 5); 1129 } else if (swipeVal < 0) { 1130 swipeVal = swipeVal / 5; 1131 } 1132 this.move($el, swipeVal); 1133 } 1134 }; 1135 plugin.touchEnd = function (distance) { 1136 $slide.css('transition-duration', settings.speed + 'ms'); 1137 if (settings.mode === 'slide') { 1138 var mxVal = false; 1139 var _next = true; 1140 slideValue = slideValue - distance; 1141 if ((slideValue) > w - elSize) { 1142 slideValue = w - elSize; 1143 mxVal = true; 1144 } else if (slideValue < 0) { 1145 slideValue = 0; 1146 } 1147 var gC = function (next) { 1148 var ad = 0; 1149 if (!mxVal) { 1150 if (next) { 1151 ad = 1; 1152 } 1153 } 1154 var num = slideValue / slideWidth; 1155 scene = parseInt(num) + ad; 1156 if (slideValue >= (w - elSize)) { 1157 if (num % 1 !== 0) { 1158 scene++; 1159 } 1160 } 1161 }; 1162 if (distance >= 45) { 1163 gC(false); 1164 _next = false; 1165 } else if (distance <= -45) { 1166 gC(true); 1167 _next = false; 1168 } 1169 $el.mode(_next); 1170 this.slideThumb(); 1171 } else { 1172 if (distance >= 45) { 1173 $el.goToPrevSlide(); 1174 } else if (distance <= -45) { 1175 $el.goToNextSlide(); 1176 } 1177 } 1178 }; 1179 plugin.enableDrag = function () { 1180 var $this = this; 1181 if (!isTouch) { 1182 var startCoords = 0, 1183 endCoords = 0, 1184 isDraging = false; 1185 $slide.find('.huge_it_slider').addClass('isGrab'); 1186 $slide.on('mousedown', function (e) { 1187 if (w < elSize) { 1188 if (w !== 0) { 1189 return false; 1190 } 1191 } 1192 if ($(e.target).attr('class') !== ('rwd-Prev') && $(e.target).attr('class') !== ('rwd-Next')) { 1193 startCoords = (settings.vertical === true) ? e.pageY : e.pageX; 1194 isDraging = true; 1195 if (e.preventDefault) { 1196 e.preventDefault(); 1197 } else { 1198 e.returnValue = false; 1199 } 1200 $slide.scrollLeft += 1; 1201 $slide.scrollLeft -= 1; 1202 $slide.find('.huge_it_slider').removeClass('isGrab').addClass('isGrabbing'); 1203 clearInterval(interval); 1204 } 1205 }); 1206 $(window).on('mousemove', function (e) { 1207 if (isDraging) { 1208 endCoords = (settings.vertical === true) ? e.pageY : e.pageX; 1209 $this.touchMove(endCoords, startCoords);
1210 } 1211 }); 1212 $(window).on('mouseup', function (e) { 1213 if (isDraging) { 1214 $slide.find('.huge_it_slider').removeClass('isGrabbing').addClass('isGrab'); 1215 isDraging = false; 1216 endCoords = (settings.vertical === true) ? e.pageY : e.pageX; 1217 var distance = endCoords - startCoords; 1218 if (Math.abs(distance) >= 45) { 1219 $(window).on('click', function (e) { 1220 if (e.preventDefault) { 1221 e.preventDefault(); 1222 } else { 1223 e.returnValue = false; 1224 } 1225 e.stopImmediatePropagation(); 1226 e.stopPropagation(); 1227 $(window).off('click'); 1228 }); 1229 } 1230 $this.touchEnd(distance); 1231 } 1232 }); 1233 } 1234 }; 1235 plugin.enableThumbDrag = function(){ 1236 if (settings.pager && settings.gallery) { 1237 var $this = this, 1238 $pager = $slide.parent().find('.rwd-Pager'); 1239 1240 if (!isTouch) { 1241 var tempLeft = 0, 1242 startCoords = 0, 1243 endCoords = 0, 1244 swipeVal = 0, 1245 distance, 1246 isDraging = false; 1247 1248 $slide.find('.rwd-Gallery').addClass('isGrab'); 1249 1250 $('.rwd-Gallery').on('mousedown', function (e) { 1251 $slide.addClass('thumb_move'); 1252 1253 tempLeft = parseInt($pager.attr('data-left')); 1254 1255 startCoords = (settings.vertical === true) ? e.pageY : e.pageX; 1256 isDraging = true; 1257 if (e.preventDefault) { 1258 e.preventDefault(); 1259 } else { 1260 e.returnValue = false; 1261 } 1262 $slide.scrollLeft += 1; 1263 $slide.scrollLeft -= 1; 1264 $slide.find('.rwd-Gallery').removeClass('isGrab').addClass('isGrabbing'); 1265 }); 1266 1267 $('.rwd-Gallery').on('mousemove', function (e) { 1268 if (isDraging) { 1269 $pager.css('transition-duration', '0ms'); 1270 $slide.addClass('thumb_moving'); 1271 1272 endCoords = (settings.vertical === true) ? e.pageY : e.pageX; 1273 1274 distance = endCoords - startCoords; 1275 1276 swipeVal = tempLeft - distance; 1277 if (settings.vertical === true) { 1278 if (swipeVal > $pager.height() - $('.rwd-SlideWrapper').height()) { 1279 swipeVal = $pager.height() - $('.rwd-SlideWrapper').height() - settings.thumbMargin; 1280 } 1281 } else { 1282 if (swipeVal > $pager.width() - $('.rwd-SlideWrapper').width()) { 1283 swipeVal = $pager.width() - $('.rwd-SlideWrapper').width() - settings.thumbMargin; 1284 } 1285 } 1286 1287 if (swipeVal < 0) { 1288 swipeVal = 0; 1289 } 1290 1291 $this.move($pager, swipeVal); 1292 } 1293 }); 1294 1295 $('.rwd-Gallery').on('mouseup', function (e) { 1296 if (isDraging) { 1297 setTimeout(function(){ 1298 $slide.removeClass('thumb_moving'); 1299 }, 0); 1300 1301 endCoords = (settings.vertical === true) ? e.pageY : e.pageX; 1302 1303 distance = endCoords - startCoords; 1304 1305 swipeVal = tempLeft - distance; 1306 if (settings.vertical === true) { 1307 if (swipeVal > $pager.height() - $('.rwd-SlideWrapper').height()) { 1308 swipeVal = $pager.height() - $('.rwd-SlideWrapper').height() - settings.thumbMargin; 1309 } 1310 } else { 1311 if (swipeVal > $pager.width() - $('.rwd-SlideWrapper').width()) { 1312 swipeVal = $pager.width() - $('.rwd-SlideWrapper').width() - settings.thumbMargin; 1313 } 1314 } 1315 1316 if (swipeVal < 0) { 1317 swipeVal = 0; 1318 } 1319 1320 $this.move($pager, swipeVal); 1321 1322 $pager.attr('data-left', swipeVal); 1323 1324 $slide.find('.rwd-Gallery').removeClass('isGrabbing').addClass('isGrab'); 1325 isDraging = false; 1326 endCoords = (settings.vertical === true) ? e.pageY : e.pageX; 1327 var distance = endCoords - startCoords; 1328 if (Math.abs(distance) >= 45) { 1329 $(window).on('click', function (e) { 1330 if (e.preventDefault) { 1331 e.preventDefault(); 1332 } else { 1333 e.returnValue = false; 1334 } 1335 e.stopImmediatePropagation(); 1336 e.stopPropagation(); 1337 $(window).off('click'); 1338 }); 1339 } 1340 } 1341 }); 1342 } 1343 } 1344 }; 1345 plugin.enableTouch = function () { 1346 var $this = this; 1347 if (isTouch) { 1348 var startCoords = {}, 1349 endCoords = {}; 1350 $slide.on('touchstart', function (e) { 1351 endCoords = e.originalEvent.targetTouches[0]; 1352 startCoords.pageX = e.originalEvent.targetTouches[0].pageX; 1353 startCoords.pageY = e.originalEvent.targetTouches[0].pageY; 1354 clearInterval(interval); 1355 }); 1356 $slide.on('touchmove', function (e) { 1357 if (w < elSize) { 1358 if (w !== 0) { 1359 return false; 1360 } 1361 } 1362 var orig = e.originalEvent; 1363 endCoords = orig.targetTouches[0];
vendor: 1,145 bytes, lines 1364-1388
1364 var xMovement = Math.abs(endCoords.pageX - startCoords.pageX); 1365 var yMovement = Math.abs(endCoords.pageY - startCoords.pageY); 1366 if (settings.vertical === true) { 1367 if ((yMovement * 3) > xMovement) { 1368 e.preventDefault(); 1369 } 1370 $this.touchMove(endCoords.pageY, startCoords.pageY); 1371 } else { 1372 if ((xMovement * 3) > yMovement) { 1373 e.preventDefault(); 1374 } 1375 $this.touchMove(endCoords.pageX, startCoords.pageX); 1376 } 1377 1378 }); 1379 $slide.on('touchend', function () { 1380 if (w < elSize) { 1381 if (w !== 0) { 1382 return false; 1383 } 1384 } 1385 var distance; 1386 if (settings.vertical === true) { 1387 distance = endCoords.pageY - startCoords.pageY; 1388 } else {
1389 distance = endCoords.pageX - startCoords.pageX; 1390 } 1391 $this.touchEnd(distance); 1392 }); 1393 } 1394 }; 1395 plugin.enableThumbTouch = function () { 1396 if (settings.pager && settings.gallery) { 1397 var $this = this, 1398 $pager = $slide.parent().find('.rwd-Pager'); 1399 1400 if (isTouch) { 1401 var startCoords = {}, 1402 endCoords = {}, 1403 tempLeft = 0; 1404 1405 $('.rwd-Gallery').on('touchstart', function (e) { 1406 tempLeft = +$pager.attr('data-left'); 1407 1408 endCoords = e.originalEvent.targetTouches[0]; 1409 startCoords.pageX = e.originalEvent.targetTouches[0].pageX; 1410 startCoords.pageY = e.originalEvent.targetTouches[0].pageY; 1411 clearInterval(interval); 1412 }); 1413 $('.rwd-Gallery').on('touchmove', function (e) { 1414 $pager.css('transition-duration', '0ms'); 1415 1416 $slide.addClass('thumb_move'); 1417 1418 if (w < elSize) { 1419 if (w !== 0) { 1420 return false; 1421 } 1422 } 1423 var orig = e.originalEvent; 1424 endCoords = orig.targetTouches[0]; 1425 var xMovement = Math.abs(endCoords.pageX
1425- startCoords.pageX); 1426 var yMovement = Math.abs(endCoords.pageY - startCoords.pageY); 1427 if (settings.vertical) { 1428 if ((yMovement * 3) > xMovement) { 1429 e.preventDefault(); 1430 } 1431 1432 tempLeft = tempLeft - (endCoords.pageY - startCoords.pageY); 1433 1434 if (tempLeft > $pager.height() - $('.rwd-SlideWrapper').height()) { 1435 tempLeft = $pager.height() - $('.rwd-SlideWrapper').height() - settings.thumbMargin; 1436 } 1437 1438 if (tempLeft < 0) { 1439 tempLeft = 0; 1440 } 1441 1442 $this.move($pager, tempLeft); 1443 } else { 1444 if ((xMovement * 3) > yMovement) { 1445 e.preventDefault(); 1446 } 1447 1448 tempLeft = tempLeft - (endCoords.pageX
1448- startCoords.pageX); 1449 1450 if (tempLeft > $pager.width() - $('.rwd-SlideWrapper').width()) { 1451 tempLeft = $pager.width() - $('.rwd-SlideWrapper').width(); 1452 } 1453 1454 if (tempLeft < 0) { 1455 tempLeft = 0; 1456 } 1457 1458 $this.move($pager, tempLeft); 1459 } 1460 }); 1461 $('.rwd-Gallery').on('touchend', function () { 1462 if (settings.vertical) { 1463 if ((yMovement * 3) > xMovement) { 1464 e.preventDefault(); 1465 } 1466 1467 tempLeft = tempLeft - (endCoords.pageY - startCoords.pageY); 1468 1469 if (tempLeft > $pager.height() - $('.rwd-SlideWrapper').height()) { 1470 tempLeft = $pager.height() - $('.rwd-SlideWrapper').height() - settings.thumbMargin; 1471 } 1472 1473 if (tempLeft < 0) { 1474 tempLeft = 0; 1475 } 1476 1477 $this.move($pager, tempLeft); 1478 } else { 1479 if ((xMovement * 3) > yMovement) { 1480 e.preventDefault(); 1481 } 1482 1483 tempLeft = tempLeft - (endCoords.pageX
1483- startCoords.pageX); 1484 1485 if (tempLeft > $pager.width() - $('.rwd-SlideWrapper').width()) { 1486 tempLeft = $pager.width() - $('.rwd-SlideWrapper').width(); 1487 } 1488 1489 if (tempLeft < 0) { 1490 tempLeft = 0; 1491 } 1492 1493 $this.move($pager, tempLeft); 1494 } 1495 1496 $pager.attr('data-left', tempLeft); 1497 1498 if (w < elSize) { 1499 if (w !== 0) { 1500 return false; 1501 } 1502 } 1503 var distance; 1504 if (settings.vertical === true) { 1505 distance = endCoords.pageY - startCoords.pageY; 1506 } else { 1507 distance = endCoords.pageX - startCoords.pageX; 1508 } 1509 $this.touchEnd(distance); 1510 }); 1511 } 1512 } 1513 }; 1514 plugin.build = function () { 1515 var $this = this; 1516 $this.initialStyle(); 1517 if (this.doCss()) { 1518 if(settings.dragdrop){ 1519 $this.enableDrag(); 1520 } 1521 if(settings.swipe){ 1522 $this.enableTouch(); 1523 } 1524 } 1525 1526 $(window).on('focus', function(){ 1527 $this.auto(); 1528 }); 1529 1530 $(window).on('blur', function(){ 1531 clearInterval(interval); 1532 }); 1533 1534 $this.pager(); 1535 $this.pauseOnHover(); 1536 $this.controls(); 1537 $this.thumbControls(); 1538 $this.keyPress(); 1539 $this.fullscreen(); 1540 $this.videoControl(); 1541 }; 1542 plugin.build(); 1543 refresh.init = function () { 1544 if (settings.vertical) { 1545 if (settings.item > 1) { 1546 elSize = settings.sliderHeight; 1547 } else { 1548 elSize = $children.outerHeight(); 1549 } 1550 1551 if(settings.vertical){ 1552 if(!$slide.hasClass('rwd-fullscreen-on')){ 1553 $slide.css('height', elSize + 'px'); 1554 } else { 1555 $slide.css('height', ($(window).height() - 30) + 'px'); 1556 } 1557 } else { 1558 $slide.css('height', elSize + 'px'); 1559 } 1560 } else { 1561 elSize = $slide.outerWidth(); 1562 } 1563 if (settings.mode === 'slide') { 1564 refresh.clone(); 1565 } 1566 refresh.calL(); 1567 if (settings.mode === 'slide') {
1568 $el.removeClass('rwd-Slide'); 1569 } 1570 if (settings.mode === 'slide') { 1571 refresh.calSW(); 1572 refresh.sSW(); 1573 } 1574 setTimeout(function () { 1575 if (settings.mode === 'slide') { 1576 $el.addClass('rwd-Slide'); 1577 } 1578 }, 1000); 1579 if (settings.pager) { 1580 refresh.createPager(); 1581 } 1582 if (settings.mode === 'slide') { 1583 if (settings.vertical === false) { 1584 plugin.setHeight($el, false); 1585 }else{ 1586 plugin.auto(); 1587 } 1588 } else { 1589 plugin.setHeight($el, true); 1590 } 1591 if (settings.gallery === true) { 1592 plugin.slideThumb(); 1593 } 1594 if (settings.mode === 'slide') { 1595 plugin.slide(); 1596 } 1597 if ($children.length <= settings.item) { 1598 $slide.find('.rwd-Action').hide(); 1599 } else { 1600 $slide.find('.rwd-Action').show(); 1601 } 1602 }; 1603 $el.goToPrevSlide = function () { 1604 if (scene > 0) { 1605 scene--; 1606 $el.mode(false); 1607 if (settings.gallery === true) { 1608 plugin.slideThumb(); 1609 } 1610 } else { 1611 if (settings.mode === 'fade') { 1612 var l = (length - 1); 1613 scene = l; 1614 } 1615 $el.mode(false); 1616 if (settings.gallery === true) { 1617 plugin.slideThumb(); 1618 } 1619 } 1620 }; 1621 $el.goToNextSlide = function () { 1622 var nextI = true; 1623 if (settings.mode === 'slide') { 1624 var _slideValue = plugin.slideValue(); 1625 nextI = _slideValue < w - elSize; 1626 } 1627 if ((scene < length) && nextI) { 1628 scene++; 1629 $el.mode(false); 1630 if (settings.gallery === true) { 1631 plugin.slideThumb(); 1632 } 1633 } else { 1634 scene = 0; 1635 $el.mode(false); 1636 if (settings.gallery === true) { 1637 plugin.slideThumb(); 1638 } 1639 } 1640 }; 1641 $el.mode = function (b) { 1642 if (on === false) { 1643 if (settings.mode === 'slide') { 1644 if (plugin.doCss()) {
1645 $el.addClass('rwd-Slide'); 1646 if (settings.speed !== '') { 1647 $slide.css('transition-duration', settings.speed + 'ms'); 1648 } 1649 $slide.css('transition-timing-function','ease'); 1650 } 1651 } else { 1652 if (plugin.doCss()) { 1653 if (settings.speed !== '') { 1654 $el.css('transition-duration', settings.speed + 'ms'); 1655 } 1656 $el.css('transition-timing-function', 'ease'); 1657 } 1658 } 1659 } 1660 if (settings.mode === 'slide') { 1661 plugin.slide(); 1662 } else { 1663 plugin.fade(); 1664 } 1665 if (!$slide.hasClass('isHover')) { 1666 plugin.auto(); 1667 } 1668 1669 if (!b) { 1670 $el.onBeforeSlide.call(this); 1671 } 1672 1673 setTimeout(function () { 1674 if (!b) { 1675 $el.onAfterSlide.call(this, scene); 1676 } 1677 }, settings.speed); 1678 on = true; 1679 }; 1680 $el.onBeforeSlide = function(){ 1681 $('.rwd-SlideWrapper').addClass('lightboxOff'); 1682 1683 $('.rslider_iframe_cover').show(); 1684 1685 $('.rwd-SlideWrapper iframe').each(function(){ 1686 if($(this).attr('src').indexOf('youtube') !== -1){ 1687 $(this).get(0).contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*') 1688 } else if($(this).attr('src').indexOf('vimeo') !== -1){ 1689 try { 1690 $f($(this).get(0)).api('pause'); 1691 } catch (e) { 1692 console.error('Make sure you have included froogaloop2 js'); 1693 } 1694 } 1695 }); 1696 1697 $('.rwd-SlideWrapper').removeClass('videoIsPlay'); 1698 }; 1699 $el.onAfterSlide = function(scene){ 1700 $('.rwd-SlideWrapper').removeClass('lightboxOff'); 1701 1702 $('.rslider_iframe_cover').show(); 1703 1704 $('.rwd-SlideWrapper iframe').each(function(){ 1705 if($(this).attr('src').indexOf('youtube') !== -1){ 1706 $(this).get(0).contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*') 1707 } else if($(this).attr('src').indexOf('vimeo') !== -1){ 1708 try { 1709 $f($(this).get(0)).api('pause'); 1710 } catch (e) { 1711 console.error('Make sure you have included froogaloop2 js'); 1712 } 1713 } 1714 }); 1715 1716 $('.rwd-SlideWrapper').removeClass('videoIsPlay'); 1717 1718 if(parseInt($('.rwd-SlideWrapper ul').attr('data-autoplay')) === 1){ 1719 $('.rslider_iframe_cover').hide(); 1720 1721 var $iframe = $('.rwd-slide').eq(scene - 1).find('iframe'); 1722 1723 if($('.rwd-slide').eq(scene - 1).hasClass('video_iframe')){ 1724 if($iframe.attr('src').indexOf('youtube') !== -1){ 1725 $iframe.get(0).contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}', '*') 1726 } else if($iframe.attr('src').indexOf('vimeo') !== -1){ 1727 try { 1728 $f($iframe.get(0)).api('play'); 1729 } catch (e) { 1730 console.error('Make sure you have included froogaloop2 js'); 1731 } 1732 } 1733 } 1734 1735 $('.rwd-SlideWrapper').addClass('videoIsPlay'); 1736 1737 $el.pause(); 1738 } 1739 }; 1740 $el.play = function () { 1741 $el.goToNextSlide(); 1742 plugin.auto(); 1743 }; 1744 $el.pause = function () { 1745 clearInterval(interval); 1746 }; 1747 $el.refresh = function () { 1748 refresh.init(); 1749 }; 1750 $el.getCurrentSlideCount = function () { 1751 var sc = scene; 1752 var ln = $slide.find('.rwd-slide').length, 1753 cl = $el.find('.clone.left').length; 1754 if (scene <= cl - 1) { 1755 sc = ln + (scene - cl); 1756 } else if (scene >= (ln + cl)) { 1757 sc = scene - ln - cl; 1758 } else { 1759 sc = scene - cl; 1760 } 1761 return sc + 1; 1762 }; 1763 $el.getTotalSlideCount = function () { 1764 return $slide.find('.rwd-slide').length; 1765 }; 1766 $el.goToSlide = function (s) { 1767 scene = (s + $el.find('.clone.left').length - 1); 1768 1769 $el.mode(false); 1770 if (settings.gallery === true) { 1771 plugin.slideThumb(); 1772 } 1773 }; 1774 $el.destroy = function () { 1775 if ($el.RSlider) { 1776 $el.goToPrevSlide = function(){}; 1777 $el.goToNextSlide = function(){}; 1778 $el.mode = function(){}; 1779 $el.play = function(){}; 1780 $el.pause = function(){}; 1781 $el.refresh = function(){}; 1782 $el.getCurrentSlideCount = function(){}; 1783 $el.getTotalSlideCount = function(){}; 1784 $el.goToSlide = function(){}; 1785 $el.onBeforeSlide = function(){}; 1786 $el.onAfterSlide = function(){}; 1787 $el.RSlider = null; 1788 refresh = { 1789 init : function(){} 1790 }; 1791 $el.parent().parent().find('.rwd-Action, .rwd-Pager').remove(); 1792 $el.removeClass('huge_it_slider iSFade iSSlide isGrab isGrabbing leftEnd right').removeAttr('style').unwrap().unwrap(); 1793 $el.children().removeAttr('style'); 1794 $children.removeClass('rwd-slide active'); 1795 $el.find('.clone').remove(); 1796 $children = null; 1797 interval = null; 1798 on = false; 1799 scene = 0; 1800 } 1801 1802 }; 1803 1804 $(window).on('resize orientationchange', function (e) { 1805 setTimeout(function () { 1806 if (e.preventDefault) { 1807 e.preventDefault(); 1808 } else { 1809 e.returnValue = false; 1810 } 1811 1812 if(!$('.rwd-SlideWrapper').hasClass('rwd-fullscreen-on')){ 1813 refresh.init(); 1814 } 1815 1816 if(settings.view === 'carousel1') { 1817 var $h = (settings.maxHeight / settings.maxWidth) * jQuery('.rwd-SlideOuter').width(); 1818 jQuery('.rwd-SlideOuter').height($h); 1819 if (settings.dotsPos === 'top') { 1820 jQuery('.rwd-Pager.rwd-pg').css({ 1821 top: (jQuery('.rwd-SlideWrapper').height() - jQuery('.rwd-SlideOuter').height()) / 2 + 10 + 'px' 1822 }); 1823 } else { 1824 jQuery('.rwd-Pager.rwd-pg').css({ 1825 bottom: (jQuery('.rwd-SlideWrapper').height() - jQuery('.rwd-SlideOuter').height()) / 2 - jQuery('.rwd-SlideWrapper').height() + 15 + 'px' 1826 }); 1827 } 1828 } 1829 }, 200); 1830 }); 1831 1832 return this; 1833 }; 1834 1835})(jQuery); 1836 1837 1838 1839 1840 1841////////////////////////////////////////// 1842 1843 1844 1845 1846 1847(function ($, window, document) { 1848 1849 'use strict'; 1850 1851 var defaults = { 1852 maxWidth: 900, 1853 maxHeight: 700, 1854 transition: 'random', 1855 customTransitions: [], 1856 fallback3d: 'fade', 1857 perspective: 1000, 1858 navigation: +hugeitSliderObj.show_arrows, 1859 thumbMargin: .5, 1860 autoPlay: true, 1861 controls: 'dot', 1862 cropImage: 'stretch', 1863 delay: 5000, 1864 transitionDuration: 2000, 1865 pauseOnHover: true, 1866 startSlide: 0, 1867 keyNav: false 1868 }; 1869 1870 function Slider(elem, settings) { 1871 this.$slider = $(elem).addClass('huge-it-slider'); 1872 this.settings = $.extend({}, defaults, settings); 1873 this.$slides = this.$slider.find('> li'); 1874 this.totalSlides = this.$slides.length; 1875 this.cssTransitions = testBrowser.cssTransitions(); 1876 this.cssTransforms3d = testBrowser.cssTransforms3d(); 1877 this.currentPlace = this.settings.startSlide; 1878 this.$currentSlide = this.$slides.eq(this.currentPlace); 1879 this.inProgress = false; 1880 this.$sliderWrap = this.$slider.wrap('<div class="huge-it-wrap" />').parent(); 1881 this.$sliderBG = this.$slider.wrap('<div class="huge-it-slide-bg" />').parent(); 1882 this.settings.slider = this; 1883 1884 this.init(); 1885 } 1886 1887 Slider.prototype.cycling = null; 1888 1889 Slider.prototype.$slideImages = null; 1890 1891 Slider.prototype.init = function () { 1892 1893 var _this = this; 1894 1895 this.captions(); 1896 1897 (this.settings.transition === 'custom') && (this.nextAnimIndex = -1); 1898 1899 +this.settings.navigation && this.setArrows(); 1900 1901 1902 this.settings.keyNav && this.setKeys(); 1903 1904 for (var i = 0; i < this.totalSlides; i++) { 1905 this.$slides.eq(i).addClass('huge-it-slide-' + i); 1906 } 1907 1908 this.settings.autoPlay && this.setAutoPlay(); 1909 1910 if (+this.settings.pauseOnHover) { 1911 this.$slider.hover(function () { 1912 1913 _this.$slider.addClass('slidePause'); 1914 _this.setPause(); 1915 1916 }, function () { 1917 1918 _this.$slider.removeClass('slidePause'); 1919 1920 if(!jQuery('.huge-it-wrap').hasClass('isPlayed')){ 1921 _this.setAutoPlay(); 1922 } 1923 1924 }); 1925 } 1926 1927 jQuery('.playSlider').on('click', function () { 1928 _this.setAutoPlay(); 1929 jQuery('.huge-it-wrap').removeClass('isPlayed'); 1930 }); 1931 jQuery('.pauseSlider').on('click', function () { 1932 _this.setPause(); 1933 jQuery('.huge-it-wrap').addClass('isPlayed'); 1934 }); 1935 1936 this.$slideImages = this.$slides.find('img:eq(0)').addClass('huge-it-slide-image'); 1937 1938 this.setup(); 1939
1940 var $id = $(this)[0].$currentSlide.context.id; 1941 1942 jQuery(window).resize(function(){ 1943 _this.cropImage(); 1944 1945 if(_this.settings.controls === 'thumbnail'){ 1946 jQuery('.huge-it-wrap').height(jQuery('#' + $id).height() + +hugeitSliderObj.thumb_height); 1947 } else { 1948 jQuery('.huge-it-wrap').height(jQuery('#' + $id).height()); 1949 } 1950 1951 }); 1952 1953 if(_this.settings.controls === 'thumbnail'){ 1954 jQuery('.huge-it-wrap').height(jQuery('#' + $id).height() + +hugeitSliderObj.thumb_height); 1955 } else { 1956 jQuery('.huge-it-wrap').height(jQuery('#' + $id).height()); 1957 } 1958 }; 1959 1960 Slider.prototype.setup = function () { 1961 var sliderWidth, sliderHeight; 1962 sliderWidth = +this.settings.maxWidth; 1963 sliderHeight = (this.settings.controls === 'thumbnail') ? 1964 +this.settings.maxHeight + +hugeitSliderObj.thumb_height + 3 * +hugeitSliderObj.slideshow_border_size + 2 * this.settings.thumbMargin 1965 : +this.settings.maxHeight; 1966 this.$sliderWrap.css({ 1967 maxWidth: sliderWidth + 'px', 1968 maxHeight: sliderHeight + 'px' 1969 }); 1970 1971 switch (this.settings.controls) { 1972 case 'dot': 1973 this.setDots(); 1974 break; 1975 case 'thumbnail': 1976 this.setThumbs(); 1977 break; 1978 case 'none': 1979 break; 1980 } 1981 1982 jQuery('.slider-description div').each(function(){ 1983 if(jQuery(this).text().length > 300){ 1984 var text = jQuery(this).text(); 1985 jQuery(this).attr('title', text); 1986 text = jQuery(this).text().substring(0, 300) + '...'; 1987 jQuery(this).text(text); 1988 } 1989 }); 1990 1991 this.cropImage(); 1992 1993 this.$currentSlide.css({'opacity': 1, 'z-index': 2}); 1994 }; 1995 1996 Slider.prototype.cropImage = function(){ 1997 1998 var w = this.settings.maxWidth, 1999 h = this.settings.maxHeight, 2000 wT, hT, r, d, mTop, mLeft; 2001 2002 if(jQuery(window).width() < +this.settings.maxWidth || jQuery(window).height() < +this.settings.maxHeight){ 2003 w = jQuery(window).width(); 2004 h = +this.settings.maxHeight / +this.settings.maxWidth * w; 2005 } 2006 2007 if(jQuery('.huge-it-slide-bg').width() < +this.settings.maxWidth || jQuery('.huge-it-slide-bg').height() < +this.settings.maxHeight){ 2008 w = jQuery('.huge-it-slide-bg').width(); 2009 } 2010 2011 switch (hugeitSliderObj.crop_image) { 2012 case 'stretch': 2013 this.$slideImages.css({ 2014 'width': '100%', 2015 'height': h + 'px', 2016 'visibility': 'visible', 2017 'max-height': 'none' 2018 }); 2019 break; 2020 case 'fill': 2021 this.$slideImages.each(function () { 2022 wT = $(this)[0].naturalWidth; 2023 hT = $(this)[0].naturalHeight; 2024 if ((wT / hT) < (w / h)) { 2025 r = w / wT; 2026 d = (Math.abs(h - (hT * r))) * 0.5; 2027 mTop = '-' + d + 'px'; 2028 $(this).css({ 2029 'height': hT * r, 2030 'margin-left': 0, 2031 'margin-right': 0, 2032 'margin-top': mTop, 2033 'visibility': 'visible', 2034 'width': w, 2035 'max-width': 'none', 2036 'max-height': 'none' 2037 }); 2038 } else { 2039 r = h / hT; 2040 d = (Math.abs(w - (wT * r))) * 0.5; 2041 mLeft = '-' + d + 'px'; 2042 $(this).css({ 2043 'height': h, 2044 'margin-left': mLeft, 2045 'margin-right': mLeft, 2046 'margin-top': 0, 2047 'visibility': 'visible', 2048 'width': wT * r, 2049 'max-width': 'none', 2050 'max-height': 'none' 2051 }); 2052 } 2053 }); 2054 break; 2055 } 2056 }; 2057 2058 Slider.prototype.setArrows = function () { 2059 var _this = this; 2060 2061 this.$sliderWrap.append('<a href="#" class="huge-it-arrows huge-it-prev"></a><a href="#" class="huge-it-arrows huge-it-next"></a>'); 2062 2063 if(hugeitSliderObj.navigation_type === '17' || hugeitSliderObj.navigation_type === '18' || hugeitSliderObj.navigation_type === '19' || hugeitSliderObj.navigation_type === '20' || hugeitSliderObj.navigation_type === '21'){ 2064 var $_next = '<svg class="next_bg" width="22px" height="22px" fill="#999" viewBox="-333 335.5 31.5 31.5" >' + 2065 '<path d="M-311.8,340.5c-0.4-0.4-1.1-0.4-1.6,0c-0.4,0.4-0.4,1.1,0,1.6l8,8h-26.6c-0.6,0-1.1,0.5-1.1,1.1s0.5,1.1,1.1,1.1h26.6l-8,8c-0.4,0.4-0.4,1.2,0,1.6c0.4,0.4,1.2,0.4,1.6,0l10-10c0.4-0.4,0.4-1.1,0-1.6L-311.8,340.5z"/>' + 2066 '</svg>'; 2067 var $_prev = '<svg class="prev_bg" width="22px" height="22px" fill="#999" viewBox="-333 335.5 31.5 31.5" >' + 2068 '<path d="M-322.7,340.5c0.4-0.4,1.1-0.4,1.6,0c0.4,0.4,0.4,1.1,0,1.6l-8,8h26.6c0.6,0,1.1,0.5,1.1,1.1c0,0.6-0.5,1.1-1.1,1.1h-26.6l8,8c0.4,0.4,0.4,1.2,0,1.6c-0.4,0.4-1.1,0.4-1.6,0l-10-10c-0.4-0.4-0.4-1.1,0-1.6L-322.7,340.5z"/>' + 2069 '</svg>'; 2070 jQuery('.huge-it-prev').append($_prev); 2071 jQuery('.huge-it-next').append($_next); 2072 2073 if(hugeitSliderObj.navigation_type === '21'){ 2074 jQuery('.huge-it-prev').append('<p class="prev_title"></p>'); 2075 jQuery('.huge-it-next').append('<p class="next_title"></p>'); 2076 } 2077 2078 var $nextIndex, $prevIndex, $nextImg, $prevImg, $nextTitle = '', $prevTitle = ''; 2079 2080 2081 if(hugeitSliderObj.navigation_type !== '17'){ 2082 jQuery('.huge-it-next').hover(function(){ 2083 if(_this.currentPlace + 1 == _this.totalSlides){ 2084 $nextIndex = 0; 2085 } else { 2086 $nextIndex = _this.currentPlace + 1; 2087 } 2088 2089 $nextImg = jQuery('li.group').eq($nextIndex).find('img').attr('src'); 2090 $nextTitle = jQuery('li.group').eq($nextIndex).find('img').attr('alt'); 2091 2092 jQuery(this).find('.next_title').text($nextTitle); 2093 jQuery(this).css({ 2094 backgroundImage: 'url(' + $nextImg + ')', 2095 backgroundPosition: 'left center', 2096 backgroundSize: '100px 90px', 2097 backgroundRepeat: 'no-repeat' 2098 2099 }); 2100 }, function(){ 2101 jQuery(this).find('.next_title').text(''); 2102 jQuery(this).css({ 2103 backgroundImage: '' 2104 }); 2105 }); 2106 jQuery('.huge-it-prev').hover(function(){ 2107 if(_this.currentPlace - 1 < 0){ 2108 $prevIndex = _this.totalSlides - 1; 2109 } else { 2110 $prevIndex = _this.currentPlace - 1; 2111 } 2112 2113 $prevImg = jQuery('li.group').eq($prevIndex).find('img').attr('src'); 2114 $prevTitle = jQuery('li.group').eq($prevIndex).find('img').attr('alt'); 2115 2116 jQuery(this).find('.prev_title').text($prevTitle); 2117 jQuery(this).css({ 2118 backgroundImage: 'url(' + $prevImg + ')', 2119 backgroundPosition: 'right center', 2120 backgroundSize: '100px 90px', 2121 backgroundRepeat: 'no-repeat' 2122 }); 2123 }, function(){ 2124 jQuery(this).find('.prev_title').text(''); 2125 jQuery(this).css({ 2126 backgroundImage: '' 2127 }); 2128 }); 2129 } else { 2130 jQuery('.huge-it-next').hover(function(){ 2131 if(_this.currentPlace + 1 == _this.totalSlides){ 2132 $nextIndex = 0; 2133 } else { 2134 $nextIndex = _this.currentPlace + 1; 2135 } 2136 $nextImg = jQuery('li.group').eq($nextIndex).find('img').attr('src'); 2137 jQuery(this).css({ 2138 backgroundImage: 'url(' + $nextImg + ')', 2139 backgroundPosition: 'center center' 2140 2141 }); 2142 }, function(){ 2143 jQuery(this).css({ 2144 backgroundImage: '' 2145 }); 2146 }); 2147 jQuery('.huge-it-prev').hover(function(){ 2148 if(_this.currentPlace - 1 < 0){ 2149 $prevIndex = _this.totalSlides - 1; 2150 } else { 2151 $prevIndex = _this.currentPlace - 1; 2152 } 2153 2154 $prevImg = jQuery('li.group').eq($prevIndex).find('img').attr('src'); 2155 jQuery(this).css({ 2156 backgroundImage: 'url(' + $prevImg + ')', 2157 backgroundPosition: 'center center' 2158 }); 2159 }, function(){ 2160 jQuery(this).css({ 2161 backgroundImage: '' 2162 }); 2163 }); 2164 } 2165 } 2166 2167 $('.huge-it-next', this.$sliderWrap).on('click', function (e) { 2168 e.preventDefault(); 2169 _this.next(); 2170 }); 2171 2172 $('.huge-it-prev', this.$sliderWrap).on('click', function (e) { 2173 e.preventDefault(); 2174 _this.prev(); 2175 }); 2176 2177 if(this.settings.controls === 'thumbnail'){ 2178 this.$sliderWrap.append('<a href="#" class="thumb_arr thumb_prev"></a><a href="#" class="thumb_arr thumb_next"></a>'); 2179 } 2180 2181 $('.thumb_next').on('click', function (e) { 2182 e.preventDefault(); 2183 var width = (Math.min(jQuery('.huge-it-slide-bg').width(), +_this.settings.maxWidth) - (2 * +hugeitSliderObj.thumb_count_slides * _this.settings.thumbMargin)) / +hugeitSliderObj.thumb_count_slides + 1, 2184 position = parseFloat($('.huge-it-thumb-wrap').css('marginLeft')) || 0; 2185 2186 position = +position.toFixed(4) - +width.toFixed(4); 2187 2188 if (position >= (_this.totalSlides - hugeitSliderObj.thumb_count_slides) * (-width)) { 2189 $('.huge-it-thumb-wrap').css({ 2190 'marginLeft': position + 'px' 2191 }); 2192 } 2193 2194 if (_this.currentPlace == 0) { 2195 $('.huge-it-thumb-wrap').css({ 2196 'marginLeft': '0' 2197 }); 2198 } 2199 }); 2200 2201 $('.thumb_prev').on('click', function (e) { 2202 e.preventDefault(); 2203 var width = (Math.min(jQuery('.huge-it-slide-bg').width(), +_this.settings.maxWidth) - (2 * +hugeitSliderObj.thumb_count_slides * _this.settings.thumbMargin)) / +hugeitSliderObj.thumb_count_slides + 1, 2204 position = parseFloat($('.huge-it-thumb-wrap').css('marginLeft')) || 0; 2205 2206 position = +position.toFixed(4) + +width.toFixed(4); 2207 2208 if (position <= 0) { 2209 $('.huge-it-thumb-wrap').css({ 2210 'marginLeft': position + 'px' 2211 }); 2212 } 2213 2214 if (this.currentPlace == _this.totalSlides - 1) { 2215 position = (_this.totalSlides - hugeitSliderObj.thumb_count_slides) * (-width); 2216 $('.huge-it-thumb-wrap').css({ 2217 'marginLeft': position + 'px' 2218 }); 2219 } 2220 }); 2221 }; 2222 2223 Slider.prototype.next = function () { 2224 if (this.settings.transition === 'custom') { 2225 this.nextAnimIndex++; 2226 } 2227 2228 if (this.currentPlace === this.totalSlides - 1) { 2229 this.transition(0, true); 2230 } else { 2231 this.transition(this.currentPlace + 1, true); 2232 } 2233 2234 if(jQuery('li.group').eq(this.currentPlace).hasClass('video_iframe') && jQuery('.huge-it-slider').attr('data-autoplay') == 1){ 2235 jQuery('li.group').eq(this.currentPlace).find('.playButton').click(); 2236 } 2237 2238 var width = (Math.min(jQuery('.huge-it-slide-bg').width(), +this.settings.maxWidth) - (2 * +hugeitSliderObj.thumb_count_slides * this.settings.thumbMargin)) / +hugeitSliderObj.thumb_count_slides + 1; 2239 2240 $('.huge-it-thumb-wrap').css({ 2241 'marginLeft': -this.currentPlace * width + 'px' 2242 }); 2243 2244 if(this.totalSlides - +hugeitSliderObj.thumb_count_slides <= this.currentPlace){ 2245 $('.huge-it-thumb-wrap').css({ 2246 'marginLeft': -(this.totalSlides - +hugeitSliderObj.thumb_count_slides) * width + 'px' 2247 }); 2248 } 2249 2250 if (this.currentPlace == 0) { 2251 $('.huge-it-thumb-wrap').css({ 2252 'marginLeft': '0' 2253 }); 2254 } 2255 }; 2256 2257 Slider.prototype.prev = function () { 2258 if (this.settings.transition === 'custom') { 2259 this.nextAnimIndex--; 2260 } 2261 2262 if (this.currentPlace == 0) { 2263 this.transition(this.totalSlides - 1, false); 2264 } else { 2265 this.transition(this.currentPlace - 1, false); 2266 } 2267 2268 if(jQuery('li.group').eq(this.currentPlace).hasClass('video_iframe') && jQuery('.huge-it-slider').attr('data-autoplay') == 1){ 2269 jQuery('li.group').eq(this.currentPlace).find('.playButton').click(); 2270 } 2271 2272 var width = (Math.min(jQuery('.huge-it-slide-bg').width(), +this.settings.maxWidth) - (2 * +hugeitSliderObj.thumb_count_slides * this.settings.thumbMargin)) / +hugeitSliderObj.thumb_count_slides + 1; 2273 2274 $('.huge-it-thumb-wrap').css({ 2275 'marginLeft': -this.currentPlace * width + 'px' 2276 }); 2277 2278 if(this.totalSlides - +hugeitSliderObj.thumb_count_slides <= this.currentPlace){ 2279 $('.huge-it-thumb-wrap').css({ 2280 'marginLeft': -(this.totalSlides - +hugeitSliderObj.thumb_count_slides) * width + 'px' 2281 }); 2282 } 2283 }; 2284 2285 Slider.prototype.setKeys = function () { 2286 var _this = this; 2287 2288 $(document).on('keydown', function (e) { 2289 if (e.keyCode === 39) { 2290 _this.next(); 2291 } else if (e.keyCode === 37) { 2292 _this.prev(); 2293 } 2294 }); 2295 }; 2296 2297 Slider.prototype.setAutoPlay = function () { 2298 var _this = this; 2299 2300 if(!this.$slider.hasClass('slidePause')){ 2301 this.cycling = setTimeout(function () { 2302 _this.next(); 2303 }, this.settings.delay); 2304 } 2305 }; 2306 2307 Slider.prototype.setPause = function () { 2308 clearTimeout(this.cycling); 2309 }; 2310 2311 Slider.prototype.setDots = function () { 2312 var _this = this; 2313 2314 this.$dotWrap = $('<div class="huge-it-dot-wrap" />').appendTo(this.$sliderWrap); 2315 2316 for (var i = 0; i < this.totalSlides; i++) { 2317 var $thumb = $('<a />') 2318 .attr('href', '#') 2319 .data('huge-it-num', i); 2320 2321 $thumb.appendTo(this.$dotWrap); 2322 } 2323 2324 this.$dotWrapLinks = this.$dotWrap.find('a'); 2325 2326 this.$dotWrapLinks.eq(this.settings.startSlide).addClass('active'); 2327 2328 this.$dotWrap.on('click', 'a', function (e) { 2329 e.preventDefault(); 2330 2331 _this.transition(parseInt($(this).data('huge-it-num'))); 2332 }); 2333 }; 2334 2335 Slider.prototype.setThumbs = function () { 2336 var _this = this, 2337 width = (Math.min(jQuery('.huge-it-slide-bg').width(), +this.settings.maxWidth) - (2 * +hugeitSliderObj.thumb_count_slides * this.settings.thumbMargin)) / +hugeitSliderObj.thumb_count_slides; 2338 2339 this.$thumbWrap = $('
2339<div class="huge-it-thumb-wrap" />').appendTo(this.$sliderWrap); 2340 2341 this.$slider.parents('.huge-it-wrap').find('.huge-it-thumb-wrap').css({ 2342 width: this.totalSlides * (width + 2) + 'px', 2343 position: 'absolute' 2344 }); 2345 2346 var k = +this.settings.maxHeight / +this.settings.maxWidth * jQuery(window).width() + +hugeitSliderObj.thumb_height + 1; 2347 2348 $('.huge-it-wrap').height(k); 2349 2350 for (var i = 0; i < this.totalSlides; i++) { 2351 var $thumb = $('<a />') 2352 .css({ 2353 width: width + 'px', 2354 margin: this.settings.thumbMargin + 'px' 2355 }) 2356 .attr('href', '#') 2357 .data('huge-it-num', i); 2358 2359 this.$slideImages.eq(i).clone() 2360 .removeAttr('style') 2361 .appendTo(this.$thumbWrap) 2362 .wrap($thumb); 2363 } 2364 2365 this.$thumbWrapLinks = this.$thumbWrap.find('a'); 2366 2367 this.$thumbWrap.children().last().css('margin-right', -10); 2368 2369 this.$thumbWrapLinks.eq(this.settings.startSlide).addClass('active'); 2370 2371 this.$thumbWrap.on('click', 'a', function (e) { 2372 e.preventDefault(); 2373 2374 _this.transition(parseInt($(this).data('huge-it-num'))); 2375 }); 2376 }; 2377 2378 Slider.prototype.captions = function () { 2379 var _this = this, 2380 $captions = this.$slides.find('.huge-it-caption'); 2381 2382 $captions.css({ 2383 opacity: 0 2384 }); 2385 2386 this.$currentSlide.find('.huge-it-caption').css('opacity', 1); 2387 2388 $captions.each(function () { 2389 $(this).css({ 2390 transition: 'opacity ' + _this.settings.transitionDuration + 'ms linear', 2391 backfaceVisibility: 'hidden' 2392 }); 2393 }); 2394 }; 2395 2396 Slider.prototype.transition = function (slideNum, forward) { 2397 if (!this.inProgress) { 2398 if (slideNum !== this.currentPlace) { 2399 if (typeof forward === 'undefined') { 2400 forward = (slideNum > this.currentPlace); 2401 } 2402 2403 switch (this.settings.controls) { 2404 case 'dot': 2405 this.$dotWrapLinks.eq(this.currentPlace).removeClass('active'); 2406 this.$dotWrapLinks.eq(slideNum).addClass('active'); 2407 break; 2408 case 'thumbnail': 2409 this.$thumbWrapLinks.eq(this.currentPlace).removeClass('active'); 2410 this.$thumbWrapLinks.eq(slideNum).addClass('active'); 2411 break; 2412 case 'none': 2413 break; 2414 } 2415 2416 this.$nextSlide = this.$slides.eq(slideNum); 2417 2418 this.currentPlace = slideNum; 2419 2420 if (jQuery('li.group').eq(this.currentPlace - 1).hasClass('video_iframe') || jQuery('li.group').eq(this.currentPlace).hasClass('video_iframe')) { 2421 var streffect = this.settings.transition; 2422 if (streffect == "cube_v" || streffect == "cube_h" || streffect == "none" || streffect == "fade") { 2423 new Transition(this, this.settings.transition, forward); 2424 } else { 2425 new Transition(this, 'fade', forward); 2426 } 2427 } else { 2428 new Transition(this, this.settings.transition, forward); 2429 } 2430 2431 } 2432 } 2433 }; 2434 2435 function Transition(Slider, transition, forward) { 2436 this.Slider = Slider; 2437 this.Slider.inProgress = true; 2438 this.forward = forward; 2439 this.transition = transition; 2440 2441 if (this.transition === 'custom') { 2442 this.customAnims = this.Slider.settings.customTransitions; 2443 } 2444 2445 if (this.transition === 'custom') { 2446 var _this = this; 2447 $.each(this.customAnims, function (i, obj) { 2448 if ($.inArray(obj, _this.anims) === -1) { 2449 _this.customAnims.splice(i, 1); 2450 } 2451 }); 2452 } 2453 2454 this.fallback3d = this.Slider.settings.fallback3d; 2455 2456 this.init(); 2457 } 2458 2459 Transition.prototype.fallback = 'fade'; 2460 2461 Transition.prototype.anims = ['cube_h', 'cube_v', 'fade', 'slice_h', 'slice_v', 'slide_h', 'slide_v', 'scale_out', 'scale_in', 'block_scale', 'kaleidoscope', 'fan', 'blind_h', 'blind_v']; 2462 2463 Transition.prototype.customAnims = []; 2464 2465 Transition.prototype.init = function () { 2466 this[this.transition](); 2467 }; 2468 2469 Transition.prototype.before = function (callback) { 2470 var _this = this; 2471 2472 this.Slider.$currentSlide.css('z-index', 2); 2473 this.Slider.$nextSlide.css({'opacity': 1, 'z-index': 1}); 2474 2475 if (this.Slider.cssTransitions) { 2476 this.Slider.$currentSlide.find('.huge-it-caption').css('opacity', 0); 2477 this.Slider.$nextSlide.find('.huge-it-caption').css('opacity', 1); 2478 } else { 2479 this.Slider.$currentSlide.find('.huge-it-caption').animate({'opacity': 0}, _this.Slider.settings.transitionDuration); 2480 this.Slider.$nextSlide.find('.huge-it-caption').animate({'opacity': 1}, _this.Slider.settings.transitionDuration); 2481 } 2482 2483 if (typeof this.setup === 'function') { 2484 var transition = this.setup(); 2485 2486 setTimeout(function () { 2487 callback(transition); 2488 }, 20); 2489 } else { 2490 this.execute(); 2491 } 2492 2493 if (this.Slider.cssTransitions) { 2494 $(this.listenTo).one('webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend', $.proxy(this.after, this)); 2495 } 2496 }; 2497 2498 Transition.prototype.after = function () { 2499 this.Slider.$sliderBG.removeAttr('style'); 2500 this.Slider.$slider.removeAttr('style'); 2501 this.Slider.$currentSlide.removeAttr('style'); 2502 this.Slider.$nextSlide.removeAttr('style'); 2503 2504 this.Slider.$currentSlide.css({ 2505 zIndex: 1, 2506 opacity: 0 2507 }); 2508 this.Slider.$nextSlide.css({ 2509 zIndex: 2, 2510 opacity: 1 2511 }); 2512 2513 if (typeof this.reset === 'function') { 2514 this.reset(); 2515 } 2516 2517 if (this.Slider.settings.autoPlay && !jQuery('.huge-it-wrap').hasClass('isPlayed')) { 2518 clearTimeout(this.Slider.cycling); 2519 this.Slider.setAutoPlay(); 2520 } 2521 2522 this.Slider.$currentSlide = this.Slider.$nextSlide; 2523 2524 this.Slider.inProgress = false; 2525 2526 }; 2527 2528 Transition.prototype.fade = function () { 2529 var _this = this; 2530 2531 if (this.Slider.cssTransitions) { 2532 this.setup = function () { 2533 _this.listenTo = _this.Slider.$currentSlide; 2534 2535 _this.Slider.$currentSlide.css('transition', 'opacity ' + _this.Slider.settings.transitionDuration + 'ms linear'); 2536 }; 2537 2538 this.execute = function () { 2539 _this.Slider.$currentSlide.css('opacity', 0); 2540 } 2541 } else { 2542 this.execute = function () { 2543 _this.Slider.$currentSlide.animate({'opacity': 0}, _this.Slider.settings.transitionDuration, function () { 2544 _this.after(); 2545 }); 2546 } 2547 } 2548 2549 this.before($.proxy(this.execute, this)); 2550 }; 2551 2552 Transition.prototype.cube = function (tz, ntx, nty, nrx, nry, wrx, wry) { 2553 if (!this.Slider.cssTransitions || !this.Slider.cssTransforms3d) { 2554 return this[this['fallback3d']](); 2555 } 2556 2557 var _this = this; 2558 2559 this.setup = function () { 2560 _this.listenTo = _this.Slider.$slider; 2561 2562 this.Slider.$sliderBG.css('perspective', 1000); 2563 2564 _this.Slider.$currentSlide.css({ 2565 transform: 'translateZ(' + tz + 'px)', 2566 backfaceVisibility: 'hidden' 2567 }); 2568 2569 _this.Slider.$nextSlide.css({ 2570 opacity: 1, 2571 backfaceVisibility: 'hidden', 2572 transform: 'translateY(' + nty + 'px) translateX(' + ntx + 'px) rotateY(' + nry + 'deg) rotateX(' + nrx + 'deg)' 2573 }); 2574 2575 _this.Slider.$slider.css({ 2576 transform: 'translateZ(-' + tz + 'px)', 2577 transformStyle: 'preserve-3d' 2578 }); 2579 }; 2580 2581 this.execute = function () { 2582 _this.Slider.$slider.css({ 2583 transition: 'all ' + _this.Slider.settings.transitionDuration + 'ms ease-in-out', 2584 transform: 'translateZ(-' + tz + 'px) rotateX(' + wrx + 'deg) rotateY(' + wry + 'deg)' 2585 }); 2586 }; 2587 2588 this.before($.proxy(this.execute, this)); 2589 }; 2590 2591 Transition.prototype.none = function () { 2592 2593 this.Slider.settings.transitionDuration = 1; 2594 2595 if (this.forward) { 2596 this.cube(1, 1, 0, 0, 0, 0, 0); 2597 } else { 2598 this.cube(1, -1, 0, 0, 0, 0, 0); 2599 } 2600 }; 2601 2602 Transition.prototype.cube_h = function () { 2603 var dimension = $(this.Slider.$slides).width() / 2; 2604 2605 if (this.forward) { 2606 this.cube(dimension, dimension, 0, 0, 90, 0, -90); 2607 } else { 2608 this.cube(dimension, -dimension, 0, 0, -90, 0, 90); 2609 } 2610 }; 2611 2612 Transition.prototype.cube_v = function () { 2613 var dimension = $(this.Slider.$slides).height() / 2; 2614 2615 if (this.forward) { 2616 this.cube(dimension, 0, -dimension, 90, 0, -90, 0); 2617 } else {
2618 this.cube(dimension, 0, dimension, -90, 0, 90, 0); 2619 } 2620 }; 2621 2622 Transition.prototype.grid = function (cols, rows, ro, tx, ty, sc, op) { 2623 if (!this.Slider.cssTransitions) { 2624 return this[this['fallback']](); 2625 } 2626 2627 var _this = this; 2628 2629 this.setup = function () { 2630 var count = (_this.Slider.settings.transitionDuration) / (cols + rows); 2631 2632 function gridlet(width, height, t, l, top, left, src, imgWidth, imgHeight, c, r) { 2633 var delay = (c + r) * count; 2634 2635 return $('<div class="huge-it-gridlet" />').css({ 2636 width: width, 2637 height: height, 2638 top: t, 2639 left: l, 2640 backgroundImage: 'url(' + src + ')', 2641 backgroundPosition: '-' + left + 'px -' + top + 'px', 2642 backgroundSize: imgWidth + 'px ' + imgHeight + 'px', 2643 transition: 'all ' + _this.Slider.settings.transitionDuration + 'ms ease-in-out ' + delay + 'ms', 2644 transform: 'none' 2645 }); 2646 } 2647 2648 _this.$img = _this.Slider.$currentSlide.find('img.huge-it-slide-image'); 2649 2650 _this.$grid = $('<div />').addClass('huge-it-grid'); 2651 2652 _this.Slider.$currentSlide.prepend(_this.$grid); 2653 2654 var imgWidth = _this.$img.width(), 2655 imgHeight = _this.$img.height(), 2656 imgSrc = _this.$img.attr('src'),
2657 colWidth = Math.floor(imgWidth / cols), 2658 rowHeight = Math.floor(imgHeight / rows), 2659 colRemainder = imgWidth - (cols * colWidth), 2660 colAdd = Math.ceil(colRemainder / cols), 2661 rowRemainder = imgHeight - (rows * rowHeight), 2662 rowAdd = Math.ceil(rowRemainder / rows), 2663 leftDist = 0, 2664 l = (_this.$grid.width() - _this.$img.width()) / 2; 2665 2666 tx = tx === 'auto' ? imgWidth : tx; 2667 tx = tx === 'min-auto' ? -imgWidth : tx; 2668 ty = ty === 'auto' ? imgHeight : ty; 2669 ty = ty === 'min-auto' ? -imgHeight : ty; 2670 2671 for (var i = 0; i < cols; i++) { 2672 var t = (_this.$grid.height() - _this.$img.height()) / 2, 2673 topDist = 0, 2674 newColWidth = colWidth; 2675 2676 if (colRemainder > 0) { 2677 var add = colRemainder >= colAdd ? colAdd : colRemainder; 2678 newColWidth += add; 2679 colRemainder -= add; 2680 } 2681 2682 for (var j = 0; j < rows; j++) { 2683 var newRowHeight = rowHeight, 2684 newRowRemainder = rowRemainder; 2685 2686 if (newRowRemainder > 0) { 2687 add = newRowRemainder >= rowAdd ? rowAdd : rowRemainder; 2688 newRowHeight += add; 2689 newRowRemainder -= add; 2690 } 2691 2692 _this.$grid.append(gridlet(newColWidth, newRowHeight, t, l, topDist, leftDist, imgSrc, imgWidth, imgHeight, i, j)); 2693 2694 topDist += newRowHeight; 2695 t += newRowHeight; 2696 } 2697 2698 leftDist += newColWidth; 2699 l += newColWidth; 2700 } 2701 2702 _this.listenTo = _this.$grid.children().last(); 2703 2704 _this.$grid.show(); 2705 _this.$img.css('opacity', 0); 2706 2707 _this.$grid.children().first().addClass('huge-it-top-left'); 2708 _this.$grid.children().last().addClass('huge-it-bottom-right'); 2709 _this.$grid.children().eq(rows - 1).addClass('huge-it-bottom-left'); 2710 _this.$grid.children().eq(-rows).addClass('huge-it-top-right'); 2711 }; 2712 2713 this.execute = function () { 2714 _this.$grid.children().css({ 2715 opacity: op, 2716 transform: 'rotate(' + ro + 'deg) translateX(' + tx + 'px) translateY(' + ty + 'px) scale(' + sc + ')' 2717 }); 2718 }; 2719 2720 this.before($.proxy(this.execute, this)); 2721 2722 this.reset = function () { 2723 _this.$img.css('opacity', 1); 2724 _this.$grid.remove(); 2725 } 2726 }; 2727 2728 Transition.prototype.slice_h = function () { 2729 this.grid(1, 8, 0, 'min-auto', 0, 1, 0); 2730 }; 2731 2732 Transition.prototype.slice_v = function () { 2733 this.grid(10, 1, 0, 0, 'auto', 1, 0); 2734 }; 2735 2736 Transition.prototype.slide_v = function () { 2737 var dir = this.forward ? 2738 'min-auto' : 2739 'auto'; 2740 2741 this.grid(1, 1, 0, 0, dir, 1, 1); 2742 }; 2743 2744 Transition.prototype.slide_h = function () { 2745 var dir = this.forward ? 2746 'min-auto' : 2747 'auto'; 2748 2749 this.grid(1, 1, 0, dir, 0, 1, 1); 2750 }; 2751 2752 Transition.prototype.scale_out = function () { 2753 this.grid(1, 1, 0, 0, 0, 1.5, 0); 2754 }; 2755 2756 Transition.prototype.scale_in = function () { 2757 this.grid(1, 1, 0, 0, 0, .5, 0); 2758 }; 2759 2760 Transition.prototype.block_scale = function () { 2761 this.grid(8, 6, 0, 0, 0, .6, 0); 2762 }; 2763 2764 Transition.prototype.kaleidoscope = function () { 2765 this.grid(10, 8, 0, 0, 0, 1, 0); 2766 }; 2767 2768 Transition.prototype.fan = function () { 2769 this.grid(1, 10, 45, 100, 0, 1, 0); 2770 }; 2771 2772 Transition.prototype.blind_v = function () { 2773 this.grid(1, 8, 0, 0, 0, .7, 0); 2774 }; 2775 2776 Transition.prototype.blind_h = function () { 2777 this.grid(10, 1, 0, 0, 0, .7, 0); 2778 }; 2779 2780 Transition.prototype.random = function () { 2781 this[this.anims[Math.floor(Math.random() * this.anims.length)]]();
2782 }; 2783 2784 Transition.prototype.custom = function () { 2785 if (this.Slider.nextAnimIndex < 0) { 2786 this.Slider.nextAnimIndex = this.customAnims.length - 1; 2787 } 2788 if (this.Slider.nextAnimIndex === this.customAnims.length) { 2789 this.Slider.nextAnimIndex = 0; 2790 } 2791 2792 this[this.customAnims[this.Slider.nextAnimIndex]](); 2793 }; 2794 2795 var testBrowser = { 2796 browserVendors: ['', '-webkit-', '-moz-', '-ms-', '-o-', '-khtml-'], 2797 2798 domPrefixes: ['', 'Webkit', 'Moz', 'ms', 'O', 'Khtml'], 2799 2800 testDom: function (prop) { 2801 var i = this.domPrefixes.length; 2802 2803 while (i--) { 2804 if (typeof document.body.style[this.domPrefixes[i] + prop] !== 'undefined') { 2805 return true; 2806 } 2807 } 2808 2809 return false; 2810 }, 2811 2812 cssTransitions: function () { 2813 if (typeof window.Modernizr !== 'undefined' && Modernizr.csstransitions !== 'undefined') { 2814 return Modernizr.csstransitions; 2815 } 2816 2817 return this.testDom('Transition'); 2818 }, 2819 2820 cssTransforms3d: function () { 2821 if (typeof window.Modernizr !== 'undefined' && Modernizr.csstransforms3d !== 'undefined') { 2822 return Modernizr.csstransforms3d; 2823 } 2824 2825 if (typeof document.body.style['perspectiveProperty'] !== 'undefined') { 2826 return true; 2827 } 2828 2829 return this.testDom('Perspective'); 2830 } 2831 }; 2832 2833 $.fn['sliderPlugin'] = function (settings) { 2834 return this.each(function () { 2835 if (!$.data(this, 'sliderPlugin')) { 2836 $.data(this, 'sliderPlugin', new Slider(this, settings)); 2837 } 2838 }); 2839 } 2840 2841})(window.jQuery, window, window.document); 2842 2843jQuery(window).load(function () { 2844 jQuery('div[class*=slider-loader-]').css({ 2845 display: 'none' 2846 }); 2847 jQuery('.huge-it-wrap, .rwd-SlideOuter, .huge-it-slider').css({ 2848 opacity: '1' 2849 }); 2850});
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.