https://www.byronwoolacombeholidaylets.co.uk/wp-content/themes/byron-woolacombe-2021/script.js?ver=5
1jQuery(document).ready(function($) { 2 3 jQuery(document).ready(function($) { 4 5 var dateToday = new Date(); 6 7 $("#sc-main-search-arrival").datepicker("destroy"); 8 9 jQuery('#sc-main-search-arrival').datepicker({ 10 11 minDate: dateToday, 12 13 dateFormat: 'dd/mm/yy', 14 15 //defaultDate: "+1w", 16 17 numberOfMonths: 2, 18 19 onSelect: function() { 20 21 var arrivalElement = document.getElementById('sc-main-search-arrival'); 22 23 var changeEvent = new Event('change', { bubbles: true }); 24 arrivalElement.dispatchEvent(changeEvent); 25 26 var suggested_departure = jQuery(this).datepicker('getDate'); 27 28 29 if (suggested_departure) { 30 31 if(jQuery("#sc_default_nights").val() != ""){ 32 default_nights = parseInt(jQuery("#sc_default_nights").val()); 33 } else { 34 default_nights = defaultDate; 35 } 36 37 suggested_departure.setDate(suggested_departure.getDate() + default_nights ); 38 39 jQuery("#sc-main-search-departure").datepicker("setDate", suggested_departure); 40 41 } 42 } 43 44 45 }); 46 47 }); 48 49 $( "img" ).addClass( "responsive" ); 50 $( ".is-resized img" ).removeClass( "responsive" ); 51 52 53 if ($(window).width() > 650) { 54 // Main Navigation 55 var closing = undefined; 56 var closingInterval = undefined; 57 58 function doClose() { 59 $(closing).children("ul").stop(true, true).hide(); 60 closing = undefined; 61 closingInterval = undefined; 62 } 63 64 $(".nav ul>li").children("ul").hide(); 65 66 $(".nav ul>li>a").mouseenter(function () { 67 var menu = $(this).closest('li'); 68 if (closing) { 69 clearTimeout(closingInterval); 70 if (closing != menu[0]) { 71 doClose(); 72 73 } else { 74 closing = undefined; 75 closingInterval = undefined; 76 } 77 } 78 menu.children("ul").stop(true, true).show(); 79 }); 80 81 $(".nav ul>li").mouseleave(function () { 82 closing = this; 83 closingInterval = setTimeout(doClose, 100); 84 }); 85 86 } 87 88 $(".full-width.light-blue-bg").wrap("<div class='full-width-light-blue-outer'><div class='centred'><div class='page-content'></div></div></div>"); 89 90 $(".full-width.dark-blue-bg").wrap("<div class='full-width-dark-blue-outer'><div class='centred'><div class='page-content'></div></div></div>"); 91 92 $(".full-width.grey-bg").wrap("<div class='full-width-grey-outer'><div class='centred'><div class='page-content'></div></div></div>"); 93 94 $(".full-width.green-bg").wrap("<div class='full-width-green-outer'><div class='centred'><div class='page-content'></div></div></div>"); 95 96 97 98 $('.index-filter-button').click(function(){ 99 $('.index-filter-slide').slideToggle(); 100 $('.index-filters').toggleClass('index-filters-active'); 101 }); 102 103 104 // Mobile Nav 105 $('.nav-button').click(function(){ 106 107 $('.nav-scroll-outer').slideDown(500); 108 109 setTimeout(function(){ 110 $('.top-bar').addClass('nav-open'); 111 } 112 , 400) 113 114 }); 115 116 // Mobile Nav 117 $('.nav-scroll-nav-button').click(function(){ 118 119 $('.nav-scroll-outer').slideUp(500); 120 121 setTimeout(function(){ 122 $('.top-bar').removeClass('nav-open'); 123 } 124 , 400) 125 126 }); 127 128 129 $(".mobile-nav ul li.menu-item-has-children ul.sub-menu").prepend("<li class='mobile-nav-back'><i class='far fa-chevron-left'></i> <a>Back</a></li>"); 130 131 $(".mobile-nav ul li.menu-item-has-children").append("<i class='far fa-plus'></i>"); 132 133 $('.mobile-nav ul li.menu-item-has-children i').click(function () { 134 $(this).parent().children('.sub-menu').slideToggle('slow'); 135 }); 136 137 $('li.mobile-nav-back').click(function () { 138 $(this).parent('.sub-menu').slideToggle('slow'); 139 }); 140 141 142 (function () { 143 var nav = document.querySelector('.top-bar-fixed'); 144 if (!nav) return; 145 146 var THRESHOLD = 300; // px scrolled from top before direction-based toggle kicks in 147 var lastScrollY = window.pageYOffset || document.documentElement.scrollTop; 148 var ticking = false; 149 150 function onScroll() { 151 var currentScrollY = window.pageYOffset || document.documentElement.scrollTop; 152 153 if (currentScrollY < THRESHOLD) { 154 // Below threshold â always hidden, regardless of direction 155 nav.classList.add('top-bar-fixed-on-scroll'); 156 } else { 157 // At or above threshold â direction controls visibility 158 if (currentScrollY > lastScrollY) { 159 // Scrolling down â hide 160 nav.classList.add('top-bar-fixed-on-scroll'); 161 } else if (currentScrollY < lastScrollY) { 162 // Scrolling up â show 163 nav.classList.remove('top-bar-fixed-on-scroll'); 164 } 165 } 166 167 lastScrollY = currentScrollY; 168 ticking = false;
169 } 170 171 window.addEventListener('scroll', function () { 172 if (!ticking) { 173 window.requestAnimationFrame(onScroll); 174 ticking = true; 175 } 176 }, { passive: true }); 177 })(); 178 179 180 /* Content Menu Backround Image */ 181 182 var pause = false; 183 184 $('.content-menu-link').mouseenter(function() { 185 console.log('working'); 186 background_image = $(this).data('image'); 187 188 $('.content-menu-link').each(function() { 189 190 $(this).removeClass('content-menu-link-active'); 191 192 }); 193 194 $(this).addClass('content-menu-link-active'); 195 196 /* 197 setTimeout(function() { 198 $('.content-menu-outer').css('background-image', 'url(' + background_image + ')'); 199 }, 800); 200 */ 201 202 $('.content-menu-outer').css('background-image', 'url(' + background_image + ')'); 203 204 pause = true; 205 206 }); 207 208 $('.content-menu-link').mouseleave(function() { 209 210 pause = false; 211 212 }); 213 214 215 var background_images = []; 216 217 $('.content-menu-link').each(function() { 218 219 background_images.push($(this).data('image')); 220 221 }); 222 223 224 var index = 0; 225 226 function updateImage() { 227 228 if(!pause) { 229 230 $('.content-menu-outer').css('background-image', 'url(' + background_images[index] + ')'); 231 232 $('.content-menu-link').each(function() { 233 234 live_image = $(this).data('image'); 235 236 if(live_image == background_images[index]) { 237 $(this).addClass('content-menu-link-active'); 238 } else { 239 $(this).removeClass('content-menu-link-active'); 240 } 241 242 }); 243 244 245 246 index = (index + 1) % background_images.length; 247 } 248 249 } 250 251 updateImage(); 252 253 setInterval(updateImage, 4000); 254 255 256 if($(window).width() <=600) { 257 $('.spcb-description').click(function() { 258 $('.single-property-description-dropdown-panel').slideDown('normal'); 259 $('.single-property-description-dropdown').addClass('single-property-dropdown-title-active'); 260 $('.single-property-description-dropdown span').addClass('facilities-icon-active'); 261 }); 262 $('.spcb-gallery').click(function() { 263 $('.single-property-gallery-dropdown-panel').slideDown('normal'); 264 $('.single-property-gallery-title').addClass('single-property-dropdown-title-active'); 265 $('.single-property-gallery-title span').addClass('facilities-icon-active'); 266 }); 267 $('.spcb-reviews').click(function() { 268 $('.single-property-review-dropdown-panel').slideDown('normal'); 269 $('.single-property-review-title').addClass('single-property-dropdown-title-active'); 270 $('.single-property-review-title span').addClass('facilities-icon-active'); 271 }); 272 $('.spcb-floorplans').click(function() { 273 $('.single-property-floorplans-dropdown-panel').slideDown('normal'); 274 $('.single-property-floorplans-title').addClass('single-property-dropdown-title-active'); 275 $('.single-property-floorplans-title span').addClass('facilities-icon-active'); 276 }); 277 }; 278 279 280 $(".spcb-description").click(function(){ 281 $("html,body").animate({ scrollTop: $(".single-property-description").offset().top -160 }, "slow"); 282 }); 283 284 $(".spcb-gallery").click(function(){ 285 $("html,body").animate({ scrollTop: $(".single-property-gallery").offset().top - 100 }, "slow"); 286 $(".single-property-gallery-dropdown-panel").slideDown(); 287 $(".single-property-gallery-title span").addClass('facilities-icon-active'); 288 }); 289 290 $(".spcb-availability").click(function(){ 291 $("html,body").animate({ scrollTop: $(".single-property-right-container").offset().top - 100 }, "slow"); 292 }); 293 294 $(".spcb-tour").click(function(){ 295 $("html,body").animate({ scrollTop: $(".single-property-tour").offset().top - 100 }, "slow"); 296 $(".single-property-tour-dropdown-panel").slideDown(); 297 $(".single-property-tour-title span").addClass('facilities-icon-active'); 298 }); 299 300 $(".spcb-floorplans").click(function(){ 301 $("html,body").animate({ scrollTop: $(".single-property-floorplans").offset().top - 100 }, "slow"); 302 $(".single-property-floorplans-dropdown-panel").slideDown(); 303 $(".single-property-floorplans-title span").addClass('facilities-icon-active'); 304 }); 305 306 $(".spcb-reviews").click(function(){ 307 $("html,body").animate({ scrollTop: $(".single-property-reviews").offset().top - 100 }, "slow"); 308 $(".single-property-review-dropdown-panel").slideDown(); 309 $(".single-property-review-title span").addClass('facilities-icon-active'); 310 }); 311 312 $(".spcb-rates").click(function(){ 313 $("html,body").animate({ scrollTop: $(".single-property-rates").offset().top - 100 }, "slow"); 314 $(".single-property-rates-dropdown-panel").slideDown(); 315 $(".single-property-rates-title span").addClass('facilities-icon-active'); 316 }); 317 318 $(".spcb-things-to-do").click(function(){ 319 $("html,body").animate({ scrollTop: $(".single-property-things-to-do").offset().top - 100 }, "slow"); 320 }); 321 322 $(".single-property-facilities-dropdown .single-property-facilities-title h2").click(function() { 323 324 $('.single-property-facilities-dropdown-panel').slideToggle(); 325 326 $(".single-property-facilities-dropdown .single-property-facilities-title h2 span").toggle(); 327 328 }); 329 330 //Single Property Dropdowns 331 332 $(".single-property-dropdown-title-new").click(function() { 333 334 $(this).next('.single-property-dropdown-panel').slideToggle('normal'); 335 336 $(this).toggleClass('single-property-dropdown-title-active'); 337 338 $(this).children('span').toggleClass('facilities-icon-active'); 339 340 /* 341 $('.single-property-dropdown-title-active').not(this).each(function () { 342 343 $(this).next('.single-property-dropdown-panel').slideToggle('normal'); 344 345 $(this).toggleClass('single-property-dropdown-title-active'); 346 347 $(this).children('span').toggleClass('facilities-icon-active'); 348 349 }); 350 */ 351 }); 352 353 $('.reviews-more').click(function() { 354 if($(this).hasClass('reviews-more-active')) { 355 $("html,body").animate({ scrollTop: $(".single-property-review-title").offset().top - 100 }, "medium"); 356 } 357 $('.reviews-more span').toggle(); 358 $('.single-property-testimonial-chunk-less').slideToggle(); 359 $(this).toggleClass('reviews-more-active'); 360 }); 361 362 $('.gallery-show-less').click(function() { 363 $("html,body").animate({ scrollTop: $(".single-property-gallery-title").offset().top - 140 }, "medium"); 364 }); 365 366 367 368 369 $(window).on("scroll touchmove", function () { 370 $('.single-property-top-right').toggleClass('single-property-top-right-fixed', $(document).scrollTop() > 700); 371 }); 372 373 374 $( ".byron-slider" ).append( "<div class=\"slider-arrows-new test-arrows\">\n" + 375 " <div class=\"slider-prev-new\"><i class=\"fal fa-chevron-left\"></i></div>\n" + 376 " <div class=\"slider-next-new\"><i class=\"fal fa-chevron-right\"></i></div>\n" + 377 " </div>"); 378 379 380 $('.test-arrows .slider-prev-new').click(function(){ 381 382 $('.splide__arrow--prev').trigger('click'); 383 384 }); 385 386 $('.test-arrows .slider-next-new').click(function(){ 387 388 $('.splide__arrow--next').trigger('click'); 389 390 }); 391 392 $(".back-to-top").click(function () { 393 $("html, body").animate({scrollTop: 0}, 1000); 394 }); 395 396 $(window).on("scroll touchmove", function () { 397 $('.back-to-top').toggleClass('back-to-top-inview', $(document).scrollTop() > 500); 398 }); 399 400 // Cookie Slide box 401 402 $('.reveal_privacy_options').click(function(){ 403 404 $('.wc_reveal_options').slideToggle(); 405 $('.reveal_privacy_options span').toggle(); 406 407 }); 408 409 410 411 412 // AJAX cookie notification 413 414 $('.wc_privacy_submit').click(function() { 415 416 var privacy_options = []; 417 418 $('input[name="privacy_options[]"]:checked').each(function () 419 420 { 421 privacy_options.push( $(this).val() ); 422 }); 423 424 $.post( "", { privacy_options: privacy_options, update_privacy: "1" }); 425 426 427 if (jQuery('.wc_privacy_updated').length) 428 $('.wc_privacy_updated').hide().fadeIn(); 429 430 else 431 $('.wc_privacy_notice').fadeOut(); 432 433 434 return false;
435 436 }); 437 438 var centredWidth = 1260; 439 440 var sliderTabletWidth = 782; 441 442 var sliderMobileWidth = 500; 443 444 function slide_width(){ 445 if($(window).width() >= centredWidth){ 446 var byronPagesFirstSlide = centredWidth / 1.75; 447 var byronPagesRemainingSlides = centredWidth / 3.2; 448 $('.byron_pages-first-slide').css('width', byronPagesFirstSlide); 449 $('.byron_pages-even-slide').css('width', byronPagesRemainingSlides); 450 451 } else { 452 var screenSizeWidth = $(window).width() - 40; 453 454 if($(window).width() >= sliderTabletWidth) { 455 var byronPagesFirstSlide = screenSizeWidth / 2; 456 var byronPagesRemainingSlides = screenSizeWidth / 3.2; 457 $('.byron_pages-first-slide').css('width', byronPagesFirstSlide); 458 $('.byron_pages-even-slide').css('width', byronPagesRemainingSlides); 459 } else if($(window).width() >= sliderMobileWidth) { 460 var byronPagesFirstSlide = screenSizeWidth / 1.5; 461 var byronPagesRemainingSlides = screenSizeWidth / 2.2; 462 $('.byron_pages-first-slide').css('width', byronPagesFirstSlide); 463 $('.byron_pages-even-slide').css('width', byronPagesRemainingSlides); 464 } else { 465 var byronPagesFirstSlide = screenSizeWidth / 1.2; 466 $('.byron_pages-first-slide').css('width', byronPagesFirstSlide); 467 $('.byron_pages-even-slide').css('width', byronPagesFirstSlide); 468 } 469 } 470 } 471 472 slide_width(); 473 474 jQuery( window ).resize(function(){slide_width()}); 475 476 477 if ($.fn.slick) { 478 479 $('.content-block .content-block-slider').each(function(){ 480 481 $(this).slick({ 482 autoplay: true, 483 infinite: true, 484 autoplaySpeed: 6000, 485 speed: 800, 486 dots: false, 487 arrows: true, 488 swipeToSlide: true, 489 slidesToShow: 3, 490 slidesToScroll: 1, 491 responsive: [ 492 { 493 breakpoint: 600, 494 settings: { 495 slidesToShow: 2, 496 } 497 }, 498 { 499 breakpoint: 450, 500 settings: { 501 slidesToShow: 1, 502 } 503 } 504 ] 505 506 }); 507 508 $(this).parent().closest() 509 510 }); 511 512 $('.content-block.content-block-columns-4 .content-block-slider').each(function(){ 513 514 $(this).slick('unslick'); 515 516 $(this).slick({ 517 slidesToShow: 4, 518 dots: false, 519 swipeToSlide: true, 520 responsive: [ 521 { 522 breakpoint: 1300, 523 settings: { 524 slidesToShow: 3, 525 } 526 }, 527 { 528 breakpoint: 900, 529 settings: { 530 slidesToShow: 2, 531 } 532 }, 533 { 534 breakpoint: 600, 535 settings: { 536 slidesToShow: 1, 537 } 538 } 539 ] 540 }); 541 542 }); 543 544 545 546 $('.content-block.content-block-columns-3 .content-block-slider').each(function(){ 547 548 $(this).slick('unslick'); 549 550 $(this).slick({ 551 slidesToShow: 3, 552 dots: false, 553 swipeToSlide: true, 554 responsive: [ 555 { 556 breakpoint: 900, 557 settings: { 558 slidesToShow: 2, 559 } 560 }, 561 { 562 breakpoint: 600, 563 settings: { 564 slidesToShow: 1, 565 } 566 } 567 ] 568 }); 569 570 }); 571 572 $('.content-block.content-block-columns-2 .content-block-slider').each(function(){ 573 574 $(this).slick('unslick'); 575 576 $(this).slick({ 577 slidesToShow: 2, 578 slidesToScroll: 1, 579 dots: false, 580 swipeToSlide: true, 581 }); 582 }); 583 584 $('.content-block.content-block-columns-1 .content-block-slider').each(function(){ 585 586 $(this).slick('unslick'); 587 588 $(this).slick({ 589 slidesToShow: 1, 590 slidesToScroll: 1, 591 dots: false, 592 swipeToSlide: true, 593 centerMode: true, 594 }); 595 }); 596 597 $('.plan-your-stay .creato_block-container-listings .slider').slick({ 598 autoplay: false, 599 infinite: true, 600 autoplaySpeed: 6000, 601 speed: 800, 602 arrows: false, 603 swipeToSlide: true, 604 adaptiveHeight: false, 605 variableWidth: false, 606 slidesToShow: 3, 607 slidesToScroll: 1, 608 rows: 1, 609 slidesPerRow: 1, 610 responsive: [ 611 { 612 breakpoint: 800, 613 settings: { 614 slidesToShow: 2, 615 } 616 }, 617 { 618 breakpoint: 500, 619 settings: { 620 slidesToShow: 1, 621 } 622 } 623 ] 624 625 }); 626 627 $('.byron_pages .creato_block-container-listings .slider').slick({ 628 autoplay: false, 629 infinite: true, 630 autoplaySpeed: 6000, 631 speed: 800, 632 arrows: false, 633 swipeToSlide: true, 634 adaptiveHeight: true, 635 variableWidth: true, 636 slidesToShow: 3, 637 slidesToScroll: 1, 638 rows: 1, 639 slidesPerRow: 1, 640 responsive: [ 641 { 642 breakpoint: 1000, 643 settings: { 644 slidesToShow: 2, 645 } 646 }, 647 { 648 breakpoint: 500, 649 settings: { 650 slidesToShow: 1, 651 } 652 } 653 ] 654 655 }); 656 657 $('.byron-review-outer .byron-review-slider, .guest-review-slider').slick({ 658 autoplay: false, 659 infinite: true, 660 autoplaySpeed: 6000,
661 speed: 800, 662 arrows: true, 663 swipeToSlide: true, 664 slidesToShow: 1, 665 slidesToScroll: 1, 666 667 }); 668 669 $('.full-width-gallery-slider .gallery-slider').slick({ 670 dots: false, 671 arrows: true, 672 infinite: true, 673 speed: 800, 674 slidesToShow: 1, 675 slidesToScroll: 1, 676 autoplay: true, 677 centerMode: true, 678 autoplaySpeed: 6000, 679 }); 680 681 $('.gallery-slider').slick({ 682 dots: false, 683 arrows: true, 684 infinite: true, 685 speed: 800, 686 fade: true, 687 slidesToShow: 1, 688 slidesToScroll: 1, 689 adaptiveHeight: true, 690 autoplay: true, 691 autoplaySpeed: 6000, 692 }); 693 694 if(jQuery(window).width() <= 700) { 695 696 $('.mobile-slider .creato_block-container-listings .grid').slick({ 697 autoplay: true, 698 infinite: true, 699 autoplaySpeed: 6000, 700 speed: 800, 701 arrows: false, 702 swipeToSlide: true, 703 704 slidesToShow: 3, 705 slidesToScroll: 1, 706 responsive: [ 707 { 708 breakpoint: 600, 709 settings: { 710 slidesToShow: 2, 711 } 712 }, 713 { 714 breakpoint: 500, 715 settings: { 716 slidesToShow: 1, 717 } 718 } 719 ] 720 721 }); 722 723 } 724 725 726 if(jQuery(window).width() <= 600) { 727 728 $('.banner .slider').slick({ 729 autoplay: true, 730 infinite: true, 731 autoplaySpeed: 6000, 732 speed: 800, 733 fade: true, 734 arrows: true, 735 pauseOnHover: false, 736 }); 737 738 } else { 739 740 $('.banner .slider').slick({ 741 autoplay: false, 742 infinite: false, 743 autoplaySpeed: 6000, 744 speed: 800, 745 fade: true, 746 arrows: false, 747 pauseOnHover: true, 748 draggable: false 749 }); 750 751 } 752 753 $('.apartments-slider .slider, .single-property-gallery-top .slider').slick({ 754 autoplay: true, 755 infinite: true, 756 autoplaySpeed: 5000, 757 speed: 1500, 758 fade: false, 759 arrows: false, 760 pauseOnHover: false, 761 762 slidesToShow: 2, 763 slidesToScroll: 1, 764 responsive: [ 765 { 766 breakpoint: 500, 767 settings: { 768 slidesToShow: 1, 769 } 770 } 771 ] 772 }); 773 774 $('.slider-arrows-new .slider-prev-new').click(function(){ 775 $('.apartments-slider .slider, .single-property-gallery-top .slider, .byron-slider .slick-slider').slick('slickPrev'); 776 }) 777 778 $('.slider-arrows-new .slider-next-new').click(function(){ 779 $('.apartments-slider .slider, .single-property-gallery-top .slider, .byron-slider .slick-slider').slick('slickNext'); 780 }) 781 782 $('.single-property-gallery-top a').click(function(){ 783 784 console.log('working'); 785 786 $('.sc-property-page-gallery-image[image-src="'+$(this).attr('image-src')+'"]').trigger('click') 787 788 }) 789 } 790 791 /*if( jQuery('.creato_search .autocomplete').length > 0 && jQuery.isFunction(jQuery.fn.autocomplete) ) { 792 793 jQuery('.creato_search .autocomplete').autocomplete({ 794 795 source: jQuery('#template_url').val() + '/custom/autocomplete.php', 796 minLength: 3, 797 798 select: function(event, ui) { 799 800 if( ui.item ) { 801 802 jQuery('.autocomplete_postID').val( ui.item.id ).change(); // for some reason the change is not triggered 803 804 } 805 806 jQuery(this).val(''); 807 808 return false; 809 810 }, 811 812 search: function() { 813 jQuery('.creato_search_loading').addClass('active'); 814 }, 815 816 response: function() { 817 jQuery('.creato_search_loading').removeClass('active'); 818 }, 819 820 }); 821 822 } 823 jQuery('.autocomplete_postID').change(function() { 824 825 document.location = jQuery('#site_url').val() + '?p=' + jQuery(this).val(); 826 827 });*/ 828 829 //Change to site specific mobile width 830 var mobile_width = '600'; 831 var tablet_width = '900'; 832 833 function check_screen_width(){ 834 if(jQuery(window).width() <= mobile_width){ 835 jQuery('#mobile_width').val('1'); 836 837 } else if(jQuery(window).width() <= tablet_width){ 838 jQuery('#mobile_width').val('2'); 839 } else { 840 jQuery('#mobile_width').val('0'); 841 } 842 } 843 844 check_screen_width(); 845 846 jQuery( window ).resize(function(){check_screen_width()}); 847 848 849 850 $('.apartment-slider').each(function(){ 851 852 853 $(this).slick({ 854 autoplay: true, 855 infinite: true, 856 speed: 2000, 857 fade: false, 858 dots: false, 859 arrows: true, 860 touchMove: true, 861 swipe: true, 862 swipeToSlide: true, 863 appendArrows: jQuery(this).parent().parent().find('.apartment-slider-arrows'), 864 slidesToShow: 3, 865 slidesToScroll: 1, 866 responsive: [ 867 868 { 869 breakpoint: 1100, 870 settings: { 871 slidesToShow: 2 872 } 873 }, 874 { 875 breakpoint: 800, 876 settings: { 877 slidesToShow: 1 878 } 879 } 880 ] 881 }); 882 883 }); 884 885 /* 886 $('.apartment-slider-button').click(function(){ 887 888 889 $('.apartment-slider-button').removeClass('active'); 890 $(this).addClass('active'); 891 892 tab = $(this).attr('tab'); 893 894 console.log(tab) 895 896 if(tab == 'view-all'){ 897 898 $('.apartment-slider .single-property').show(); 899 900 } else { 901 902 $('.apartment-slider .single-property').not('.' + tab).hide(); 903 $('.apartment-slider .single-property.' + tab).show(); 904 905 } 906 907 slideno = (jQuery('.sc-single-property.slick-slide:visible').index()) 908 909 //console.log(slideno) 910 911 $('.apartment-slider').slick('slickGoTo', 0, true); 912 913 914 915 }) 916 */ 917 918 if($("input[name='0'].search-hidden").length){ 919 search = $("input[name='0'].search-hidden").val(); 920 document.cookie = "sc_recently_searched=" + search + "; expires=2147483647; path=/"; 921 } 922 923 $(".this-changes-everything-tabs .tab").click(function (e) { 924 925 926 927 console.log('clicked') 928 929 930 $(".this-changes-everything-tabs .tab").removeClass("active"); 931 $(".sc-list-view-inner").removeClass("active"); 932 $(".sc-list-view-inner").hide(); 933 934 $(this).addClass("active"); 935 936 var identifier = $(this).attr("tab"); 937 $("#panel-" + identifier).addClass("active"); 938 $("#panel-" + identifier).fadeIn(1000, function () { 939 940 }) 941 942 var count = $(this).children('.property-archive-tab-count').attr('count'); 943 944 $('.sc-results-count-title span').html(count); 945 946 947 if ($(this).hasClass('property-archive-tab')) { 948 949 search = $("input[name='" + identifier + "'].search-hidden").val(); 950 951 document.cookie = "sc_recently_searched=" + search + "; expires=2147483647; path=/"; 952 953 } 954 955 jQuery('#maponoffswitch').prop('checked', true); 956 jQuery('#maponoffswitch').trigger('change'); 957 958 archive_image_heights(); 959 960 961 }); 962 963 964 $('.sc-recently-searched-change-cta').click(function(){ 965 $("html,body").animate({ scrollTop: $(".single-property-right-container").offset().top -160 }, "slow"); 966 $('.sc-calendar-change-dates-link').trigger('click');
967 $('.single-property-book-now').slideUp(); 968 }) 969 /* 970 $(window).load(function(){ 971 972 jQuery('.new-slider-focus-inner').slick({ 973 slidesToShow: 1, 974 slidesToScroll: 1, 975 arrows: true, 976 prevArrow: jQuery(".single-property-image-prev"), 977 nextArrow: jQuery(".single-property-image-next"), 978 fade: true, 979 asNavFor: '.new-slider-nav' 980 }); 981 982 if ($(window).width() > 1920) { 983 slidestoshow = 20; 984 } else if ($(window).width() > 1200) { 985 slidestoshow = 18; 986 } else if ($(window).width() > 100) { 987 slidestoshow = 12; 988 } else { 989 slidestoshow = 10; 990 } 991 992 jQuery('.new-slider-nav').slick({ 993 centerMode: true, 994 focusOnSelect: true, 995 slidesToScroll: 1, 996 autoplay: false, 997 infinite: false, 998 autoplaySpeed: 5000, 999 arrows: false, 1000 dots: false, 1001 touchMove: true, 1002 swipe: true, 1003 asNavFor: '.new-slider-focus-inner', 1004 slidesToShow: slidestoshow, 1005 infinite: true, 1006 swipeToSlide: true, 1007 //variableWidth: true, 1008 1009 1010 }); 1011 1012 1013 1014 jQuery(".link-to-gallery, .single-property-slider-banner .slides .slick-list").click(function(){ 1015 1016 //$(".new-slider-nav").slick("refresh"); 1017 //$(".new-slider-focus-inner").slick("refresh"); 1018 1019 $('.overlay-gallery').fadeIn('400', function(){ 1020 1021 1022 $(".new-slider-nav").slick("refresh"); 1023 $(".new-slider-focus-inner").slick("refresh"); 1024 $('.new-slider-focus').find('.slick-list').attr('tabindex', 0).focus(); 1025 1026 1027 }); 1028 1029 1030 }); 1031 1032 1033 jQuery(".single-property-page-gallery a").click(function(e){ 1034 e.preventDefault(); 1035 1036 img_link = jQuery(this).attr('img-link'); 1037 1038 jQuery('#' + img_link).trigger('click'); 1039 1040 //$(".new-slider-nav").slick("refresh"); 1041 //$(".new-slider-focus-inner").slick("refresh"); 1042 1043 $('.overlay-gallery').fadeIn('400', function(){ 1044 $(".new-slider-nav").slick("refresh"); 1045 $(".new-slider-focus-inner").slick("refresh"); 1046 1047 }); 1048 1049 $('.new-slider-focus').find('.slick-list').attr('tabindex', 0).focus(); 1050 1051 }); 1052 1053 1054 }) 1055 1056 1057 jQuery('.new-slider-focus, .overlay.overlay-gallery i').click(function(e){ 1058 1059 if (e.target !== this) 1060 return; 1061 1062 $('.overlay').fadeOut(); 1063 1064 }); 1065 1066 $('.debug .single-property-page-gallery a').click(function(e) { 1067 e.preventDefault(); 1068 var slideno = $(this).attr('img-link'); 1069 slideno = slideno.replace('gallery-', ''); 1070 $('.new-slider-nav').slick('slickGoTo', slideno - 1); 1071 }); 1072 */ 1073 1074 1075 $('.property-reviews-select').change(function(){ 1076 1077 console.log('test') 1078 1079 console.log($('.property-reviews-select option:selected').val()) 1080 1081 $('.property-reviews-container').removeClass('active'); 1082
1083 $('.property-reviews-container[date="'+$('.property-reviews-select option:selected').val()+'"]').addClass('active'); 1084 1085 1086 }); 1087 1088 1089 $('.sc-recently-searched-book-cta').click(function(e){ 1090 e.preventDefault(); 1091 open_sc_cart(); 1092 1093 }); 1094 1095 1096 function open_sc_cart(){ 1097 1098 arrival_date = new Date($('.sc-recently-searched-book-cta').attr('arrival')*1000); 1099 if((arrival_month = (arrival_date.getUTCMonth() + 1)) < 10) 1100 arrival_month = '0'+arrival_month; 1101 1102 if((arrival_day = (arrival_date.getUTCDate())) < 10) 1103 arrival_day = '0'+arrival_day; 1104 1105 arrival_date_unix = arrival_month + '/' + arrival_date.getUTCDate() + '/' + arrival_date.getUTCFullYear(); 1106 arrival_date = arrival_day + '/' + arrival_month + '/' + arrival_date.getUTCFullYear(); 1107 1108 1109 depart_date = new Date($('.sc-recently-searched-book-cta').attr('departure')*1000); 1110 if((depart_month = (depart_date.getUTCMonth() + 1)) < 10) 1111 depart_month = '0'+depart_month; 1112 1113 if((depart_day = (depart_date.getUTCDate())) < 10) 1114 depart_day = '0'+depart_day; 1115 1116 depart_date_unix = depart_month + '/' + depart_date.getUTCDate() + '/' + depart_date.getUTCFullYear(); 1117 depart_date = depart_day + '/' + depart_month + '/' + depart_date.getUTCFullYear(); 1118 1119 1120 numberNights = ((Date.parse($('.sc-recently-searched-book-cta').attr('departure')) - Date.parse($('.sc-recently-searched-book-cta').attr('arrival'))) / 86400000); 1121 console.log(arrival_date+ ' - ' + depart_date +' numberNights: ' + numberNights) 1122 // Details for postMessage to SuperControl checkout iframe 1123 cartDetails = { 1124 action: "cartOpen", 1125 arrivalDate: arrival_date, 1126 departureDate: depart_date, 1127 capacity: 2, 1128 numberNights: numberNights, 1129 //cottageID: '492675', 1130 cottageID: $('.sc-recently-searched-book-cta').attr('propertycode'), 1131 } 1132 1133 // Call SuperControl checkout with out Cart Details 1134 window.postMessage(cartDetails,'*'); 1135 1136 } 1137 1138 var show_more_button = true; 1139 1140 $('.byron-custom-dropdown-trigger').click(function() { 1141 1142 if(show_more_button) { 1143 show_more_button = false; 1144 $('.byron-custom-dropdown-trigger a').text('Show Less'); 1145 } else { 1146 show_more_button = true; 1147 $('.byron-custom-dropdown-trigger a').text('Show More'); 1148 } 1149 1150 $('.byron-custom-dropdown').slideToggle(); 1151 1152 }); 1153 1154 1155 1156});
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.