Smash Ballon Content “load more” Link entfernen

jQuery(document).ready(function ($) { function unwrapSbiExpandLinks(context) { $(context).find(‘.sbi_expand > a’).each(function () { // entfernen, Inhalt behalten (z.B. …) $(this).replaceWith($(this).contents()); }); } // 1) initial unwrapSbiExpandLinks(document); // 2) nach Klick auf “Mehr laden” (zusätzliche Absicherung) $(document).on(‘click’, ‘#sbi_load .sbi_load_btn, .sbi_load_btn’, function () {…Continue reading

Smash Balloon Bild-Links Tabindex

jQuery(document).ready(function ($) { const observer = new MutationObserver(function () { $(‘.sbi_photo’).attr(‘tabindex’, ‘0’); }); observer.observe(document.body, { childList: true, subtree: true }); });Continue reading

使用.number 加入數字跳動動態

document.addEventListener(“DOMContentLoaded”, function () { const counters = document.querySelectorAll(“.number”); const animateCounter = (counter) => { // 避免重複執行 if (counter.dataset.animated) return; counter.dataset.animated = “true”; // 取出 + const sup = counter.querySelector(“sup”); const supHTML = sup ? sup.outerHTML : “”; // 取純數字(忽略 sup)…Continue reading

Untitled Snippet

function getChatContent() { const chat = document.querySelector(‘.mwai-chatbot .mwai-messages’) || document.querySelector(‘.mwai-chatbot’); return chat ? chat.innerHTML : ”; } function getChatText() { const chat = document.querySelector(‘.mwai-chatbot .mwai-messages’) || document.querySelector(‘.mwai-chatbot’); return chat ? chat.innerText : ”; } function buildPDFHtml(content) { return ` Your…Continue reading

Enable Clean “Back” Button URL Reference

document.addEventListener(‘DOMContentLoaded’, function() { document.querySelectorAll(‘a[href=”#back-clean”]’).forEach(function(btn){ btn.addEventListener(‘click’, function(e){ e.preventDefault(); try { if (document.referrer) { var r = new URL(document.referrer); r.searchParams.delete(‘add-to-cart’); r.searchParams.delete(‘clear-cart’); // Add any additional parameters to ignore in new line window.location.href = r.toString(); } else { window.location.href = window.location.origin; } }…Continue reading

WooCommerce AJAX Fix for RD Theme Live Cart Update

const DEBUG = false; // Set to true to enable console logs for debugging (function checkJQueryThenRun(retries = 10) { if (typeof jQuery === ‘undefined’) { if (DEBUG) console.warn(‘⏳ Waiting for jQuery…’); if (retries > 0) { setTimeout(() => checkJQueryThenRun(retries –…Continue reading

WPBakery Collapsible Tabs

(function ($) { $(document).ready(function ($) { $(document).on( “click”, “.vc_tta-tab.vc_active”, function() { //Remove vc_active class and set aria-selected to false for clicked tab $(this).removeClass(‘vc_active’); $(this).find(‘a’).attr(‘aria-selected’, false); //Get tab ID var id = $(this).find(‘a’).attr(‘id’).replace(‘tab-‘,”); //Remove vc_active class from tab panel $(“#” +…Continue reading

A/B Test Visibility Check

add_action(‘wp_footer’, function() { // Use this WordPress conditional to ensure the script only loads on the homepage. if ( is_front_page() || is_home() ) { ?>Continue reading