1var isZoom = false; 2var oldScroll = 0; 3var newScroll = 0; 4var scalValue = 0.005; 5var scal = 1; 6var navOffset = 0; 7 8var winHeight = 0; 9var nav = 0; 10 11//window.scrollTo(0, 0); 12function setScaleValue(zoom) { 13 if (oldScroll < newScroll) { 14 scal = (scal + scalValue); 15 if (!zoom) { 16 scal = (scal - scalValue); 17 } 18 19 } else { 20 scal = (scal - scalValue); 21 } 22 if (scal < 1) { 23 scal = 1; 24 } 25 26 let scaler = { 27 'transform': 'scale(' + scal + ',' + scal + ') translate3d(0, ' + scal + '%, 0)' 28 } 29 //jQuery('.upimgbottom img').css(scaler); 30 31} 32 33jQuery(document).ready(function () { 34 35 36 if (jQuery('body').hasClass('page-template-home')) { 37 if (navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/BlackBerry/i) || navigator.userAgent.match(/Windows Phone/i)) { 38 var html_contnt = ''; 39 html_contnt += '<div class="poserimg bgset_img" style="background:url(\'' + Hbannerimage + '\')"></div>'; 40 html_btn_contnt = '<a href="https://vimeo.com/301209700" id="playvideo" data-fancybox class="btnvideo fancybox-mob"><img src="' + Htemplateuri + '/img/play_icon.svg" alt="Play"></a>'; 41 42 jQuery('#section1 .pop-effect .pop-effect-inner').prepend(html_contnt); 43 jQuery('#section1 .pop-effect .pop-effect-inner .spot_content').append(html_btn_contnt); 44 } else { 45 var html_contnt = ''; 46 if (Hvideoimage != "") { 47 html_contnt += '<div class="mian-bg" style="background-image:url(' + Hvideoimage + ');"></div>'; 48 } 49 html_contnt += '<span class="withoverlay overlay_lightblue"></span>'; 50 51 html_contnt += '<div class="video-foreground">'; 52 html_contnt += '<video loop controls="false" data-autoplay autoplay muted>'; 53 html_contnt += '<source src="' + Hvideosection + '" type="video/mp4" type="video/mp4">'; 54 html_contnt += '</video>'; 55 html_contnt += '</div>'; 56 // html_contnt+='<style type="text/css">.fullscreen-video{display: none;}.fullscreen-video.active{display: block;}</style>'; 57 // html_contnt+='<div class="fullscreen-video">'; 58 // html_contnt+='<video loop controls="false" data-autoplay autoplay id="myVideo" muted>'; 59 // html_contnt+='<source src="'+Htemplateuri+'/img/Kilchoman-fullscreen.mp4" type="video/mp4" type="video/mp4">'; 60 // html_contnt+='</video>'; 61 // html_contnt+='</div>'; 62 63 // html_btn_contnt = '<a href="javascript:void(0);" class="btnplay" onclick="goFullscreen(\'myVideo\'); return false;"><img src="'+Htemplateuri+'/img/play_icon.svg" alt="Play"></a>'; 64 65 html_btn_contnt = '<a href="https://vimeo.com/301209700" id="playvideo" data-fancybox class="btnvideo fancybox-mob"><img src="' + Htemplateuri + '/img/play_icon.svg" alt="Play"></a>'; 66 67 68 jQuery('#section1 .pop-effect .pop-effect-inner').prepend(html_contnt); 69 jQuery('#section1 .pop-effect .pop-effect-inner .spot_content').append(html_btn_contnt); 70 } 71 } 72 73 74 //jQuery('.fancybox-mob').fancybox(); 75 76 /*jQuery('.fancybox').fancybox({ 77 hideScrollbar: false 78 });*/ 79 80 jQuery(".fancybox-mob").fancybox({ 81 type: 'iframe', 82 beforeShow: function () { 83 // After the show-slide-animation has ended - play the vide in the current slide 84 jQuery('.fancybox-iframe').attr('allow', "autoplay"); 85 } 86 }); 87 88 jQuery(".fancybox-mob").on('click', function () { 89 jQuery('.fancybox-iframe').attr('allow', "autoplay"); 90 }); 91 92 93 if (jQuery('.steps.clearfix ul li.first').hasClass('current')) { 94 jQuery('div.total-div').hide(); 95 } 96 jQuery('.actions ul[aria-label="Pagination"] li:eq(1)').on('click', function () { 97 98 if (jQuery('.steps.clearfix ul li.first').hasClass('current')) { 99 jQuery('div.total-div').hide(); 100 } else { 101 jQuery('div.total-div').show(); 102 } 103 }); 104 105 jQuery('.actions ul[aria-label="Pagination"] li:eq(0)').on('click', function () { 106 jQuery('div.total-div').hide(); 107 }); 108 109 110 jQuery('.steps.clearfix ul[role="tablist"] li a').on('click', function () { 111 112 if (jQuery('.steps.clearfix ul li.first').hasClass('current')) { 113 jQuery('div.total-div').hide(); 114 } else { 115 jQuery('div.total-div').show(); 116 } 117 }); 118 119 120 jQuery('#myVideo').bind('webkitfullscreenchange mozfullscreenchange fullscreenchange', function (e) { 121 jQuery('.fullscreen-video').toggleClass('active'); 122 }); 123 if (jQuery('body').hasClass('page-template-our_whisky')) { 124 jQuery('body').addClass('woocommerce'); 125 } 126 if (jQuery('body').hasClass('page-template-shop')) { 127 jQuery('body').addClass('woocommerce'); 128 } 129 jQuery('.page-template-our_whisky .groupitem .open-popup-link').click(function () { 130 jQuery('body').addClass('mfp-pop-open'); 131 }); 132 jQuery('.page-template-our_whisky .mfp-close').click(function () { 133 jQuery('body').removeClass('mfp-pop-open'); 134 }); 135 136 if (jQuery(window).width() > 767) { 137 /* 138 jQuery("body.page-template-team").niceScroll({ 139 scrollspeed: 200, 140 cursorwidth: "0", 141 cursorborder: "none", 142 }); 143 144 //jQuery(".page-template-team .scrollwrap").niceScroll().hide(); 145 jQuery("body.page-template-team .scrollwrap").niceScroll({ 146 scrollspeed: 200, 147 cursorwidth: "7", 148 cursorborder: "none", 149 }); 150 jQuery('#loadMore').click(function(){ 151 setTimeout(function(){ 152 jQuery("body.page-template-team").niceScroll().resize(); 153 },1000); 154 }); 155 */ 156 } 157 //jQuery.scrollSpeed(200, 800); 158 /*jQuery(function () { 159 jQuery('.scrollwrap, .selectric-scroll, .datepicker').hover(function () { 160 jQuery('html').toggleClass('open-scrollwrap'); 161 }); 162 }); 163 164 165 jQuery(function(){ 166 167 var $window = jQuery('html'); //Window object 168 169 var scrollTime = 0.8; //Scroll time 170 var scrollDistance = 150; //Distance. Use smaller value for shorter scroll and greater value for longer scroll 171 172 $window.on("mousewheel DOMMouseScroll", function(event){ 173 174 //event.preventDefault(); 175 if(!jQuery('html').hasClass('open-scrollwrap')){ 176 var delta = event.originalEvent.wheelDelta/120 || -event.originalEvent.detail/3; 177 var scrollTop = $window.scrollTop(); 178 var finalScroll = scrollTop - parseInt(delta*scrollDistance); 179 180 TweenMax.to($window, scrollTime, { 181 scrollTo : { y: finalScroll, autoKill:true }, 182 ease: Power1.easeOut, //For more easing functions see https://api.greensock.com/js/com/greensock/easing/package-detail.html 183 autoKill: true, 184 overwrite: 5 185 }); 186 187 } else{ 188 event.stopPropagation(); 189 190 } 191 192}); 193 }); */ 194 jQuery('.container-sm-inner p img').parent().addClass('post-thumb'); 195 196 /*jQuery('.even').paroller({ 197 factor: 0.3, 198 type: 'foreground', 199 direction: 'vertical' 200 }); 201 jQuery('.odd').paroller({ 202 factor: 0.8, 203 type: 'foreground', 204 direction: 'vertical' 205 });*/ 206 207 /* var figure = jQueryBridget(".img-prop"); 208 [].forEach.call(figure, function(item, index) { 209 item.addEventListener('mouseover', hoverVideo.bind(item, index), false); 210 item.addEventListener('mouseout', hideVideo.bind(item, index), false); 211 }); 212 function hoverVideo(index, e) { 213 vid[index].play(); 214 } 215 function hideVideo(index, e) { 216 vid[index].pause(); 217 }*/ 218 219 220 // Tabs 221 222 223 if (navigator.userAgent.match(/Trident.*rv:11\./)) { 224 jQuery('html').addClass('ieall'); 225 } 226 227 if (navigator.appVersion.indexOf("MSIE") != -1) { 228 jQuery('html').addClass("ieall"); 229 } 230 231 jQuery(document).ready(function () { 232 jQuery("#benifitModal .sub-tab-links a").click(function (event) { 233 event.preventDefault(); 234 jQuery(this).parent().addClass("active"); 235 jQuery(this).parent().siblings().removeClass("active"); 236 var tab = jQuery(this).attr("href"); 237 jQuery("#benifitModal .sub-tabs-content .sub-tabs").not(tab).css("display", "none"); 238 jQuery(tab).fadeIn(); 239 equalheight('.eqheight'); 240 }); 241 }); 242 243 244 // jQuery('.wrap_intab').each(function(){ 245 // var figure = jQuery(".img-wraphold").hover( hoverVideo, hideVideo ); 246 247 // function hoverVideo(e) { 248 // if(jQuery(this).find('video').length > 0){ 249 // jQuery('video', this).get(0).play(); 250 // } 251 // } 252 253 // function hideVideo(e) { 254 // if(jQuery(this).find('video').length > 0){ 255 // jQuery('video', this).get(0).pause(); 256 // } 257 // //jQuery('.img-wraphold').children('.img-prop').fadeIn(); 258 // } 259 260 261 // jQuery(".img-wraphold").hover( 262 // function () { 263 // jQuery(this).children('.img-prop').css({'opacity':'0', 'visibility':'hidden'}); 264 // }, 265 // function () { 266 // jQuery(this).children('.img-prop').css({'opacity':'1', 'visibility':'visible'}); 267 // } 268 // ); 269 // }); 270 271 jQuery('#myVideo').bind('webkitfullscreenchange mozfullscreenchange fullscreenchange', function (e) { 272 273 var state = document.fullScreen || document.mozFullScreen || document.webkitIsFullScreen; 274 var event = state ? 'FullscreenOn' : 'FullscreenOff'; 275 if (state) { 276 document.getElementById('myVideo').muted = false;
277 jQuery('body').removeClass('notevidebutton'); 278 } else { 279 document.getElementById('myVideo').muted = true; 280 jQuery('body').addClass('notevidebutton'); 281 } 282 283 // Now do something interesting 284 //alert('Event: ' + event); 285 286 }); 287 288 jQuery('.btnvideo').click(function () { 289 jQuery(this).parent().siblings('.mian-bg').addClass('bg-hide'); 290 }); 291 292 293 jQuery('.element_holder .elem_img a').click(function () { 294 var hightHeader = jQuery('header').outerHeight() + 30; 295 jQuery('html, body').animate({ 296 scrollTop: jQuery(jQuery(this).attr('href')).offset().top - hightHeader 297 }, 1000); 298 return false; 299 }); 300 301 winHeight = jQuery(window).height(); 302 nav = jQuery('.plain-block'); 303 304 if (nav.length > 0) { 305 navOffset = nav.offset().top - (winHeight / 2); 306 } 307 isZoom = false; 308 scal = 1; 309 /*jQuery(window).scroll(function () { 310 311 if (jQuery(this).scrollTop() >= navOffset) { 312 jQuery('.upimgmain').removeClass('active'); 313 if (!jQuery('.upimgmain').hasClass('active')) { 314 var scroll = jQuery(window).scrollTop(), 315 316 scale = (scroll / 10) + 1, 317 translate = (scroll / 75); 318 319 let scaler = { 320 'transform':'scale(1.'+scale+',1.'+scale+')' 321 //'-webkit-transform':'scale('+scale+','+scale+') translate3d(0, '+translate+'%, 0)' 322 } 323 324 325 326 jQuery('.upimgbottom img').css(scaler); 327 328 } 329 else{ 330 return false; 331 } 332 } 333 334 else { 335 jQuery('.upimgmain').addClass('active'); 336 } 337 });*/ 338 heightGlobal(); 339 eqHeight(); 340 341 jQuery('.club-post-content .primarytype').click(function () { 342 jQuery('html').addClass('htmlmodal'); 343 }); 344 jQuery('.modal .popup-close').click(function () { 345 jQuery('html').removeClass('htmlmodal'); 346 jQuery('.togglemenu').find('.menutxt').text("Menu") 347 }); 348 349 onScrollActive(''); 350 setTimeout(function () { 351 jQuery('.footer_bg .mejs-overlay-button').click(function () { 352 var t = jQuery(this).parents('.widget_media_video').attr('id'); 353 jQuery('#' + t + ' .mejs-fullscreen-button button').trigger('click'); 354 }); 355 }, 100); 356 357 jQuery(".mobile-tab .sub-tab-links li a").click(function (event) { 358 event.preventDefault(); 359 jQuery(this).parent().addClass("active"); 360 jQuery(this).parent().siblings().removeClass("active"); 361 var tab = jQuery(this).attr("href"); 362 jQuery(".mobile-tab .sub-tabs-content .sub-tabs").not(tab).css("display", "none"); 363 jQuery(tab).fadeIn(); 364 }); 365 366}); 367 368jQuery(document).on('click touchstart', '.fancybox-button--close', function () { 369 jQuery('html').removeClass('fp-enabled'); 370}); 371jQuery(document).on('ready', function () { 372 jQuery('body').addClass('site-ready'); 373 jQuery('body').addClass('site-loaded'); 374}); 375 376jQuery(window).load(function () { 377 378 379 jQuery(".fancybox-mob").on('click', function () { 380 jQuery('.fancybox-iframe').attr('allow', "autoplay"); 381 }); 382 383 if (jQuery("#playvideo").length > 0) { 384 var myVideo = document.getElementById('myVideo'); 385 if (jQuery('#playvideo').hasClass('fancybox-mob')) { 386 } else { 387 var play = document.getElementById("playvideo"); 388 play.addEventListener("click", function () { 389 myVideo.pause(); 390 myVideo.currentTime = '0'; 391 myVideo.play(); 392 }); 393 } 394 } 395 396 jQuery('.footer_bg iframe').each(function () { 397 jQuery(this).attr('allow', 'autoplay; fullscreen'); 398 }); 399 400}); 401jQuery(window).resize(function () { 402 403}); 404 405function goFullscreen(id) { 406 var element = document.getElementById('myVideo'); 407 if (element.mozRequestFullScreen) { 408 element.mozRequestFullScreen(); 409 element.muted = false; 410 } else if (element.webkitRequestFullScreen) { 411 element.webkitRequestFullScreen(); 412 element.muted = false; 413 } else { 414 element.muted = true; 415 } 416 element.pause(); 417 element.currentTime = '0'; 418 element.play(); 419 420} 421 422 423jQuery(window).load(function () { 424 // jQuery(window).scrollTop(0); 425 heightGlobal(); 426 eqHeight(); 427 428 if (jQuery('.woocommerce-checkout #billing_myfield9_field').length > 0) { 429 jQuery('#billing_myfield9_field #billing_myfield9').val('1980'); 430 jQuery('#billing_myfield9_field .selectric span.selectric-label').html('1980'); 431 } 432 433}); 434 435jQuery(window).scroll(function () { 436 437 438 /********************************Design related **************************************************/ 439 var scroll = jQuery(window).scrollTop(); 440 /* Slider Parralax effect */ 441 var sliderScroll = (scroll / 3); 442 sliderScroll = (sliderScroll > 0) ? +sliderScroll : sliderScroll; 443 //jQuery('.paroller-block-even').css('transform', 'translateY(-'+sliderScroll+'px)'); 444 //jQuery('.paroller-block-even').css( 'margin-top', -sliderScroll+'px' );; 445 446 447 var sliderScroll = (scroll / 8); 448 sliderScroll = (sliderScroll > 0) ? +sliderScroll : sliderScroll; 449 jQuery('.paroller-block-even').css('margin-top', -sliderScroll + 'px'); 450 //jQuery('.paroller-block-odd').css('transform', 'translateY(-'+sliderScroll+'px)'); 451 452 453 var sliderScroll = (scroll * 0.3); 454 sliderScroll = (sliderScroll > 0) ? +sliderScroll : sliderScroll;
455 //jQuery('.team-block-content').css( 'top', -sliderScroll+'px' ); 456 457 var sliderScroll = (scroll / 8); 458 sliderScroll = (sliderScroll > 0) ? +sliderScroll : sliderScroll; 459 jQuery('.listparlax_wrap ul li.even').css('margin-top', sliderScroll + 'px'); 460 461 var sliderScroll = (scroll / 8); 462 sliderScroll = (sliderScroll > 0) ? +sliderScroll : sliderScroll; 463 jQuery('.page-template-shop .footer_bg').css('margin-top', sliderScroll + 'px'); 464 465 if (jQuery('.container-sm').length > 0) { 466 var detailbanner = jQuery('.single-distillery .detail-post-container').height(); 467 var detailhead = jQuery('header').outerHeight(); 468 var containerTop = jQuery('.container-sm-inner').offset().top - detailhead - detailbanner + 7; 469 scrollDownArrow = (containerTop - jQuery(this).scrollTop()) / containerTop; 470 if (scrollDownArrow < 0) scrollDownArrow = 0; 471 jQuery('.detail-post-container').css({ 472 opacity: scrollDownArrow 473 }); 474 } 475 476 477 if (jQuery(".page-template-default .status-publish .woocommerce").length > 0 && jQuery(window).scrollTop() > jQuery(".page-template-default .status-publish .woocommerce").offset().top - jQuery("header").outerHeight()) { 478 jQuery(".woocommerce-MyAccount-navigation").css('position', 'fixed'); 479 jQuery(".woocommerce-MyAccount-navigation").css('top', jQuery(".header").outerHeight()); 480 jQuery(".woocommerce-MyAccount-navigation").css('bottom', 'auto'); 481 } else { 482 jQuery(".woocommerce-MyAccount-navigation").css('position', 'static'); 483 } 484 485 486 if ((jQuery(".woocommerce-MyAccount-content").length > 0 && jQuery(".woocommerce-MyAccount-content").offset().top + jQuery(".woocommerce-MyAccount-content").outerHeight() - jQuery("header").outerHeight() - 60 - jQuery('.header-order').height()) - jQuery(window).scrollTop() < jQuery(".woocommerce-MyAccount-navigation").outerHeight()) { 487 jQuery(".page-template-default .status-publish .woocommerce").css('position', 'relative'); 488 jQuery(".woocommerce-MyAccount-navigation").css('position', 'absolute'); 489 jQuery(".woocommerce-MyAccount-navigation").css('top', 'auto'); 490 jQuery(".woocommerce-MyAccount-navigation").css('bottom', 0); 491 } 492 493 /********************************Design related end**************************************************/ 494 495 496}) 497jQuery(window).resize(function () { 498 heightGlobal(); 499}); 500 501function heightGlobal() { 502 equalheight('.eqheight'); 503 jQuery('.workshop-img').height((jQuery(window).height() * 75 / 100) - jQuery('header').outerHeight()); 504} 505 506 507/*===== Equal Height row =======*/ 508 509equalheight = function (container) { 510 if (jQuery(window).width() > 767) { 511 var currentTallest = 0, 512 currentRowStart = 0, 513 rowDivs = new Array(), 514 jQueryel, 515 topPosition = 0; 516 jQuery(container).each(function () { 517 jQueryel = jQuery(this); 518 jQuery(jQueryel).innerHeight('auto') 519 topPostion = jQueryel.offset().top; 520 if (currentRowStart != topPostion) { 521 for (currentDiv = 0; currentDiv < rowDivs.length; currentDiv++) { 522 rowDivs[currentDiv].innerHeight(currentTallest); 523 } 524 rowDivs.length = 0; // empty the array 525 currentRowStart = topPostion; 526 currentTallest = jQueryel.innerHeight(); 527 rowDivs.push(jQueryel); 528 } else { 529 rowDivs.push(jQueryel); 530 currentTallest = (currentTallest < jQueryel.innerHeight()) ? (jQueryel.innerHeight()) : (currentTallest); 531 } 532 for (currentDiv = 0; currentDiv < rowDivs.length; currentDiv++) { 533 rowDivs[currentDiv].innerHeight(currentTallest); 534 } 535 }); 536 } else { 537 jQuery(container).height('auto'); 538 } 539} 540 541/*jQuery(window).scroll(function() { 542 var scrollTop = jQuery(window).scrollTop(); 543 jQuery('.grid-list-item').css('top', (0 - (scrollTop * .12)) + 'px'); 544 jQuery('.grid-list-item:even').css('top', (0 - (scrollTop * .16)) + 'px'); 545});*/ 546 547jQuery(window).scroll(function () { 548 549 oldScroll = newScroll; 550 newScroll = jQuery(window).scrollTop(); 551 if (jQuery(window).scrollTop() >= navOffset) { 552 jQuery('.upimgmain').removeClass('active'); 553 newScroll = jQuery(window).scrollTop(); 554 555 setScaleValue(true); 556 557 558 //jQuery('.upimgbottom img').css(scaler); 559 560 } else { 561 setScaleValue(false); 562 563 jQuery('.upimgmain').addClass('active'); 564 } 565 566}); 567 568 569jQuery(window).resize(function () { 570 571 winHeight = jQuery(window).height(); 572 nav = jQuery('.upimgbottom'); 573 574 if (nav.length > 0) { 575 navOffset = nav.offset().top - winHeight - 200; 576 } 577 578 isZoom = false;
579 eqHeight(); 580 581}); 582 583function eqHeight() { 584 // equalheightnoRow('.page-template-tours_events .img_list-wrap .book_ticket'); 585 equalheightnoRow('.product .grid-item-inner'); 586} 587 588equalheightnoRow = function (container) { 589 if (jQuery(window).width() > 767) { 590 var currentTallest = 0, 591 currentRowStart = 0, 592 rowDivs = new Array(), 593 jQueryel 594 595 jQuery(container).each(function () { 596 jQueryel = jQuery(this); 597 jQuery(jQueryel).innerHeight('auto') 598 rowDivs.push(jQueryel); 599 currentTallest = (currentTallest < jQueryel.innerHeight()) ? (jQueryel.innerHeight()) : (currentTallest); 600 601 for (currentDiv = 0; currentDiv < rowDivs.length; currentDiv++) { 602 rowDivs[currentDiv].innerHeight(currentTallest); 603 } 604 }); 605 } else { 606 jQuery(container).height('auto'); 607 } 608} 609 610 611jQuery(document).on('click', '.woocommerce-MyAccount-navigation a', function (event) { 612 event.preventDefault(); 613 if (jQuery(window).width() > 992) { 614 var headerHeight = jQuery('header').outerHeight() + 60 + jQuery('.header-order').outerHeight(); 615 } else { 616 var headerHeight = jQuery('header').outerHeight() + 18; 617 } 618 var url = jQuery(this).attr('href'); 619 var hash = url.substring(url.indexOf('#') + 1); 620 hash = hash.replace('/', ''); 621 jQuery('html,body').animate({scrollTop: jQuery("#" + hash).offset().top - headerHeight}, 1000); 622}); 623 624function onScrollActive(event) { 625 var scrollPos = jQuery(document).scrollTop() + 77 + jQuery('.header-order').outerHeight(); 626 627 jQuery('.woocommerce-MyAccount-navigation a').each(function () { 628 var currLink = jQuery(this); 629 var url = jQuery(this).attr('href'); 630 var hash = url.substring(url.indexOf('#') + 1); 631 hash = hash.replace('/', ''); 632 refElement = jQuery('#' + hash); 633 if (refElement.length > 0) { 634 if (refElement.position().top <= scrollPos && refElement.position().top + refElement.height() > scrollPos) { 635 jQuery('.woocommerce-MyAccount-navigation a').removeClass("active"); 636 currLink.addClass("active"); 637 } else { 638 currLink.removeClass("active"); 639 } 640 } 641 }); 642} 643 644 645(function ($) { 646 647 jQuery.scrollSpeed = function (step, speed, easing) { 648 649 var $document = $(document), 650 $window = $(window), 651 $body = $('html, body'), 652 option = easing || 'default', 653 root = 0, 654 scroll = false, 655 scrollY, 656 scrollX, 657 view; 658 659 if (window.navigator.msPointerEnabled) 660 661 return false; 662 663 $window.on('mousewheel DOMMouseScroll', function (e) { 664 665 var deltaY = e.originalEvent.wheelDeltaY, 666 detail = e.originalEvent.detail; 667 scrollY = $document.height() > $window.height(); 668 scrollX = $document.width() > $window.width(); 669 scroll = true; 670 671 if (scrollY) { 672 673 view = $window.height(); 674 675 if (deltaY < 0 || detail > 0) 676 677 root = (root + view) >= $document.height() ? root : root += step; 678 679 if (deltaY > 0 || detail < 0) 680 681 root = root <= 0 ? 0 : root -= step; 682 683 $body.stop().animate({ 684 685 scrollTop: root 686 687 }, speed, option, function () { 688 689 scroll = false; 690 691 }); 692 } 693 694 if (scrollX) { 695 696 view = $window.width(); 697 698 if (deltaY < 0 || detail > 0) 699 700 root = (root + view) >= $document.width() ? root : root += step; 701 702 if (deltaY > 0 || detail < 0) 703 704 root = root <= 0 ? 0 : root -= step; 705 706 $body.stop().animate({ 707 708 scrollLeft: root 709 710 }, speed, option, function () { 711 712 scroll = false; 713 714 }); 715 } 716 717 return false; 718 719 }).on('scroll', function () { 720 721 if (scrollY && !scroll) root = $window.scrollTop(); 722 if (scrollX && !scroll) root = $window.scrollLeft(); 723 724 }).on('resize', function () { 725 726 if (scrollY && !scroll) view = $window.height(); 727 if (scrollX && !scroll) view = $window.width(); 728 729 }); 730 }; 731 732 jQuery.easing.default = function (x, t, b, c, d) { 733 734 return -c * ((t = t / d - 1) * t * t * t - 1) + b; 735 }; 736 737})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.