Soliloquy – Hide the caption’s shadow
const captionDivs = document.querySelectorAll(‘.soliloquy-caption-inside’); captionDivs.forEach(div => { if (div.textContent.trim() === ”) { div.style.display = ‘none’; }});Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
const captionDivs = document.querySelectorAll(‘.soliloquy-caption-inside’); captionDivs.forEach(div => { if (div.textContent.trim() === ”) { div.style.display = ‘none’; }});Continue reading
jQuery(document).ready(function() { function executeJS() { jQuery(document).ready(function($) { var $h3 = $(‘#ngg_category_digital_downloads’).prev(‘h3’); var $targetElement = $(‘#ngg_category_digital_downloads’); var $newContainer = $(‘ ‘).append($h3).append($targetElement); $(‘.nggpl-pricelist_category_wrapper’).prepend($newContainer); }); } jQuery(document).on(‘ajaxComplete’, function(event, xhr, settings) { if (settings.url.indexOf(‘GetSidebarData’) !== -1) { executeJS(); } }); if (jQuery(‘#npl_wrapper’).hasClass(‘npl-sidebar-open’)) { executeJS();…Continue reading
jQuery(‘.vc_tta-panel-title’).click(function(){ jQuery(window). trigger(‘resize’); });Continue reading
jQuery(document).ready(function($) { var captions = $(‘.envira-gallery-captioned-text’); captions.each(function() { var caption = $(this); var item = caption.closest(‘.envira-gallery-item’); var link = item.find(‘.envira-gallery-link-disabled’); if (link.length) { caption.wrap(‘‘); }});});Continue reading
function hideElements() { const noItemsElements = document.querySelectorAll(‘#ngg_pro_no_items’); noItemsElements.forEach((noItems) => { const proCheckout = noItems.closest(‘#ngg_pro_checkout’); if (proCheckout) { proCheckout.style.display = ‘none’; } }); const cartEmptyMessages = document.querySelectorAll(‘.wc-empty-cart-message’); cartEmptyMessages.forEach((message) => { const parent = message.closest(‘.woocommerce’); if (parent) { parent.style.display = ‘none’; }…Continue reading
jQuery(document).ready(function() { function executeJS() { if (jQuery(‘#ngg_category_digital_downloads_header’).length > 0 && jQuery(‘#ngg_category_digital_downloads_header’).parent().siblings(‘h3’).length === 0) { jQuery(‘#ngg_update_cart_btn’).hide(); }} jQuery(document).on(‘ajaxComplete’, function(event, xhr, settings) { if (settings.url.indexOf(‘GetSidebarData’) !== -1) { executeJS(); // Execute the JS snippet when the XHR is completed } }); if…Continue reading
var $j = jQuery.noConflict(); $j(document).ready(function() { $j(“.envira-gallery-item a img”).mouseenter(function() { var title = $j(this).attr(“title”); $j(this).attr(“save_title”, title); $j(this).attr(“title”, “”); }) .mouseleave(function() { var title = $j(this).attr(“save_title”); $j(this).attr(“title”, title); }) .click(function() { var title = $j(this).attr(“save_title”); $j(this).attr(“title”, title); }); });Continue reading
document.addEventListener(‘DOMContentLoaded’, function() { const stBottom = document.getElementById(‘st-bottom’); const header = document.querySelector(‘header’); // Adjust the selector if needed const headerHeight = header ? header.offsetHeight : 100; // Fallback height let lastScrollY = window.scrollY; //this is a comment (2) window.addEventListener(‘scroll’, function() {…Continue reading
// Menu Toggle function toggleMenu() { const mobileNav = document.querySelector(‘.mobile-nav’); mobileNav.classList.toggle(‘active’); } // Close Menu on Scroll function closeMenuOnScroll() { const mobileNav = document.querySelector(‘.mobile-nav’); if (mobileNav.classList.contains(‘active’)) { mobileNav.classList.remove(‘active’); } } // Attach the scroll event listener window.addEventListener(‘scroll’, closeMenuOnScroll); // Show…Continue reading