1var $html = $('html'); 2 3//Test Device 4window.isMobile = false; 5if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { window.isMobile = true; } 6 7//Detect Mobile 8if (window.isMobile) { $html.addClass('mobile'); } else { $html.addClass('desktop'); } 9 10//Detect Browser 11window.isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1; 12window.isSafari = /^((?!chrome).)*safari/i.test(navigator.userAgent); 13window.isChrome = /chrom(e|ium)/.test(navigator.userAgent.toLowerCase()); 14window.isChromeiOS = navigator.userAgent.match('CriOS'); 15window.isMSIE = navigator.userAgent.match('MSIE'); 16window.isEdge = navigator.userAgent.match('Edge'); 17window.isAndroid = navigator.userAgent.toLowerCase().indexOf("android") > -1; 18window.isiPad = navigator.userAgent.match(/iPad/i) !== null; 19 20//Detect OS 21window.isWindows = navigator.platform.toUpperCase().indexOf('WIN') !== -1; 22window.isOSX = navigator.platform.toUpperCase().indexOf('MAC') !== -1; 23window.isLinux = navigator.platform.toUpperCase().indexOf('LINUX') !== -1; 24 25//Prepare for CSS Fixes 26if (window.isSafari) { $html.addClass('safari'); } 27if (window.isFirefox) { $html.addClass('firefox'); } 28if (window.isChrome) { $html.addClass('chrome'); } 29if (window.isMSIE) { $html.addClass('msie'); } 30if (window.isEdge) { $html.addClass('edge'); } 31if (window.isAndroid) { $html.addClass('android'); } 32if (window.isWindows) { $html.addClass('windows'); } 33if (window.isOSX) { $html.addClass('osx'); } 34if (window.isLinux) { $html.addClass('linux'); } 35 36//Retina 37window.isRetina = ((window.matchMedia && (window.matchMedia('only screen and (min-resolution: 124dpi), only screen and (min-resolution: 1.3dppx), only screen and (min-resolution: 48.8dpcm)').matches || window.matchMedia('only screen and (-webkit-min-device-pixel-ratio: 1.3), only screen and (-o-min-device-pixel-ratio: 2.6/2), only screen and (min--moz-device-pixel-ratio: 1.3), only screen and (min-device-pixel-ratio: 1.3)').matches)) || (window.devicePixelRatio && window.devicePixelRatio > 1.3)); 38 39if (window.isRetina) { $html.addClass('retina'); } 40 41//On DOM ready 42$(document).ready(function () { 43 44 // Init custom scroll 45 46 $('a.scroll-to-div').on('click', function (event) { 47 event.preventDefault(); 48 var secId = $(this).attr("href"); 49 if (window.innerWidth > 650) { 50 $('html, body').animate({ 51 /* scrollTop: ($(secId).offset().top - $(".head-one").height() - 40)*/ 52 scrollTop: ($(secId).offset().top - 144) 53 }, 500); 54 } 55 else { 56 setTimeout(function () { 57 $('html, body').animate({ 58 /* scrollTop: ($(secId).offset().top - 85)*/ 59 scrollTop: ($(secId).offset().top - 135) 60 }, 1000); 61 }, 100); 62 } 63 }); 64 65 // Sticky menu start 66 var headerHeight = $('header').outerHeight(); 67 68 // If window resize, recalculate header height 69 window.onresize = function () { 70 headerHeight = $('header').outerHeight(); 71 }; 72 73 $('.scroll-top').on('click', function (event) { 74 event.preventDefault(); 75 76 // @link https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView 77 document.querySelector('body').scrollIntoView({ behavior: 'smooth', block: 'start' }); 78 }); 79 80 window.onscroll = function (event) { 81 var scroll = window.pageYOffset; 82 83 if (scroll < 100) { 84 $('html').removeClass('sticky-active'); 85 $('body').removeAttr('style'); 86 $('header').attr('class', 'sticky-no'); 87 } else { 88 $('html').addClass('sticky-active'); 89 $('body').css('padding-top', headerHeight); 90 $('header').attr('class', 'sticky-yes'); 91 } 92 93 if (scroll < 100) { 94 $('.scroll-top').removeClass('show'); 95 } else { 96 $('.scroll-top').addClass('show'); 97 } 98 if (scroll < 100) { 99 $('.fixed--iconMenu').removeClass('show'); 100 $('.callNmDiv').hide(); 101 } else { 102 $('.fixed--iconMenu').addClass('show'); 103 } 104 }; 105 106 107 108 /*---------------------------------------------------------------------------- 109 Sidebar 110 -----------------------------------------------------------------------------*/ 111 112 113 $('.sidebarTrigger[data-sidebar-id]').on('click', function () { 114 115 var sidebarID = $(this).data('sidebar-id'); 116 window.showSidebar(sidebarID); 117 });
118 119 window.showSidebar = function (id) { 120 var sidebarID = id, 121 element = $('.sidebar[data-sidebar-id="' + sidebarID + '"]'); 122 hideSidebar(); 123 if (!window.sidebarShown) { 124 if (element.length > 0) { 125 window.sidebarShown = 1; 126 window.allowSlide = 0; 127 $(element).addClass('visible'); 128 $html.addClass('sidebarShown sidebar_' + sidebarID); 129 $(element).find('.sidebarContent').scrollTop(0); 130 $('.modal-backdrop').addClass('show'); 131 // Add "nowScroll" class after 1 second 132 window.nowScrollTimeout = setTimeout(function () { 133 $(element).addClass('nowScroll'); 134 }, 1000); 135 } 136 } else { 137 hideSidebar(); 138 } 139 } 140 141 function hideSidebar() { 142 if (window.sidebarShown) { 143 // Clear the timeout for adding the "nowScroll" class 144 clearTimeout(window.nowScrollTimeout); 145 //setTimeout(function () { 146 // $html.removeClass('sidebarShown').removeClass('popupShown').removeClass('hybridPopupShown').removeClassByPrefix('sidebar_'); 147 //}, 500); 148 $html.removeClass('sidebarShown').removeClass('popupShown').removeClass('hybridPopupShown').removeClassByPrefix('sidebar_'); 149 var $sidebar = $('.sidebar.visible'); 150 $sidebar.removeClass('visible nowScroll'); // Remove "nowScroll" class immediately 151 window.sidebarShown = 0; 152 window.allowSlide = 1; 153 $('.modal-backdrop').removeClass('show'); 154 } 155 } 156 157 //Hide on click outside 158 $(document).on('mouseup touchstart', function (e) { 159 var container = $(".sidebarShown .sidebar, .sidebarTrigger, .xdsoft_datetimepicker, .interventionShown, .showCookie, .autoconverse-widget, .popup-body, .cky-consent-container, .cky-modal, .cky-btn"); 160 if (!container.is(e.target) && container.has(e.target).length === 0) { 161 hideSidebar(); 162 if ($(window).width() > 768) { 163 //var displayValue = $('.advanceSearch, .hybridSearch').css('display'); 164 //if (displayValue === 'block') { 165 // //$('.close').trigger('click'); 166 //} 167 168 var displayValue1 = $('.advanceSearch').css('display'); 169 if (displayValue1 === 'block') 170 $('.advanceSearch .close').trigger('click'); 171 172 var displayValue2 = $('.hybridSearch').css('display'); 173 if (displayValue2 === 'block') 174 $('.hybridSearch .close').trigger('click'); 175 176 } 177 } 178 }); 179 180 //Hide on .close Click 181 $('.sidebar .close, .sidebar [data-sidebar-action="close"]').on('click touchstart', function () { 182 hideSidebar(); 183 }); 184 185 186 /*---------------------------------------------------------------------------- 187 Popup 188 -----------------------------------------------------------------------------*/ 189 function openPopup(popupID) { 190 window.showPopup(popupID); 191 } 192 193 $('.popupTrigger[data-popup-id]').on('click', function () { 194 var popupID = $(this).data('popup-id'); 195 window.showPopup(popupID); 196 }); 197 198 window.showPopup = function (id) { 199 var popupID = id, 200 element = $('.popup[data-popup-id="' + popupID + '"]'); 201 hideSidebar(); 202 /*$('.modal-backdrop').addClass('show');*/ 203 if (element.length > 0) {
204 $(window).trigger('popupShown'); 205 $(element).addClass('visible'); 206 //set a trigger 207 $html.addClass('popupShown popup_' + popupID); 208 $(element).find('.popup-content').scrollTop(0); 209 $('.modal-backdrop').addClass('show'); 210 window.allowSlide = 0; 211 212 //Add Popup ID in the stack 213 if (!window.popupShown) window.popupShown = []; 214 window.popupShown.push(popupID); 215 } 216 } 217 218 function hidePopup() { 219 if ($.isArray(window.popupShown)) { 220 $('.modal-backdrop').removeClass('show'); 221 var lastAddedID = window.popupShown.slice(-1)[0], 222 $element = $('.popup.visible[data-popup-id="' + lastAddedID + '"]'), 223 iframe = $element.find('iframe'), 224 video = $element.find('video'); 225 226 //stop iframe autoplay 227 if (iframe.length > 0) { 228 $(iframe).each(function (n, element) { 229 230 if ($(element).attr('src') != undefined) { 231 var iframeSrc = $(element).attr('src'), 232 symbol = (iframeSrc.indexOf('?autoplay') > -1) ? "?" : "&"; 233 234 $(element).attr('src', $(element).attr('src').replace(symbol + 'autoplay=1', '')); 235 } 236 }); 237 } 238 239 //stop videos 240 if (video.length > 0) { 241 $(video).each(function (n, element) { 242 $(element)[0].pause(); 243 $(element)[0].currentTime = 0; 244 }); 245 } 246 247 //clear element animation on done 248 clearTimeout(window.clearPopupElementAnimation); 249 $element.addClass('hidePopup'); 250 setTimeout(function () { 251 window.allowSlide = 1; 252 253 $element.removeClass('visible hidePopup').removeAttr('style'); 254 $html.removeClass('popup_' + lastAddedID); 255 256 //remove last shown id 257 if ($.isArray(window.popupShown)) { window.popupShown.pop(); } 258 if (window.popupShown.length <= 0) { 259 $html.removeClass('popupShown'); 260 window.popupShown = false; 261 } 262 }, 0); 263 } 264 } 265 266 //Hide on body click 267 $(document).on('mouseup touchstart', function (e) { 268 269 var container = $(".popupShown .popup .popup-content, .popupTrigger, .xdsoft_datetimepicker, .interventionShown, .showCookie, .autoconverse-widget"); 270 if (!container.is(e.target) && container.has(e.target).length === 0 && container.length > 0) { 271 hidePopup(); 272 } 273 }); 274 275 //Hide on .close Click 276 $('.popup .close, .popup [data-popup-action="close"]').on('click', function () { 277 hidePopup(); 278 }); 279 // end on dom ready 280}); 281// end on dom ready 282 283$(document).ready(function () { 284 var Accordion = function (el, multiple) { 285 this.el = el || {}; 286 this.multiple = multiple || false; 287 288 // Variables privadas 289 var links = this.el.find('.hasSubMenu'); 290 // Evento 291 links.on('click', { el: this.el, multiple: this.multiple }, this.dropdown) 292 } 293 294 Accordion.prototype.dropdown = function (e) { 295 var $el = e.data.el; 296 $this = $(this), 297 $next = $this.next(); 298 299 $next.slideToggle(); 300 $this.parent().toggleClass('open'); 301 302 if (!e.data.multiple) { 303 $el.find('.subMenuDrop').not($next).slideUp().parent().removeClass('open'); 304 }; 305 } 306 307 var accordion = new Accordion($('.sidebarMenu'), false); 308 fnAccLoad(); 309}); 310 311function fnNavHideShow(oMenuID) { 312 var subMenu2 = $('.MainMenu' + oMenuID); 313 subMenu2.toggleClass("open"); 314 315 if (subMenu2.hasClass("open")) { 316 subMenu2.find('.subMenuDrop2').slideDown(); 317 } else { 318 subMenu2.find('.subMenuDrop2').slideUp(); 319 } 320} 321 322function fnAccLoad() { 323 $(".accordion-item > .accordion-header:not(.buildMyDealBar .accordion-item > .accordion-header)").on("click", function () { 324 325 if ($(this).hasClass('active')) { 326 $('.accordion-item > .accordion-header:not(.buildMyDealBar .accordion-item > .accordion-header)').removeClass('active'); 327 $('.accordion .accordion-Content:not(.buildMyDealBar .accordion .accordion-Content)').slide
327Up(); 328 } 329 else { 330 var oCurr = $(this); 331 $('.accordion-item > .accordion-header:not(.buildMyDealBar .accordion-item > .accordion-header)').removeClass('active'); 332 $(oCurr).addClass('active'); 333 $(oCurr).siblings(".accordion-Content:not(.buildMyDealBar .accordion-Content)").slideDown(); 334 $('.accordion .accordion-Content:not(.buildMyDealBar .accordion .accordion-Content)').not($(oCurr).siblings(".accordion-Content:not(.buildMyDealBar .accordion-Content)")).slideUp(); 335 } 336 }); 337} 338/*[Shared > _LikeTo.cshtml] */ 339 340function fnShort(ourl) { 341 alert(ourl); 342} 343$(document).ready(function () { 344 $('.sortBy.likeToPos a').click(function (e) { 345 346 e.preventDefault(); 347 e.stopPropagation(); 348 349 var href = $(this).attr('href'); 350 351 if (href != "") 352 window.location.href = href; 353 }); 354 355 $('.likeToPos').click(function (e) { 356 357 e.preventDefault(); 358 e.stopPropagation(); 359 $(this).toggleClass('expanded'); 360 $('#' + $(e.target).attr('for')).prop('checked', true); 361 362 var href = $('#' + $(e.target).attr('href')); 363 364 }); 365}); 366 367$(document).on('click', function (e) { 368 if ($(e.target).closest(".likeToPos").length === 0) { 369 $(".likeToPos").removeClass('expanded'); 370 } 371}); 372 373 374//$(document).ready(function () { 375// if ($(window).width() > 1024) { 376// $(".usedCarDetail .likeToPos").click(function () { 377// var upprDivheight = $(".moDetailcontent").height() + 15; // Add 10px offset 378// if ($(".carDetailcontent").scrollTop() !== upprDivheight) { 379// $(".carDetailcontent").animate({ scrollTop: upprDivheight }, "slow"); 380// } else { 381// $(".carDetailcontent").animate({ scrollTop: 0 }, "slow"); 382// } 383// }); 384// $(document).click(function (event) { 385// if (!$(event.target).closest('.usedCarDetail .likeToPos').length) { 386// $(".carDetailcontent").animate({ scrollTop: 0 }, "slow"); 387// } 388// }); 389// } 390//}); 391 392$(document).ready(function () { 393 $(".scrollUp").on("click", function () { 394 var headerHeight = $('.head-one').height(); 395 var scrollToPosition = $(this).offset().top - headerHeight - 220; 396 $('html, body').animate({ scrollTop: scrollToPosition }, 500); 397 }); 398}); 399 400 401$(document).ready(function () { 402 if ($(window).width() > 1024) { 403 $(".usedCarDetail .likeToPos").click(function () { 404 var oBoxHehight = $('.moDetailcontent').height(); 405 var oBoxBGHehight = $('.maxContent').height(); 406 if ($(this).hasClass('expanded')) { 407 $('.maxContent').css({ 408 'transform': 'translateY(-' + oBoxHehight + 'px)' 409 }); 410 $('.maxContent').height(oBoxBGHehight + 0); 411 } else { 412 $('.maxContent').height(oBoxBGHehight - 0); 413 $('.maxContent').css({ 414 'transform': '' 415 }); 416 } 417 if ($('body').hasClass('footer-shown')) { 418 var oBoxWholeHeight = $('.carDetailcontent').height(); 419 $('html, body').animate({ scrollTop: $(window).scrollTop() - oBoxWholeHeight + 0 }, 500); 420 } 421 }); 422 423 $(document).click(function (event) { 424 // Check if clicked element is outside of ".usedCarDetail" or ".usedCarDetail .likeToPos" does not have class "expanded" 425 if (!$(event.target).closest('.usedCarDetail').length || !$('.usedCarDetail .likeToPos').hasClass('expanded')) { 426 // Remove CSS on ".maxContent" 427 $('.maxContent').css({ 428 'transform': '' 429 }); 430 } 431 }); 432 } 433}); 434 435 436$(document).ready(function () { 437 if ($(window).width() < 1023) { 438 $(".usedCarDetail .likeToPos:not(.expanded)").on("click", function () { 439 var trustHeight = $('.header-trustpilot').height(); 440 var headerHeight = $('.head-one').height(); 441 var scrollToPosition = $(this).offset().top - trustHeight - headerHeight - 15; 442 $('html, body').animate({ scrollTop: scrollToPosition }, 500); 443 }); 444 445 $(".ucVehicleBanner .likeToPos:not(.expanded)").on("click", function () { 446 var trustHeight = $('.header-trustpilot').height(); 447 var headerHeight = $('.head-one').height(); 448 var scrollToPosition = $(this).offset().top - trustHeight - headerHeight - 80; 449 $('html, body').animate({ scrollTop: scrollToPosition }, 500); 450 }); 451 } 452}); 453 454function checkPositionAndAddClass() { 455 var element = document.querySelector('.ucSearch .panel-body > .container .spure_select'); // Select the spure_select element 456 if (element) { 457 var rect = element.getBoundingClientRect(); 458 var windowHeight = (window.innerHeight || document.documentElement.clientHeight); 459 460 if (rect.bottom >
460 windowHeight - 50) { // Adjust the 50px threshold as needed 461 element.classList.add('upwards'); 462 } else { 463 element.classList.remove('upwards'); 464 } 465 } 466} 467 468// Run the function when the page loads and when the window is resized or scrolled 469window.addEventListener('load', checkPositionAndAddClass); 470window.addEventListener('resize', checkPositionAndAddClass); 471window.addEventListener('scroll', checkPositionAndAddClass); 472 473 474$(document).ready(function () { 475 if ($(window).width() > 767) { 476 /*-- Hybrid Multi Link*/ 477 $(".HomePage .e_search .hybrid-adv-link").click(function () { 478 $(".hybridSearch").slideDown(); 479 }); 480 $(".HomePage .sidebar .close").click(function () { 481 $(".hybridSearch").slideUp(); 482 }); 483 } 484}); 485 486/*Moved from Layout*/ 487 488/*[Shared > _Header.cshtml][slick - slider.js] */ 489 490if (!window.location.href.includes("preview?")) { 491 $(document).ready(function () { 492 // init Isotope 493 var slickoptions = { 494 rows: 2, 495 dots: false, 496 appendDots: $('.locationsBar .slick-nav'), 497 appendArrows: $('.locationsBar .slick-nav'), 498 accessibility: true, 499 speed: 800, 500 slidesToShow: 4, 501 slidesToScroll: 4, 502 infinite: false, 503 responsive: [ 504 { 505 breakpoint: 1199, 506 settings: { 507 slidesToScroll: 3, 508 slidesToShow: 3, 509 } 510 }, 511 { 512 breakpoint: 1023, 513 settings: { 514 slidesToScroll: 2, 515 slidesToShow: 2, 516 } 517 }, 518 { 519 breakpoint: 767, 520 settings: { 521 slidesPerRow: 1, 522 slidesToScroll: 1, 523 slidesToShow: 1, 524 } 525 } 526 ] 527 } 528 529 530 // Initialize the slider with updated slickoptions 531 $('.location-slider').slick(slickoptions); 532 533 // Check if there are fewer than 4 locations 534 var numLocations = $('.location-slider .slick-slide').length; 535 if (numLocations < 4) { 536 slickoptions.rows = 1; 537 $('.location-slider').slick('unslick').slick(slickoptions); 538 } 539 540 541 var slider = $('.location-slider'); 542 var allSlides = $('.location-slider .slick-slide > div > *').clone(); 543 var trigger = $('loc-filter'); 544 545 546 var ClassFilter = function (object, item) { 547 this.object = object; 548 this.item = item; 549 550 this.filterFunc = function () { 551 $('.locationsBar .tab-link').removeClass('resp-tab-active'); 552 $('.locationsBar .loc-filter[data-filter="' + this.item + '"]').addClass('resp-tab-active'); 553 var filterSlides = allSlides.filter(this.item); 554 555 slider.css({ "opacity": "0", "left": "50px" }); 556 setTimeout( 557 function () { 558 slider 559 .slick('unslick') 560 .empty() 561 .append(filterSlides) 562 .slick(slickoptions) 563 .css({ "opacity": "100", "left": "0px" }) 564 }, 600); 565 } 566 } 567 568 jQuery('.locationsBar .loc-filter').on('click', function (e) { 569 var attr = jQuery(this).attr('data-filter') 570 var newFilter = new ClassFilter(this, attr); 571 newFilter.filterFunc(); 572 }); 573 }); 574} 575 576 577/*[Shared > _SideNav.cshtml][swiper - bundle.min.js] */ 578$(document).ready(function () { 579 var swiper = new Swiper(".navOfferSlider .swiper", { 580 speed: 800, 581 navigation: { 582 nextEl: ".navOfferSlider .swiper-button-next", 583 prevEl: ".navOfferSlider .swiper-button-prev", 584 }, 585 });
586}); 587 588/*[Shared > _Footer.cshtml] */ 589 590$(document).ready(function () { 591 $(".footer-top h4").on("click", function () { 592 if ($(this).hasClass('active')) { 593 $('.footer-top h4').removeClass('active'); 594 $('.footer-top .list').slideUp(); 595 } 596 else { 597 var oCurr = $(this); 598 $('.footer-top h4').removeClass('active'); 599 $(oCurr).addClass('active'); 600 $(oCurr).siblings(".footer-top .list").slideDown(); 601 $('.footer-top .list').not($(oCurr).siblings(".footer-top .list")).slideUp(); 602 } 603 }); 604 605 $(".numeric").bind("paste", function (e) { 606 e.preventDefault(); 607 }); 608}); 609$(document).on("input", ".numeric", function () { 610 this.value = this.value.replace(/\D/g, ''); 611}); 612 613 614/*[Elements > Banner.cshtml][swiper - bundle.min.js] */ 615$(document).ready(function () { 616 var swiper = new Swiper(".e_bannerslider:not(.col-4) .ucBannerSlider .swiper", { 617 speed: 800, 618 pagination: { 619 el: ".e_bannerslider:not(.col-4) .swiper-pagination", 620 clickable: true, 621 }, 622 autoplay: { 623 delay: 3000, 624 } 625 }); 626 627 var swiper = new Swiper(".e_bannerslider.col-4 .ucBannerSlider .swiper", { 628 effect: 'fade', 629 grabCursor: true, 630 speed: 800, 631 pagination: { 632 el: ".e_bannerslider.col-4 .swiper-pagination", 633 clickable: true, 634 }, 635 autoplay: { 636 delay: 3000, 637 disableOnInteraction: false, 638 }, 639 }); 640}); 641 642/*[UsedCar > _UsedCar.cshtml][swiper - bundle.min.js] */ 643/*[Elements > AllVehicle.cshtml] */ 644$(document).ready(function () { 645 var swiper = new Swiper(".rptCarBlock .swiper", { 646 loop: false, 647 speed: 800, 648 navigation: { 649 nextEl: ".rptCarBlock .swiper-button-next", 650 prevEl: ".rptCarBlock .swiper-button-prev", 651 }, 652 pagination: { 653 el: ".rptCarBlock .swiper-pagination", 654 clickable: true, 655 }, 656 }); 657 658}); 659/*[UsedCar > _UsedCar.cshtml][easy - responsive - tabs.js] */ 660 661$(document).ready(function () { 662 setTimeout(function () { 663 $('.carFinance').easyResponsiveTabs({ 664 type: 'default', //Types: default, vertical, accordion 665 width: 'auto', //auto or any width like 600px 666 fit: true, // 100% fit in a container 667 closed: 'accordion', // Start closed if in accordion view 668 activate: function (event) { // Callback function if tab is switched 669 var $tab = $(this); 670 var $info = $('#tabInfo'); 671 var $name = $('span', $info); 672 $name.text($tab.text()); 673 $info.show(); 674 } 675 }); 676 }, 500); 677 678 // Check hash part of the URL and activate corresponding tab 679 var hash = window.location.hash; 680 if (hash) { 681 $('.tabs a[href="' + hash + '"]').trigger('click'); 682 } 683 684 // Update hash part of the URL when tab is clicked 685 $('.tabs a').on('click', function () { 686 var hash = $(this).attr('href'); 687 history.replaceState(null, null, hash); 688 }); 689}); 690 691 692/*[Elements > NewVehicle.cshtml][owl.carousel.min.js] */ 693 694$(document).ready(function () { 695 var carouselDefaultConfiguration = { 696 lazyLoad: true, 697 items: 1, 698 dots: false, 699 nav: true, 700 autoHeight: true, 701 autoplay: false, 702 autoplayHoverPause: true, 703 smartSpeed: 1000, 704 margin: 20, 705 //autoplayTimeout: 2000, 706 navText: ["<i class='icon-chevron-left-small'></i>", "<i class='icon-chevron-right-small'></i>"], 707 items: 6, 708 responsive: { 709 0: { 710 items: 1, 711 margin: 15, 712 }, 713 767: { 714 items: 2, 715 margin: 15, 716 }, 717 1020: { 718 items: 3, 719 margin: 15, 720 }, 721 1190: { 722 items: 3, 723 }, 724 } 725 }; 726 if ($('.ucNewVehicle .carousel')) { 727 $('.ucNewVehicle .carousel').each(function () { 728 if ($(this).attr('data-options') !== undefined) { 729 $(this).owlCarousel($.extend(carouselDefaultConfiguration, $(this).data('options'))); 730 } else { 731 $(this).owlCarousel(carouselDefaultConfiguration); 732 } 733 }); 734 } 735});
736//function init() { 737// var imgAll = document.getElementsByTagName('img'); 738// for (var i = 0; i < imgAll.length; i++) { 739// //imgAll[i].setAttribute('width', "auto"); 740// //imgAll[i].setAttribute('height', "auto"); 741// } 742//} 743//window.onload = init; 744 745 746/*[Elements > AllVehicle.cshtml][owl.carousel.min.js] */ 747 748$(document).ready(function () { 749 var carouselDefaultConfiguration = { 750 margin: 14, 751 nav: true, 752 dots: false, 753 smartSpeed: 1000, 754 navText: ["<i class='icon-chevron-thin-left'></i>", "<i class='icon-chevron-thin-right'></i>"], 755 items: 4, 756 responsive: { 757 0: { 758 items: 1 759 }, 760 767: { 761 items: 3 762 }, 763 1020: { 764 items: 4, 765 }, 766 } 767 }; 768 if ($('.ucNewMatchingStock .carousel')) { 769 $('.ucNewMatchingStock .carousel').each(function () { 770 if ($(this).attr('data-options') !== undefined) { 771 $(this).owlCarousel($.extend(carouselDefaultConfiguration, $(this).data('options'))); 772 } else { 773 $(this).owlCarousel(carouselDefaultConfiguration); 774 } 775 }); 776 } 777 778}); 779 780/*[Elements > Tabs.cshtml][easy - responsive - tabs.js]*/ 781 782$(document).ready(function () { 783 $('.elementTabs').easyResponsiveTabs({ 784 type: 'default', //Types: default, vertical, accordion 785 width: 'auto', //auto or any width like 600px 786 fit: true, // 100% fit in a container 787 closed: 'accordion', // Start closed if in accordion view 788 activate: function (event) { // Callback function if tab is switched 789 var $tab = $(this); 790 var $info = $('#tabInfo'); 791 var $name = $('span', $info); 792 $name.text($tab.text()); 793 $info.show(); 794 } 795 }); 796}); 797 798$(document).ready(function () { 799 function showMoreText(divID, lnkID) { 800 $("#" + divID).show(500); 801 $("#" + lnkID).hide(200); 802 803 setTimeout(function () { fnPackeryInit(); }, 500); 804 } 805 806 function hideMoreText(divID, lnkID) { 807 $("#" + lnkID).show(500); 808 $("#" + divID).hide(500); 809 810 setTimeout(function () { fnPackeryInit(); }, 500); 811 } 812}); 813 814/*[Elements > UsedVehicleTab.cshtml][easy - responsive - tabs.js] */ 815 816$(document).ready(function () { 817 $('.mostSearchTabs').easyResponsiveTabs({ 818 type: 'default', //Types: default, vertical, accordion 819 width: 'auto', //auto or any width like 600px 820 fit: true, // 100% fit in a container 821 closed: 'accordion', // Start closed if in accordion view 822 activate: function (event) { // Callback function if tab is switched 823 var $tab = $(this); 824 var $info = $('#tabInfo'); 825 var $name = $('span', $info); 826 $name.text($tab.text()); 827 $info.show(); 828 } 829 }); 830}); 831 832 833/*[Elements > UsedVehicleTab.cshtml][owl.carousel.min.js] */ 834 835$(document).ready(function () { 836 $('.mostSearchSlider .carousel').owlCarousel({ 837 items: 4, 838 nav: true, 839 dots: false, 840 navText: ["<i class='icon-chevron-thin-left'></i>", "<i class='icon-chevron-thin-right'></i>"], 841 smartSpeed: 500, 842 touchDrag: true, 843 mouseDrag: true, 844 responsive: { 845 0: { 846 items: 1, 847 center: true, 848 loop: true, 849 stagePadding: 50, 850 margin: 10, 851 smartSpeed: 300, 852 //autoWidth:true, 853 }, 854 767: { 855 items: 3 856 }, 857 1365: { 858 items: 4, 859 }, 860 } 861 }); 862}); 863 864 865/*[Elements > ModelSlider.cshtml][easy - responsive - tabs.js] */ 866 867$(document).ready(function () { 868 $('.ucModelSlider').easyResponsiveTabs({ 869 type: 'default', //Types: default, vertical, accordion 870 width: 'auto', //auto or any width like 600px 871 fit: true, // 100% fit in a container 872 closed: 'accordion', // Start closed if in accordion view 873 activate: function (event) { // Callback function if tab is switched 874 var $tab = $(this); 875 var $info = $('#tabInfo');
876 var $name = $('span', $info); 877 $name.text($tab.text()); 878 $info.show(); 879 } 880 }); 881}); 882 883 884/*[Elements > ModelSlider.cshtml][owl.carousel.min.js] */ 885 886$(document).ready(function () { 887 $('.ucModelSlider .carousel').owlCarousel({ 888 items: 4, 889 nav: true, 890 dots: false, 891 navText: ["<i class='icon-chevron-thin-left'></i>", "<i class='icon-chevron-thin-right'></i>"], 892 smartSpeed: 500, 893 touchDrag: true, 894 mouseDrag: true, 895 responsive: { 896 0: { 897 items: 1, 898 center: true, 899 loop: true, 900 stagePadding: 50, 901 margin: 10, 902 smartSpeed: 300, 903 //autoWidth:true, 904 }, 905 767: { 906 items: 3 907 }, 908 1365: { 909 items: 4, 910 }, 911 } 912 }); 913}); 914 915 916/*[Elements > Offer.cshtml][owl.carousel.min.js] */ 917 918$(document).ready(function () { 919 var carouselDefaultConfiguration = { 920 //margin: 14, 921 nav: true, 922 dots: false, 923 smartSpeed: 1000, 924 navText: ["<i class='icon-chevron-thin-left'></i>", "<i class='icon-chevron-thin-right'></i>"], 925 items: 3, 926 autoplay: true, 927 autoplayTimeout: 5000, 928 loop: true, 929 responsive: { 930 0: { 931 items: 1 932 }, 933 767: { 934 items: 3 935 }, 936 1020: { 937 items: 3, 938 }, 939 } 940 }; 941 if ($('.ucSpecialOffer .carousel')) { 942 $('.ucSpecialOffer .carousel').each(function () { 943 if ($(this).attr('data-options') !== undefined) { 944 $(this).owlCarousel($.extend(carouselDefaultConfiguration, $(this).data('options'))); 945 } else { 946 $(this).owlCarousel(carouselDefaultConfiguration); 947 } 948 }); 949 } 950 951}); 952 953 954/*[Elements > Offer.cshtml][easy - responsive - tabs.js] */ 955 956$(document).ready(function () { 957 $('.ucNewVehicleTab').easyResponsiveTabs({ 958 type: 'default', //Types: default, vertical, accordion 959 width: 'auto', //auto or any width like 600px 960 fit: true, // 100% fit in a container 961 closed: 'accordion', // Start closed if in accordion view 962 activate: function (event) { // Callback function if tab is switched 963 var $tab = $(this); 964 var $info = $('#tabInfo'); 965 var $name = $('span', $info); 966 $name.text($tab.text()); 967 $info.show(); 968 } 969 }); 970}); 971 972 973/*[Elements > NewVehicleTab.cshtml[owl.carousel.min.js]*/ 974 975$(document).ready(function () { 976 var carouselDefaultConfiguration = { 977 margin: 14, 978 nav: true, 979 dots: false, 980 smartSpeed: 1000, 981 navText: ["<i class='icon-chevron-thin-left'></i>", "<i class='icon-chevron-thin-right'></i>"], 982 items: 3, 983 responsive: { 984 0: { 985 items: 2 986 }, 987 767: { 988 items: 3 989 }, 990 1020: { 991 items: 3, 992 }, 993 } 994 }; 995 if ($('.ucNewVehicleTab .carousel')) { 996 $('.ucNewVehicleTab .carousel').each(function () { 997 if ($(this).attr('data-options') !== undefined) { 998 $(this).owlCarousel($.extend(carouselDefaultConfiguration, $(this).data('options'))); 999 } else { 1000 $(this).owlCarousel(carouselDefaultConfiguration); 1001 } 1002 }); 1003 } 1004 1005}); 1006 1007 1008/*[Elements > AllVehicle.cshtml[owl.carousel.min.js]*/ 1009 1010$(document).ready(function () { 1011 var carouselDefaultConfiguration = { 1012 lazyLoad: true, 1013 items: 1, 1014 dots: false, 1015 nav: true, 1016 autoHeight: true, 1017 autoplay: false, 1018 autoplayHoverPause: true, 1019 smartSpeed: 1000, 1020 margin: 20, 1021 //autoplayTimeout: 2000, 1022 navText: ["<i class='icon-chevron-left-small'></i>", "<i class='icon-chevron-right-small'></i>"], 1023 items: 4, 1024 responsive: { 1025 0: { 1026 items: 2 1027 }, 1028 767: { 1029 items: 3 1030 }, 1031 1020: { 1032 items: 4, 1033 }, 1034 } 1035 }; 1036 if ($('.ucAllVehicle .carousel')) { 1037 $('.ucAllVehicle .carousel').each(function () { 1038 if ($(this).attr('data-options') !== undefined) { 1039 $(this).owlCarousel($.extend(carouselDefaultConfiguration, $(this).data('options'))); 1040 } else { 1041 $(this).owlCarousel(carouselDefaultConfiguration); 1042 } 1043 }); 1044 } 1045}); 1046 1047 1048/*[Elements > AIBlock.cshtml --script AI Block full box link*/ 1049 1050$(document).ready(function () { 1051 // Function to adjust padding on page load 1052 function adjustPadding() { 1053 $('.ucAiBlock.fullBoxLink').each(function () { 1054 var buttonHeight = $(this).find('.link-button').outerHeight(); 1055 $(this).find('.button-wrap').css('padding-top', buttonHeight); 1056 }); 1057 } 1058 1059 // Call the function on page load 1060 adjustPadding(); 1061 1062 // Call the function on window resize 1063 $(window).resize(function () { 1064 adjustPadding(); 1065 });
1066}); 1067 1068$(document).ready(function () { 1069 setTimeout(() => { fnLoadBgDeferImg(); }, 10); 1070 setTimeout(() => { fnLoadDeferImg(); }, 20) 1071 setTimeout(() => { fnLoadVideo(); }, 30); 1072}); 1073 1074function fnLoadDeferImg() { 1075 var imgDefer = document.getElementsByClassName('defer-img'); 1076 for (var i = 0; i < imgDefer.length; i++) { 1077 if (imgDefer[i].getAttribute('data-src')) { 1078 imgDefer[i].setAttribute('src', imgDefer[i].getAttribute('data-src')); 1079 } 1080 } 1081} 1082 1083function fnLoadBgDeferImg() { 1084 var imgBgDefer = document.getElementsByClassName('defer-img-bg'); 1085 for (var i = 0; i < imgBgDefer.length; i++) { 1086 if (imgBgDefer[i].getAttribute('data-bgsrc')) { 1087 imgBgDefer[i].style.backgroundImage = "url(" + imgBgDefer[i].getAttribute('data-bgsrc') + ")"; 1088 } 1089 } 1090} 1091 1092function fnLoadVideo() { 1093 $("video.defer-video source").each(function () { 1094 $(this).attr("src", $(this).attr("data-src")); 1095 var video = this.parentElement; 1096 video.load(); 1097 $(this).parents("video").attr("poster", $(this).parents("video").attr("data-poster")); 1098 if ($(this).parents("video").hasClass("vid-autoplay")) 1099 video.play(); 1100 }); 1101} 1102 1103/*[Equal Height Match] */ 1104function fnAdjustHeight(sElement) { 1105 if ($(sElement).length) { 1106 $(sElement).css('height', 'auto'); 1107 var highestBox = 0; 1108 $(sElement).each(function () { 1109 if ($(this).height() > highestBox) 1110 highestBox = Math.round($(this).height()); 1111 }); 1112 $(sElement).css('height', highestBox); 1113 } 1114} 1115function fnAutoAdjust() { 1116 fnAdjustHeight('.dealerRpt .element-heading'); 1117 fnAdjustHeight('.dealerRpt .element-address'); 1118 fnAdjustHeight('.rptAlsoCarBlock .element-thumb'); 1119 fnAdjustHeight('.rptAlsoCarBlock .element-heading'); 1120 fnAdjustHeight('.rptAlsoCarBlock .element-subHeading'); 1121 fnAdjustHeight('.rptAlsoCarBlock .element-PCP'); 1122 fnAdjustHeight('.modelDetail .row_3_3_3_3 .e_imagewithtext .element-heading'); 1123 fnAdjustHeight('.newsRpt .element-heading'); 1124 fnAdjustHeight('.newsRpt .element-description'); 1125 fnAdjustHeight('.offerLeasingRpt .element-subHeading'); 1126 fnAdjustHeight('.galleryRpt .element-thumb'); 1127 fnAdjustHeight('.leasing-height'); 1128 fnAdjustHeight('.ucPromoBlock .element-heading'); 1129 fnAdjustHeight('.ucPromoBlock .element-description'); 1130 fnAdjustHeight('.ucPromoBlock .button-wrap'); 1131 fnAdjustHeight('.ucAllVehicle .row .newVehicleLinkRpt .element-thumb'); 1132 fnAdjustHeight('.ucAllVehicle .carousel .newVehicleLinkRpt .element-thumb'); 1133 fnAdjustHeight('.locationName'); 1134 fnAdjustHeight('.locationAddress p'); 1135 fnAdjustHeight('.e_imagewithtext .element-heading'); 1136 fnAdjustHeight('.e_imagewithtext .element-description'); 1137 fnAdjustHeight('.offerModelListRpt .element-textwrap'); 1138 fnAdjustHeight('.offers-model-list .offerModelListRpt .element-thumb'); 1139 fnAdjustHeight('.ucSpecialOffer.gridView .offerModelListRpt .element-thumb'); 1140 fnAdjustHeight('.ucSpecialOffer.sliderView .offerModelListRpt .element-thumb'); 1141 fnAdjustHeight('.ucSpecialOffer.gridView .offerModelListRpt .element-description'); 1142 fnAdjustHeight('.ucSpecialOffer.sliderView .offerModelListRpt .element-description'); 1143 fnAdjustHeight('.rptReducedBlock .element-subHeading'); 1144 fnAdjustHeight('.modelListRpt .element-thumb'); 1145 fnAdjustHeight('.modelListRpt .element-heading'); 1146 fnAdjustHeight('.splOfferTopbar .offrBnrImg'); 1147 fnAdjustHeight('.splOfferTopbar .element-offers'); 1148 fnAdjustHeight('.rptCarBlock .pillWrap'); 1149 fnAdjustHeight('.modelListRpt .element-range h2'); 1150 fnAdjustHeight('.rptCarBlock.OFFER .element-offerList'); 1151} 1152 1153$(window).resize(function () { 1154 setTimeout(function () { fnAutoAdjust(); }, 1000); 1155}); 1156$(document).ready(function () { 1157 setTimeout(function () { fnAutoAdjust(); }, 1000); 1158}); 1159 1160//ANCHOR SCROLLING / HASH-BASED NAVIGATION 1161window.addEventListener("load", function () { 1162 1163 if (!window.location.hash) return; 1164 1165 var target = document.querySelector(window.location.hash); 1166 1167 if (!target) { 1168 target = document.querySelector('.' + hash); 1169 } 1170 1171 if (!target) return; 1172 1173 var offset = 0; 1174 1175 // trustpilot header 1176 var trustPilotHeader = document.querySelector('.header-trustpilot'); 1177 if (trustPilotHeader) offset += trustPilotHeader.offsetHeight; 1178 1179 // main header 1180 var header = document.querySelector('.head-one'); 1181 if (header) offset += header.offsetHeight; 1182 1183 // mobile fixed icon menu 1184 var mobileMenu = document.querySelector('.fixed-iconMenu.show'); 1185 if (mobileMenu) offset += mobileMenu.offsetHeight; 1186 1187 var targetPosition = 1188 target.getBoundingClientRect().top + window.pageYOffset; 1189 1190 window.scrollTo({ 1191 top: targetPosition - offset - 10, 1192 behavior: 'smooth' 1193 });
vendor: 3 bytes, line 1194
1194});
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.