JS [Category Posts]: Remove Vendor Query Loop Based on Post Location if Empty

document.addEventListener(‘DOMContentLoaded’, (event) => { // Check if there’s a div with the class ‘wpgb-card-wrapper’ and “Sorry, no content found” text const cardWrapper = Array.from(document.querySelectorAll(‘.wpgb-card-wrapper’)).find(div => div.textContent.trim() === “Sorry, no content found.”); // If the div is found, remove the element…Continue reading

Test Pricing js

document.addEventListener(“DOMContentLoaded”, () => { // Initialize drag and drop for filters initializeSortableFilters(); // Attach event listeners to locale links const localeLinks = document.querySelectorAll(‘#locales a’); localeLinks.forEach(link => { link.addEventListener(‘click’, handleLocaleLinkClick); }); // Populate the product table on initial load populateProductTable(); //…Continue reading

Tilt Effect JS

elem = document.getElementsByClassName(‘uk-background-norepeat’); window.addEventListener(‘deviceorientation’, function(e){ handler(e); }, false); function handler(e){ var width = window.outerWidth, rot = e.gamma / 1800, left = ( width / 2 ) * rot; elem[0].style.backgroundPosition = left + ‘px’; }Continue reading

Buttons Material Design JS

‘use strict’; var rippleEffect = function (e) { var target = e.currentTarget; var ripple = target.querySelector(‘.ripple’); if(ripple){ console.log(‘asdfasdfasfas’); jQuery(ripple).remove(); } var rect = target.getBoundingClientRect(); var rippleNew = document.createElement(‘span’); target.appendChild(rippleNew); rippleNew.className = ‘ripple’; rippleNew.style.height = rippleNew.style.width = Math.max(rect.width, rect.height) + ‘px’;…Continue reading