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.target; var rect = target.getBoundingClientRect(); var ripple = target.querySelector(‘.ripple’); jQuery(ripple).remove(); ripple = document.createElement(‘span’); ripple.className = ‘ripple’; ripple.style.height = ripple.style.width = Math.max(rect.width, rect.height) + ‘px’; target.appendChild(ripple); var top = e.pageY…Continue reading