Skip to content

Commit

Permalink
Update brand-body-scripts.js
Browse files Browse the repository at this point in the history
Updated script to target new classes since we are now using a Workspace Library.

This will append "brand-boilerplate-components--" in front of workspace library component styling and targeting.
  • Loading branch information
itsjohnnie committed Aug 13, 2024
1 parent 4247f50 commit c7e5fb1
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions global-brand-code/brand-body-scripts.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Set footer copyright year
Webflow.push(function () {
$('.footer-copyright_year').text(new Date().getFullYear());
$('.brand-boilerplate-components--footer-copyright_year').text(new Date().getFullYear());
});

// "Skip to main" script
Expand Down Expand Up @@ -139,28 +139,19 @@ $(document).ready(function () {
};
});

// Global nav - load ad image and link
$(document).ready(function () {

// Load from home page
$('#g-nav-ad-placeholder').load("https://webflow.com #g-nav-ad-live");
$('#new-g-nav-ad-placeholder-product').load("https://webflow.com #new-g-nav-ad-product-live");
$('#new-g-nav-ad-placeholder-solutions').load("https://webflow.com #new-g-nav-ad-solutions-live");
});

// Global nav - Experiment. Changes subnav height and width in a very flowy way
$(document).ready(function () {
$('.new-g-nav_menu-dropdown_toggle').on('click', function () {
$('.brand-boilerplate-components--g-nav_menu-dropdown_toggle').on('click', function () {

const containerElement = $(this).next().find('.new-g-nav_menu_container');
const containerElement = $(this).next().find('.brand-boilerplate-components--g-nav_menu_container');

setTimeout(function () {

const containerWidth = containerElement.outerWidth();
$('.new-g-nav_menu-container-bg').width(containerWidth);
$('.brand-boilerplate-components--g-nav_menu-container-bg').width(containerWidth);

const containerHeight = containerElement.outerHeight();
$('.new-g-nav_menu-container-bg').height(containerHeight);
$('.brand-boilerplate-components--g-nav_menu-container-bg').height(containerHeight);

}, 50);
});
Expand Down

0 comments on commit c7e5fb1

Please sign in to comment.