Skip to main content
Close Search
Models
Models
Barletta Reserve Exclusive Luxury Explore Build
Barletta Reserve Leggera Ultimate Luxury Explore Build
Barletta Lusso Premium Luxury Explore Build
Barletta Corsa Sport Luxury Explore Build
Barletta Cabrio Affordable Luxury Explore Build
Barletta Aria Introduction to Luxury Explore Build
Discover Barletta
Discover Barletta
Compare Series
Photo Gallery
Craftsmanship
Performance
Barletta DNA
Pet Friendly
Reviews
Warranty
Request a Brochure
Events
Build Your Barletta
About Us
About Us
Meet the Team
Careers
Our Story
Contact Us
Tour Our Factory
My Barletta
Learning Center
Find a Dealer
"); } else if ($("body").find(".body-container-wrapper .page-center")) { $("body").find(".body-container-wrapper .page-center:eq(0)").prepend("
"); } else { $("body").addClass("header--static"); } } var thisHeader = $("body").find("header"); var thisHeaderBody = thisHeader.find(".header--body"); var thisHeaderAnchor = $("body").find(".header--anchor:eq(0)"); var thisOffsetBackground = $('body').find('.section:eq(0) .background .background--layer.background--layer--offset ~ .background--layer'); if (!$("body").hasClass("header--hello--transitioning")) { thisHeaderAnchor.css({ "height":( thisHeaderBody.height() + ($("body").hasClass("header--hello--visible") ? $("body").find(".header--hello--body").height() : 0 ) ) + "px" }); thisOffsetBackground.css({ "marginTop":( thisHeaderBody.height() + ($("body").hasClass("header--hello--visible") ? $("body").find(".header--hello--body").height() : 0 ) + 20) + "px" }); } } function vanillaSizeAnchor() { var $anchor = document.querySelector('.header--anchor'); var $section = document.querySelector('.body-container-wrapper .section'); var $pageCenter = document.querySelector('.body-container-wrapper .page-center'); if ( ! $anchor ) { if ( $section ) { $section.insertAdjacentHTML('afterbegin', '
'); }else if ( $pageCenter ) { $pageCenter.insertAdjacentHTML('afterbegin', '
'); } else { document.body.classList.add('header--static'); } } var thisHeader = document.querySelector('header'); var thisHeaderBody = thisHeader.querySelector('.header--body'); var thisHeaderAnchor = document.querySelector('.header--anchor'); var thisOffsetBackground = $section ? $section.querySelector('.background .background--layer.background--layer--offset ~ .background--layer') : false; if ( ! document.body.classList.contains('header--hello--transitioning') && ( null !== typeof thisHeaderAnchor ) && ( 'undefined' !== typeof thisHeaderAnchor ) && thisHeaderAnchor ) { thisHeaderAnchor.style.height = ( thisHeaderBody.offsetHeight + (document.body.classList.contains('header--hello--visible') ? document.body.querySelector('.header--hello--body').offsetHeight : 0 ) ) + "px"; if ( thisOffsetBackground ) { thisOffsetBackground.style.marginTop = ( thisHeaderBody.offsetHeight + (document.body.classList.contains('header--hello--visible') ? document.body.querySelector('.header--hello--body').offsetHeight : 0 ) + 20) + "px"; } } } function hideSubMenusOnScroll() { var menuItems = $('.header--main--nav--item.active'); if ( menuItems.length > -1 ) { menuItems.each(function(){ $(this).removeClass('active'); }); } } document.addEventListener("DOMContentLoaded", function() { vanillaSizeAnchor(); $(document).find('.header--main--nav--item').on('mouseenter',function(){ $(this).siblings().removeClass('active'); $(this).addClass('active'); }); $(document).find('.header--main--nav--item').on('mouseleave',function(){ $(this).removeClass('active'); }); }); lastScrollDist = 0; helloBarTransition = false; function sizeHeader() { if (!$("body").hasClass("header--static")) { scrollDist = $(window).scrollTop(); thisHeader = $("body").find("header"); thisHeaderBody = thisHeader.find(".header--body"); $('header').addClass("header--initialized"); scrollDistOffset = 0; if ($("body").hasClass("header--hello--visible")) { scrollDistOffset += $("body").find(".header--hello").height(); } scrollDistRecalculated = scrollDist - ($("body").hasClass("header--hello--visible")?$("body").find(".header--hello--body").height():0); scrollDirection = "neutral"; if (scrollDistRecalculated < lastScrollDist) { scrollDirection = "up"; } else if (scrollDistRecalculated > lastScrollDist) { scrollDirection = "down"; } lastScrollDist = scrollDistRecalculated; stickyStart = 0; if ($("body").hasClass("header--hello--visible")&&(!$("body").hasClass("header--hello--closed"))) { stickyStart += $("body").find(".header--hello").height(); } stickyStart += thisHeaderBody.height(); if ((scrollDist > 0)&&(helloBarTransition != true)&&((!$("body").hasClass("mobilenav--active"))||(document.documentElement.clientWidth >= 1024))) { $('header').addClass("header--fixed"); $('header').removeClass("header--notfixed"); if (scrollDist >= stickyStart) { $('header').removeClass("header--isanchored"); $('header').addClass("header--issticky"); if (scrollDirection == "up") { $('header').removeClass("header--hidden"); $('header').addClass("header--visible"); thisHeader.css({ "top":"" }); } else if (scrollDirection == "down") { $('header').addClass("header--hidden"); $('header').removeClass("header--visible"); thisHeader.css({ "top":(-1 * stickyStart)+"px" }); } } else { $('header').removeClass("header--hidden"); $('header').addClass("header--visible"); thisHeader.css({ "top":"" }); } } else { $('header').addClass("header--isanchored"); $('header').removeClass("header--issticky"); $('header').addClass("header--notfixed"); $('header').removeClass("header--fixed header--hidden"); $('header').addClass("header--visible"); thisHeader.css({ "top":"" }); } } if (typeof(sizeSubmenu) == "function") { sizeSubmenu(); } } function sizeMobilenav() { if ($("body").hasClass("mobilenav--active")) { if ($("body").hasClass("header--static")) { $(window).scrollTop(0); } $("body").find(".mobilenav--cta--spacer").css({ "height":"" }); headerHeight = $("body").find("header .header--body").height(); windowHeight = window.innerHeight; minHeight = windowHeight - headerHeight; $("body").find(".mobilenav").css({ "height":(minHeight)+"px" }); $("body").find(".mobilenav--panel").each(function () { if ($(this).find(".mobilenav--cta--spacer").length > 0) { panelBodyHeight = $(this).find(".mobilenav--panel--body").height(); panelCtaHeight = $(this).find(".mobilenav--cta--wrapper").outerHeight(); if (panelBodyHeight + panelCtaHeight + 21 < minHeight) { $(this).find(".mobilenav--cta--spacer").css({ "height":(minHeight - (panelBodyHeight + panelCtaHeight + 21))+"px" }); } } }); } else { $("body").find(".mobilenav, .mobilenav--cta--spacer").css({ "height":"0px" }); } } $("body").find(".header--main--menutrigger").click(function () { if ($("body").hasClass("mobilenav--active")) { $("body").removeClass("mobilenav--active"); $('.header--main--menutrigger--icon--v2').removeClass('open'); sizeMobilenav(); } else { $("body").find(".mobilenav--nav").addClass("no--transition"); $("body").find(".mobilenav--nav")[0].offsetHeight; $("body").find(".mobilenav--nav").css({ "left":"" }); $("body").find(".mobilenav--panel").removeClass("mobilenav--panel--active"); $("body").find(".mobilenav--nav")[0].offsetHeight; $("body").find(".mobilenav--nav").removeClass("no--transition"); $("body").addClass("mobilenav--active"); $('.header--main--menutrigger--icon--v2').addClass('open'); sizeMobilenav(); } }); $("body").find(".header--main--nav .hs-menu-wrapper li.hs-item-has-children").hover(function () { thisChild = $(this).find(">ul"); thisChild.css({ "margin-left":"" }); windowWidth = $(window).width(); childOffset = thisChild.offset().left; childWidth = thisChild.width(); childOverlap = windowWidth - (childOffset + childWidth); if (childOverlap < 0) { thisChild.css({ "margin-left":(childOverlap)+"px" }); } }); $("body").find(".header--main--search--trigger").click(function () { if ($("body").find(".header--main--search").hasClass("active")) { headerSearch(); } else { $("body").find(".header--main--search").addClass("active"); $("body").find(".header--main--search--input").animate({ height: "100px" } ,500); $("body").find(".header--main--search--input--input").focus(); } }); $("body").find(".header--main--search--close").click(function () { $("body").find(".header--main--search--input--input").blur(); $("body").find(".header--main--search").removeClass("active"); $("body").find(".header--main--search--input").animate({ height: "0" },500); }); $("body").find(".mobilenav--panel").each(function () { $(this).appendTo(".mobilenav--nav"); }); $("body").find(".mobilenav--nav--item--parent > .mobilenav--nav--item--label").click(function (e) { e.preventDefault(); thisDepth = parseInt($(this).closest(".mobilenav--panel").attr("data-depth")) + 1; thisRel = $(this).closest(".mobilenav--nav--item--parent").attr("rel"); thisPanel = $("body").find(".mobilenav--panel[rel='"+thisRel+"']"); thisPanelHeight = thisPanel.find(".mobilenav--panel--body").height(); $("body").find(".mobilenav--panel[data-depth='"+thisDepth+"']").scrollTop(0).css({ "z-index":"" }); $("body").find(".mobilenav--panel").removeClass("mobilenav--panel--active"); thisPanel.addClass("mobilenav--panel--active").css({ "z-index":"2" }); $("body").find(".mobilenav--upper").css({ "min-height":(thisPanelHeight)+"px" }); sizeMobilenav(); $("body").find(".mobilenav--nav").css({ "left":(-100 * thisDepth)+"%" }); }); $("body").find(".mobilenav--nav--back--label").click(function (e) { e.preventDefault(); thisDepth = parseInt($(this).closest(".mobilenav--panel").attr("data-depth")) - 1; thisRel = $(this).closest(".mobilenav--nav--back").attr("rel"); thisPanel = $("body").find(".mobilenav--panel[rel='"+thisRel+"']"); $("body").find(".mobilenav--panel[data-depth='"+thisDepth+"']").scrollTop(0).css({ "z-index":"" }); $("body").find(".mobilenav--panel").removeClass("mobilenav--panel--active"); thisPanel.addClass("mobilenav--panel--active").css({ "z-index":"2" }); sizeMobilenav(); $("body").find(".mobilenav--nav").css({ "left":(-100 * thisDepth)+"%" }); }); $(document).ready(function () { if ($(window).scrollTop() < 200) { $(window).scrollTop(0); } // sizeAnchor(); sizeHeader(); if (!$("body").hasClass("header--static")) { scrollDist = $(window).scrollTop(); stickyStart = 0; if ($("body").hasClass("header--hello--visible")) { stickyStart += $("body").find(".header--hello").height(); } stickyStart += $("body").find(".header--body").height(); if (scrollDist >= stickyStart) { $("body").removeClass("header--fixed"); $("body").addClass("header--fixed header--hidden"); $("body").removeClass("header--visible"); thisHeader.addClass("no--transition"); thisHeader[0].offsetHeight; thisHeader.css({ "top":(-1 * stickyStart - 15)+"px" }); thisHeader[0].offsetHeight; thisHeader.removeClass("no--transition"); } } sizeMobilenav(); }); /* $(window).mousewheel(function () { sizeHeader(); }); $("body").on("touchmove", function () { sizeHeader(); }); */ $(document).scroll(function () { sizeHeader(); hideSubMenusOnScroll(); }); $(window).load(function () { // sizeAnchor(); vanillaSizeAnchor(); sizeHeader(); sizeMobilenav(); }); $(window).resize(function () { vanillaSizeAnchor(); hideSubMenusOnScroll(); // sizeAnchor(); sizeHeader(); sizeMobilenav(); }); function mobileSearch() { if ($("body").find(".mobilenav--search--input").val()) { if ($("body").find(".mobilenav--search--input").val().trim().length > 0) { window.location.href = "/search-results?term="+$("body").find(".mobilenav--search--input").val(); } } } $("body").find(".mobilenav--search--submit").click(function () { $("body").find(".mobilenav--search form").submit(); }); function delete_cookie(name) { document.cookie = name +'=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;'; } delete_cookie("helloBar");