1jQuery(function(){ 2 initSvgSprite(); 3 initMagnificPopup(); 4 initSlickSlider(); 5 initFixedHeader(); 6 initAccordion(); 7 // initAnimatedCounts(); 8 initOpenClose(); 9 initTabs(); 10 // initIsotope(); 11 // initSmoothScroll(); 12 initStickyFixed(); 13 initSmoothScroll(); 14 initMenuOpener(); 15 initDateRangePicker(); 16 // initStickyRoll(); 17 initPreventEmptyAnchor(); 18 19 20 21 $('.input-group select').on('click',function(){ 22 me = $(this) ; 23 $("label[for='"+me.attr('id')+"']").addClass("animate-label"); 24 $("label[for='"+me.attr('id')+"']").parent('.input-group').addClass("selBox"); 25 $("label[for='"+me.attr('id')+"']").siblings('label.form-error').fadeOut(); 26 }) ; 27 28 $('.whyusBlock .blockCenter').on('click',function(){ 29 $('.whyusBlock .blockCenter').show(); 30 $(this).hide(); 31 $(this).siblings('.listingPoint').toggleClass('mobileDisplay'); 32 33 }); 34 35 $('.weabout span.mobileLink, .weabout span.desktopLink').on('click',function(){ 36 $(this).siblings('.reviser--clip').toggleClass('showFull'); 37 $(this).hide(); 38 }) 39 40}); 41 42 43function initSvgSprite() { 44 jQuery("body").prepend(window.SVG_SPRITES.sprite); 45} 46 47function initPreventEmptyAnchor() { 48 // $(".svg-convert").svgConvert(); 49 jQuery('a[href="#"]').click(function(e) { 50 e.preventDefault(); 51 }); 52} 53 54var isMobile = false; //initiate as false 55// device detection 56if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent) 57 || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.
57substr(0,4))) { 58 isMobile = true; 59} 60 61const initAnimatedCounts = () => { 62 const ease = (n) => { 63 // https://github.com/component/ease/blob/master/index.js 64 return --n * n * n + 1; 65 }; 66 const observer = new IntersectionObserver((entries) => { 67 entries.forEach((entry) => { 68 if (entry.isIntersecting) { 69 // Once this element is in view and starts animating, remove the observer, 70 // because it should only animate once per page load. 71 observer.unobserve(entry.target); 72 const countToString = entry.target.getAttribute('data-countTo'); 73 const countTo = parseFloat(countToString); 74 const duration = parseFloat(entry.target.getAttribute('data-animateDuration')); 75 const countToParts = countToString.split('.'); 76 const precision = countToParts.length === 2 ? countToParts[1].length : 0; 77 const startTime = performance.now(); 78 const step = (currentTime) => { 79 const progress = Math.min(ease((currentTime - startTime) / duration), 1); 80 entry.target.textContent = (progress * countTo).toFixed(precision); 81 if (progress < 1) { 82 animationFrame = window.requestAnimationFrame(step); 83 } else { 84 window.cancelAnimationFrame(animationFrame); 85 } 86 }; 87 let animationFrame = window.requestAnimationFrame(step); 88 } 89 }); 90 }); 91 document.querySelectorAll('[data-animateDuration]').forEach((target) => { 92 target.setAttribute('data-countTo', target.textContent); 93 target.textContent = '0'; 94 observer.observe(target); 95 }); 96}; 97 98function initAccordion() { 99 // jQuery(this).text(jQuery(this).text() == 'Expand all' ? 'Close all' : 'Expand all'); 100 jQuery('.trip__itinerary .jsxIti').click(function(){ 101 if (jQuery(this).hasClass('collapse')) { 102 jQuery(this).text('Close All').removeClass('collapse'); 103 jQuery('.trip__itinerary .trip__itinerary-title').addClass('active'); 104 jQuery('.trip__itinerary .trip__itinerary-slide').slideDown(); 105 } else { 106 jQuery(this).text('Expand All').addClass('collapse'); 107 jQuery('.trip__itinerary .trip__itinerary-title').removeClass('active'); 108 jQuery('.trip__itinerary .trip__itinerary-slide').slideUp(); 109 } 110 }); 111 112 jQuery('.trip__itinerary .trip__itinerary-title').click(function(){ 113 if (jQuery(this).hasClass('active')) { 114 jQuery(this).removeClass('active'); 115 jQuery(this).siblings('.trip__itinerary-slide').slideUp(); 116 } else { 117 jQuery('.trip__itinerary .trip__itinerary-slide').slideUp(); 118 jQuery('.trip__itinerary .trip__itinerary-title').removeClass('active'); 119 jQuery(this).addClass('active'); 120 jQuery(this).siblings('.trip__itinerary-slide').slideDown(); 121 } 122 }); 123} 124 125function initMenuOpener() { 126 jQuery('.jsxNavTgr').click(function() { 127 jQuery('body').toggleClass('navActive'); 128 }); 129 130 jQuery('.jsxSearchTgr').click(function() { 131 jQuery('body').toggleClass('searchActive'); 132 }); 133 134 jQuery('.jsxDrop').click(function() { 135 // jQuery(this).parents('li').toggleClass('dropActive'); 136 jQuery(this).parent().parent().toggleClass('dropActive'); 137 138 }); 139 140 jQuery('.team__member').click(function() { 141 jQuery(this).addClass('hover'); 142 jQuery(this).siblings().removeClass('hover'); 143 }); 144 145 jQuery('.jsxTeamClose').click(function() { 146 jQuery('.team__member').removeClass('hover'); 147 }); 148 149 if(!isMobile) { 150 jQuery('.meganav , .dropnav').mouseleave(function(){ 151 jQuery(this).parents().removeClass('dropActive'); 152 }); 153 } 154 155 156 jQuery('.jsxNavBack').click(function() { 157 jQuery('body').removeClass('meganavActive'); 158 }); 159 // jQuery(document).click(function(event) { 160 // if (!jQuery(event.target).closest(".megamenu > .dropdown, .dropdown .dropdown-menu").length) { 161 // jQuery(".megamenu > .dropdown").removeClass('drop-active'); 162 // } 163 // }); 164} 165 166function initOpenClose() { 167 jQuery('.jsxFqEa').click(function(){ 168 jQuery('.trip__faq-item').addClass('faqitem-active'); 169 jQuery('.trip__faq--detail').slideDown(); 170 }); 171 jQuery('.jsxFqCa').click(function(){ 172 jQuery('.trip__faq-item').removeClass('faqitem-active'); 173 jQuery('.trip__faq--detail').slideUp(); 174 }); 175 176 jQuery('.trip__faq--title').click(function() { 177 jQuery(this).siblings('.trip__faq--detail').slideToggle(); 178 jQuery(this).parents('.trip__faq-item').toggleClass('faqitem-active'); 179 180 }); 181 182 jQuery(".jsxVidPlay").click(function(){ 183 jQuery(this).parents('.mediatape').addClass('onplay'); 184 var videoURL = jQuery('#player01').prop('src'); 185 videoURL += "&autoplay=1"; 186 $('#player01').prop('src',videoURL); 187 }); 188 189 190} 191 192function initFixedHeader() { 193 // var stickyOffset = jQuery('.site__header').height(); 194 var stickyOffset = 5; 195 var sticky = jQuery('#wrapper'); 196 var top_fixed; 197 top_fixed = jQuery('.site__header').offset().top; 198 if (top_fixed >= stickyOffset) sticky.addClass('is_stuck'); 199 jQuery(window).scroll(function(){ 200 scroll = jQuery(window).scrollTop(); 201 if (scroll >= stickyOffset){ 202 sticky.addClass('is_stuck'); 203 } else { 204 sticky.removeClass('is_stuck'); 205 } 206 }); 207 // header menu stick when reload page 208 if (performance.getEntriesByType("navigation")[0].type === "reload") { 209 const scrollY = window.scrollY; 210 if (scrollY >= stickyOffset) sticky.addClass('is_stuck'); 211 } 212 213} 214 215function initIsotope() { 216 // external js: isotope.pkgd.js 217 218 219 // init Isotope 220 var $grid = $('.project__grid').isotope({ 221 itemSelector: '.project__element', 222 layoutMode: 'fitRows', 223 }); 224 225 // // filter functions
226 // var filterFns = { 227 // // show if number is greater than 50 228 // numberGreaterThan50: function() { 229 // var number = $(this).find('.number').text(); 230 // return parseInt( number, 10 ) > 50; 231 // }, 232 // // show if name ends with -ium 233 // ium: function() { 234 // var name = $(this).find('.name').text(); 235 // return name.match( /ium$/ ); 236 // } 237 // }; 238 239 // bind filter button click 240 $('.button-group').on( 'click', 'button', function() { 241 var filterValue = $( this ).attr('data-filter'); 242 // use filterFn if matches value 243 // filterValue = filterFns[ filterValue ] || filterValue; 244 $grid.isotope({ filter: filterValue }); 245 }); 246 247 248 // change is-checked class on buttons 249 $('.button-group').each( function( i, buttonGroup ) { 250 var $buttonGroup = $( buttonGroup ); 251 $buttonGroup.on( 'click', 'button', function() { 252 $buttonGroup.find('.is-checked').removeClass('is-checked'); 253 $( this ).addClass('is-checked'); 254 }); 255 }); 256} 257 258function initDateRangePicker() { 259 if(jQuery('.jsxDateCheckins').length) { 260 jQuery('.jsxDateCheckins').daterangepicker({ 261 locale: { 262 format: 'YYYY/MM/DD' 263 } 264 }); 265 // reseting the placeholder value for first load 266 jQuery('.jsxDateCheckins').val(''); 267 jQuery('.jsxDateCheckins').attr("placeholder","Check In â Check Out"); 268 } 269 270//-------------------------------------------------------------------------------- 271 272 if(jQuery('.jsxDateFlight').length) { 273 jQuery('.jsxDateFlight').daterangepicker({ 274 locale: { 275 format: 'YYYY/MM/DD' 276 } 277 }); 278 // reseting the placeholder value for first load 279 jQuery('.jsxDateFlight').val(''); 280 jQuery('.jsxDateFlight').attr("placeholder","Departure Date â Return Date"); 281 } 282 283//-------------------------------------------------------------------------------- 284 285 if(jQuery('.jsxDatevolunteer').length) { 286 jQuery('.jsxDatevolunteer').daterangepicker({ 287 locale: { 288 format: 'YYYY/MM/DD' 289 } 290 }); 291 // reseting the placeholder value for first load 292 jQuery('.jsxDatevolunteer').val(''); 293 jQuery('.jsxDatevolunteer').attr("placeholder","Start Date â End Date"); 294 } 295 296//-------------------------------------------------------------------------------- 297 298 if(jQuery('.jsxDateTravel').length) { 299 jQuery('.jsxDateTravel').daterangepicker({ 300 singleDatePicker: true, 301 showDropdowns: true, 302 locale: { 303 format: 'YYYY/MM/DD' 304 } 305 }); 306 // reseting the placeholder value for first load 307 jQuery('.jsxDateTravel').val(''); 308 jQuery('.jsxDateTravel').attr("placeholder","Select Travel Date"); 309 } 310} 311 312function initSlickSlider() { 313 /*const marker = document.querySelector('.site__nav .jsxMarker'); 314 const navlist = document.querySelectorAll('.site__nav > ul > li'); 315 const dnavitem = document.querySelector('.site__nav > ul > li:first-child') 316 const dfpos = dnavitem.getBoundingClientRect(); 317 marker.style.left = dfpos.x + 'px'; 318 marker.style.top = dfpos.y + 'px'; 319 marker.style.width = dfpos.width + 'px'; 320 marker.style.height = dfpos.height + 'px'; 321 navlist.forEach(list_item=> { 322 list_item.addEventListener('mouseover', () => { 323 marker.classList.add('active'); 324 let position = list_item.getBoundingClientRect(); 325 marker.style.left = position.x + 'px'; 326 marker.style.top = position.y + 'px'; 327 marker.style.width = position.width + 'px'; 328 marker.style.height = position.height + 'px'; 329 }); 330 list_item.addEventListener('mouseout', () => { 331 marker.classList.remove('active'); 332 }); 333 }); 334 */ 335 jQuery('.dropnav .knav a').on('touchstart', function(e) { 336 var href = jQuery(this).attr('href'); 337 if (href && href !== '#') { 338 window.location.href = href; 339 } 340 }); 341 // without dropdown start 342 $('#menu-main-menu > li:not(.menu-item-has-children) .knav > a').on('touchstart', function(e) { 343 e.preventDefault(); // Prevent default action if needed 344 var href = $(this).attr('href'); 345 console.log(href); 346 if (href && href !== '#') { 347 window.location.href = href; // Navigate if href is valid 348 } 349 }); 350 // without dropdown end 351 352 353 354 // const marker = document.querySelector('#marker') 355 // const item = document.querySelectorAll('.site__nav ul li a') 356 // function indicator(e){ 357 // marker.style.top = e.offsetTop+'px'; 358 // marker.style.width = e.offsetWidth+'px'; 359 360 // } 361 // item.forEach(link=>{ 362 // link.addEventListener('mousemove', (e)=>{ 363 // indicator(e.target) 364 // }) 365 // }); 366 367 368 if(jQuery(".jsxPrimeSlide").length) { 369 jQuery('.jsxPrimeSlide').slick({ 370 mobileFirst: true, 371 slidesToShow: 1, 372 slidesToScroll: 1,
373 arrows: false, 374 dots: true, 375 fade: true, 376 cssEase: 'linear', 377 pauseOnHover: true, 378 autoplay: true, 379 autoplaySpeed: 5000 380 }); 381 } 382 383 if(jQuery(".jsxReview").length) { 384 jQuery('.jsxReview').slick({ 385 mobileFirst: true, 386 slidesToShow: 1, 387 slidesToScroll: 1, 388 arrows: false, 389 dots: true, 390 fade: true, 391 cssEase: 'linear', 392 pauseOnHover: true, 393 autoplay: true, 394 autoplaySpeed: 5000 395 }); 396 } 397 398 if(jQuery(".jsxCritiqueSlips").length) { 399 jQuery('.jsxCritiqueSlips').slick({ 400 mobileFirst: true, 401 slidesToShow: 1, 402 slidesToScroll: 1, 403 pauseOnHover: true, 404 autoplay: false, 405 // autoplaySpeed: 5000, 406 // centerMode: true, 407 // slidesToShow: 2, 408 // centerPadding: '0', 409 prevArrow:"<button type='button' class='slick-prev'><span class='icon-prev'></span></button>", 410 nextArrow:"<button type='button' class='slick-next'><span class='icon-next'></span></button>", 411 responsive: [ 412 { 413 breakpoint: 767, 414 // settings: { 415 // centerPadding: '100px', 416 // } 417 settings: { 418 slidesToShow: 2, 419 slidesToScroll: 2 420 } 421 422 } 423 ] 424 }); 425 } 426 427 if(jQuery(".jsxSays").length) { 428 jQuery('.jsxSays').slick({ 429 mobileFirst: true, 430 slidesToShow: 1, 431 slidesToScroll: 1, 432 pauseOnHover: true, 433 autoplay: true, 434 autoplaySpeed: 5000, 435 prevArrow:"<button type='button' class='slick-prev'><span class='icon-prev'></span></button>", 436 nextArrow:"<button type='button' class='slick-next'><span class='icon-next'></span></button>", 437 responsive: [ 438 { 439 breakpoint: 767, 440 settings: { 441 slidesToShow: 2, 442 slidesToScroll: 1, 443 } 444 } 445 ] 446 }); 447 } 448 449 if(jQuery(".jsxRvSays").length) { 450 jQuery('.jsxRvSays').slick({ 451 mobileFirst: true, 452 slidesToShow: 1, 453 slidesToScroll: 1, 454 pauseOnHover: true, 455 autoplay: true, 456 autoplaySpeed: 5000, 457 prevArrow:"<button type='button' class='slick-prev'><span class='icon-prev'></span></button>", 458 nextArrow:"<button type='button' class='slick-next'><span class='icon-next'></span></button>", 459 responsive: [ 460 { 461 breakpoint: 767, 462 settings: { 463 slidesToShow: 2, 464 slidesToScroll: 1, 465 } 466 }, 467 { 468 breakpoint: 991, 469 settings: { 470 slidesToShow: 3, 471 slidesToScroll: 1, 472 } 473 } 474 ] 475 }); 476 } 477 478 // if(jQuery(".jsxDestinyGlid").length) { 479 // jQuery('.jsxDestinyGlide').slick({ 480 // infinite: false, 481 // slidesToShow: 1, 482 // slidesToScroll: 1, 483 // arrows: false, 484 // fade: true, 485 // asNavFor: '.jsxDestinySelect' 486 // }); 487 488 jQuery('.jsxDestinySele').slick({ 489 slidesToShow: 2, 490 slidesToScroll: 1, 491 //asNavFor: '.jsxDestinyGlide', 492 focusOnSelect: true, 493 prevArrow:"<button type='button' class='slick-prev'><span class='icon-prev'></span></button>", 494 nextArrow:"<button type='button' class='slick-next'><span class='icon-next'></span></button>", 495 infinite: true, 496 autoplay: true, 497 arrows: false, 498 autoplaySpeed: 5000, 499 mobileFirst: true, 500 responsive: [ 501 { 502 breakpoint: 767, 503 settings: { 504 slidesToShow: 5, 505 slidesToScroll: 1, 506 } 507 }, 508 { 509 breakpoint: 991, 510 settings: { 511 slidesToShow: 6, 512 slidesToScroll: 1, 513 } 514 } 515 ] 516 517 }); 518 // } 519 520 521 // if(jQuery(".jsxPlaCard").length) { 522 // jQuery('.jsxPlaCard').slick({ 523 // mobileFirst: true, 524 // slidesToShow: 1, 525 // slidesToScroll: 1, 526 // prevArrow:"<button type='button' class='slick-prev'><span class='icon-angle-left'></span></button>", 527 // nextArrow:"<button type='button' class='slick-next'><span class='icon-angle-right'></span></button>", 528 // fade: true, 529 // cssEase: 'linear', 530 // pauseOnHover: true, 531 // autoplaySpeed: 5000 532 // }); 533 // } 534 535 // if(jQuery(".jsxFeatureGlide").length) { 536 // jQuery('.jsxFeatureGlide').slick({ 537 // mobileFirst: true, 538 // slidesToShow: 1, 539 // slidesToScroll: 1, 540 // arrows: true, 541 // }); 542 // } 543 544 // if(jQuery(".jsxFeatureGlide").length) { 545 // jQuery('.jsxFeatureGlide').slick({ 546 // mobileFirst: true, 547 // slidesToShow: 1, 548 // slidesToScroll: 1, 549 // prevArrow:"<button type='button' class='slick-prev'><span class='icon-prev'></span></button>", 550 // nextArrow:"<button type='button' class='slick-next'><span class='icon-next'></span></button>", 551 // responsive: [ 552 // { 553 // breakpoint: 575, 554 // settings: { 555 // slidesToShow: 2, 556 // slidesToScroll: 1, 557 // } 558 // }, 559 // { 560 // breakpoint: 991, 561 // settings: { 562 // slidesToShow: 3, 563 // slidesToScroll: 1, 564 // } 565 // } 566 // ] 567 // }); 568 // } 569 570 // if(jQuery(".jsxActivityGlide").length) { 571 // jQuery('.jsxActivityGlide').slick({ 572 // mobileFirst: true, 573 // slidesToShow: 1, 574 // slidesToScroll: 1, 575 // prevArrow:"<button type='button' class='slick-prev'><span class='icon-prev'></span></button>", 576 // nextArrow:"<button type='button' class='slick-next'><span class='icon-next'></span></button>", 577 // responsive: [ 578 // { 579 // breakpoint: 575, 580 // settings: { 581 // slidesToShow: 2, 582 // slidesToScroll: 1, 583 // } 584 // } 585 // ] 586 // }); 587 // } 588 589 // if(jQuery(".jsxMementoGlide").length) { 590 // jQuery('.jsxMementoGlide').slick({ 591 // mobileFirst: true, 592 // adaptiveHeight: true, 593 // slidesToShow: 1, 594 // slidesToScroll: 1,
595 // arrows: false, 596 // dots: true, 597 // autoplay: false 598 // }); 599 // } 600 601 // if(jQuery(".jsxSnapGlider").length) { 602 // jQuery('.jsxSnapGlider').slick({ 603 // mobileFirst: true, 604 // prevArrow:"<button type='button' class='slick-prev'><span class='icon-prev'></span></button>", 605 // nextArrow:"<button type='button' class='slick-next'><span class='icon-next'></span></button>", 606 // slidesToShow: 2, 607 // slidesToScroll: 1, 608 // autoplay: false, 609 // responsive: [ 610 // { 611 // breakpoint: 767, 612 // settings: { 613 // slidesToShow: 3, 614 // slidesToScroll: 1, 615 // } 616 // }, 617 // { 618 // breakpoint: 991, 619 // settings: { 620 // slidesToShow: 3, 621 // slidesToScroll: 1, 622 // } 623 // } 624 // ] 625 // }); 626 // } 627} 628 629function initStickyFixed() { 630 if(jQuery(".jsxScroller").length) { 631 "use strict"; 632 var $sticky = jQuery('.jsxScroller'); 633 634 $sticky.hcSticky({ 635 mobileFirst: true, 636 stickTo: '.trip__enclose', 637 stickyClass: 'is_stuck', 638 responsive: { 639 768: { 640 top: 70 641 }, 642 992: { 643 top: 78 644 } 645 } 646 }); 647 } 648 649 if(jQuery(".dnp").length) { 650 "use strict"; 651 var $sticky = jQuery('.dnp'); 652 653 $sticky.hcSticky({ 654 mobileFirst: true, 655 stickTo: '.trip__box', 656 stickyClass: 'is_stuck', 657 disable: true, 658 responsive: { 659 768: { 660 top: 10 661 }, 662 992: { 663 disable: false, 664 top: 148 665 } 666 } 667 }); 668 } 669 670 // if(jQuery(".rip__action").length) { 671 // "use strict"; 672 // var $stickyatn = jQuery('.trip__action'); 673 674 // $stickyatn.hcSticky({ 675 // mobileFirst: true, 676 // stickTo: '.trip__box', 677 // stickyClass: 'is_stuck', 678 // top: 0, 679 // disable: true, 680 // responsive: { 681 // 992: { 682 // disable: false 683 // } 684 // } 685 // }); 686 // } 687 688 // if(jQuery(".blog__summary").length) { 689 // "use strict"; 690 // var $stickyblg = jQuery('.blog__summary'); 691 692 // $stickyblg.hcSticky({ 693 // mobileFirst: true, 694 // stickTo: '.blog__plot', 695 // stickyClass: 'is_stuck', 696 // top: 0, 697 // responsive: { 698 // 768: { 699 // top: 0 700 // } 701 // } 702 // }); 703 // } 704 705 // if(jQuery(".travel__guide-intro").length) { 706 // "use strict"; 707 // var $sticky = jQuery('.travel__guide-title'); 708 709 // $sticky.hcSticky({ 710 // mobileFirst:true, 711 // stickTo: '.travel__guide-intro', 712 // stickyClass: 'is_stuck', 713 // top: 0, 714 // responsive: { 715 // 768: { 716 // top: 0 717 // } 718 // } 719 // }); 720 // // stickyClass: 'sticky', 721 // } 722 723 // jQuery('.trip-scroller a').click(function(){ 724 // var scrl = jQuery(this).html(); 725 // jQuery('.jsxScroller').html(scrl).removeClass('scractive'); 726 // jQuery('.trip__scroller ul').slideUp(); 727 // }); 728 729 // jQuery('.jsxScroller').click(function(){ 730 // jQuery(this).toggleClass('scractive'); 731 // jQuery('.trip__scroller ul').slideToggle(); 732 // }); 733} 734 735function initTabs() { 736 jQuery('.destiny__select .jsxDestinySelect').hover(function(){ 737 var tab_id = jQuery(this).attr('data-tab'); 738 jQuery(this).addClass('destinyActive'); 739 jQuery(this).siblings().removeClass('destinyActive'); 740 jQuery('.destiny__stacks-still').removeClass('destinyActive').hide(); 741 jQuery("#"+tab_id).addClass('destinyActive').fadeIn(500); 742 }); 743} 744 745function initSmoothScroll() { 746 // Cache selectors 747 var lastId=0, 748 topMenu = jQuery(".jsxScroller ul"), 749 topMenuHeight = -6, 750 // All list items 751 menuItems = topMenu.find("a"), 752 // Anchors corresponding to menu items 753 scrollItems = menuItems.map(function(){ 754 // var item = $($(this).attr("href")); 755 // if (item.length) { return item; } 756 var hrefattr; 757 hrefattr = $(this).attr("href"); 758 if(hrefattr.indexOf('#') > -1) { 759 var item = $($(this).attr("href")); 760 if (item.length) { return item; } 761 } 762 }); 763 764 // Bind click handler to menu items 765 // so we can get a fancy scroll animation 766 menuItems.click(function(e){ 767 var href = $(this).attr("href"), 768 offsetTop = href === "#" ? 0 : $(href).offset().top-topMenuHeight+1; 769 $('html, body').stop().animate({ 770 scrollTop: offsetTop 771 }, 800); 772 e.preventDefault(); 773 }); 774 775 // Bind to scroll 776 $(window).scroll(function(){ 777 // Get container scroll position 778 var fromTop = $(this).scrollTop()+topMenuHeight; 779 780 // Get id of current scroll item 781 var cur = scrollItems.map(function(){ 782 if ($(this).offset().top < fromTop) 783 return this; 784 }); 785 // Get the id of the current element 786 cur = cur[cur.length-1]; 787 var id = cur && cur.length ? cur[0].id : ""; 788 789 if (lastId !== id) { 790 lastId = id; 791 // Set/remove active class 792 menuItems 793 .parent().removeClass("scractive") 794 .end().filter("[href='#"+id+"']").parent().addClass("scractive"); 795 // var sclbl = menuItems.filter("[href='#"+id+"']").html(); 796 // jQuery('.jsxScroller').html(sclbl); 797 } 798 }); 799} 800 801 802 803 804function initMagnificPopup() { 805 // single popup 806 jQuery('.jsxPopupSingle').magnificPopup({ 807 type: 'image', 808 closeOnContentClick: true, 809 image: { 810 verticalFit: false, 811 tError: 'The image could not be loaded.', 812 }, 813 removalDelay: 500, //delay removal by X to allow out-animation 814 callbacks: { 815 beforeOpen: function() { 816 // just a hack that adds mfp-anim class to markup 817 this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim'); 818 this.st.mainClass = this.st.el.attr('data-effect'); 819 } 820 }, 821 midClick: true 822 }); 823 824 // gallery popup 825 jQuery('.jsxPopupGallery').magnificPopup({ 826 delegate: 'a[data-effect]', 827 type: 'image', 828 tLoading: 'Loading image #%curr%...', 829 mainClass: 'mfp-img-mobile', 830 gallery: { 831 enabled: true, 832 navigateByImgClick: true, 833 preload: [0,1] // Will preload 0 - before current, and 1 after the current image 834 }, 835 image: { 836 tError: 'The image could not be loaded.', 837 }, 838 removalDelay: 500, //delay removal by X to allow out-animation 839 callbacks: { 840 beforeOpen: function() { 841 // just a hack that adds mfp-anim class to markup 842 this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim'); 843 this.st.mainClass = this.st.el.attr('data-effect'); 844 } 845 }, 846 midClick: true 847 }); 848 849 // inline popup 850 jQuery('.jsxInline').magnificPopup({ 851 // fixedBgPos: true,
852 // fixedContentPos: false, 853 type: 'inline', 854 overflowY: 'auto', 855 closeBtnInside: true, 856 preloader: false, 857 midClick: true, 858 removalDelay: 500, 859 mainClass: 'mfp-inline', 860 callbacks: { 861 beforeOpen: function() { 862 this.st.mainClass = this.st.el.attr('data-effect'); 863 } 864 } 865 }); 866 867 jQuery('.jsxFrame').magnificPopup({ 868 disableOn: 700, 869 type: 'iframe', 870 mainClass: 'mfp-fade', 871 removalDelay: 400, 872 preloader: false, 873 fixedContentPos: false, 874 iframe: { 875 markup: '<div class="mfp-iframe-scaler">'+ 876 '<div class="mfp-close"></div>'+ 877 '<iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen allow="autoplay"></iframe>'+ 878 '</div>', 879 patterns: { 880 youtube: { 881 index: 'youtube.com', 882 id: 'v=', 883 src: 'https://www.youtube.com/embed/%id%?rel=0&autoplay=1&muted=1', 884 allow: 'autoplay' 885 } 886 } 887 }, 888 }); 889} 890 891 892// input type number 893function initInputNumber() { 894 jQuery('<span class="qty-control"><span class="qty-btn qty-up">+</span><span class="qty-btn qty-down">-</span></span>').insertAfter('input[type="number"]'); 895 jQuery('.form-number').each(function() { 896 countSpinner(this); 897 }); 898} 899 900function countSpinner(control) { 901 var spinner = jQuery(control), 902 input = spinner.find('input[type="number"]'), 903 btnUp = spinner.find('.qty-up'), 904 btnDown = spinner.find('.qty-down'), 905 step = input.attr('step'), 906 min = input.attr('min'), 907 max = input.attr('max'); 908 909 if (typeof step === "undefined") { 910 step = 1; 911 } 912 913 btnUp.click(function() { 914 var oldValue = parseFloat(input.val()); 915 if (isNaN(oldValue)) { 916 var newVal = parseInt(min) + parseInt(step); 917 } else if (oldValue >= max) { 918 var newVal = oldValue; 919 } else { 920 var newVal = parseInt(oldValue) + parseInt(step); 921 if (newVal >= max) { 922 newVal = max; 923 } 924 } 925 spinner.find("input").val(newVal); 926 spinner.find("input").trigger("change"); 927 }); 928 929 btnDown.click(function() { 930 var oldValue = parseFloat(input.val()); 931 if (isNaN(oldValue)) { 932 var newVal = min; 933 } else if (oldValue <= min) { 934 var newVal = oldValue; 935 } else { 936 var newVal = parseInt(oldValue) - parseInt(step); 937 if (newVal <= min) { 938 newVal = min; 939 } 940 } 941 spinner.find("input").val(newVal); 942 spinner.find("input").trigger("change"); 943 }); 944 945 // disable mousewheel on a input number field when in focus 946 // (to prevent Cromium browsers change the value when scrolling) 947 // jQuery('form').on('focus', 'input[type=number]', function (e) { 948 // jQuery(this).on('mousewheel.disableScroll', function (e) { 949 // e.preventDefault() 950 // }) 951 // }) 952 // jQuery('form').on('blur', 'input[type=number]', function (e) { 953 // jQuery(this).off('mousewheel.disableScroll') 954 // }) 955}
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.