Single product – Select default variation

jQuery(function ($) { function selectFirstInStockVariation($form) { const variations = $form.data(“product_variations”); if (!variations || !variations.length) return; // Zoek eerste variatie die koopbaar & in stock is const first = variations.find(v => v.is_in_stock && v.is_purchasable); if (!first) return; // Loop door alle…Continue reading

Archive – Products – JS popup

document.addEventListener(‘DOMContentLoaded’, function () { const infoButtons = document.querySelectorAll(‘.facet-info-button’); const allPopups = document.querySelectorAll(‘.facet-popup’); let lastFocused = null; infoButtons.forEach(button => { button.addEventListener(‘click’, function () { const facet = this.dataset.facet; const popup = document.querySelector(`.facet-popup[data-facet=”${facet}”]`); const content = popup?.querySelector(‘.popup-content’); if (popup) { lastFocused =…Continue reading

Logo Scroll Shrink (JS)

/** * Sticky header with stable base height: * – Computes base height ONLY in unscrolled state and stores it in –header-h * – Shrinks by CSS percentage when `.scrolled` is added * – Recomputes base when crossing back to…Continue reading

Closing slide-in with a click outside

(function () { document.addEventListener(‘DOMContentLoaded’, function () { // Utility: close the slide-in gracefully function closeHustleSlide(slideIn) { if (!slideIn) return; const closeBtn = slideIn.querySelector(‘.hustle-close, .hustle-close-button, .hustle-icon-close’); if (closeBtn) { closeBtn.click(); return; } slideIn.classList.remove(‘hustle-show’); const content = slideIn.querySelector(‘.hustle-slidein-content’); if (content) { content.classList.remove(‘hustle-animate-in’);…Continue reading

News Grid Filter Barrierefrei + bestimmte Kategorien ausschließen

document.addEventListener(‘DOMContentLoaded’, function () { // Kategorien, die ausgeblendet werden sollen const excludedCategories = [‘News’, ‘Weltcup 2025’, ‘Weltcup 2026’]; /** * Hauptfunktion: verbessert Filterstruktur + entfernt ausgeschlossene Kategorien */ function enhanceGridFilters() { // 1. Desktop: UL-Filter document.querySelectorAll(‘ul.vc_grid-filter[data-vc-grid-filter=”category”]’).forEach(function (filterList) { if (filterList.dataset.a11yEnhanced…Continue reading

RD Full-Width Cloner for Theme Marquee Title Element

(function () { var ROOT = ‘.full-width-marquee-title’; var TRACK = ‘.fusion-title-heading’; var SEG = ‘.awb-marquee-content’; var NBSP_COUNT = 5; // number of   spaces between repeats (controls visual gap) var MIN_MULTIPLIER = 3; // minimum total marquee width relative to…Continue reading

Minusmarg for anker og meny

document.addEventListener(“DOMContentLoaded”, function () { const offset = 100; // juster til ønsket avstand const anchorLinks = document.querySelectorAll(“a[href^=’#’]”); anchorLinks.forEach(link => { link.addEventListener(“click”, function (e) { const targetID = this.getAttribute(“href”).substring(1); const targetElement = document.getElementById(targetID); if (targetElement) { e.preventDefault(); const elementPosition = targetElement.getBoundingClientRect().top…Continue reading

Outseta Load Account Data

window.addEventListener(“DOMContentLoaded”, function () { console.log(“ACCOUNT LOADED”); const visitLink = document.getElementById(“visit_link”); if (!visitLink) { console.error(“#visit_link element not found.”); return; } let deployTriggered = false; // Define triggerDeploy globally so it can be called from onclick window.triggerDeploy = function() { if (deployTriggered)…Continue reading

gamroud js

document.addEventListener(“DOMContentLoaded”, function() { const popup = document.getElementById(“popup”); const iframe = document.getElementById(“gumroadIframe”); const close = document.querySelector(“.close”); const buttons = document.querySelectorAll(“.checkoutButton”); buttons.forEach(function(button) { button.addEventListener(“click”, function() { const gumroadCheckoutUrl = this.getAttribute(“data-url”); iframe.src = gumroadCheckoutUrl; popup.style.display = “block”; }); }); close.addEventListener(“click”, function() { popup.style.display…Continue reading