Preloader JS

;(function ($) { $(document).on(‘ready’, function(){ if($(‘#global-preloader’)) return $(‘#global-preloader’).fadeOut(500); }); })(jQuery);Continue reading

openPopUp JS

var t=setTimeout(openPopUp,5000); function openPopUp(url) { if(document.getElementById(“modal-join-our-mailing-list-button”)) document.getElementById(“modal-join-our-mailing-list-button”).click(); }Continue reading

Form Submit Preloader JS

var forms = document.querySelector(‘[method=”post”]’); if(forms) forms.addEventListener(“submit”, function(e){ if(document.getElementById(‘global-preloader’)){ document.getElementById(‘global-preloader’).style.display = ‘block’; var t=setTimeout(openPopUpX,1500); function openPopUpX(url) { document.getElementById(‘global-preloader’).style.display = ‘none’; } } return; });Continue reading

Yootheme JS

“use strict” jQuery(document).on(‘ready’, function () { jQuery(‘input[type=text]’).addClass(‘uk-input’); jQuery(‘input[type=password]’).addClass(‘uk-input’); jQuery(‘input[type=number]’).addClass(‘uk-input’); jQuery(‘input[type=email]’).addClass(‘uk-input’); jQuery(‘select’).addClass(‘uk-select’); jQuery(‘input[type=radio]’).addClass(‘uk-radio’); jQuery(‘input[type=checkbox]’).addClass(‘uk-checkbox’); jQuery(‘input[type=range]’).addClass(‘uk-range’); jQuery(‘input[type=tel]’).addClass(‘uk-input’); jQuery(‘textarea’).addClass(‘uk-textarea’); jQuery(‘[type=”submit”]:not(“.uk-text-link”)’).addClass(‘uk-button uk-button-primary uk-button-large uk-margin-top’); jQuery(‘.acf-fields’).addClass(‘uk-grid’); jQuery(‘form .acf-field’).each(function () { jQuery(this).addClass(‘uk-grid-margin-medium’); jQuery(this).find(‘.acf-label > label’).appendTo(jQuery(this).find(‘.acf-input-wrap’)); jQuery(this).find(‘label’, ‘textarea’).attr({ ‘data-valid’: jQuery(this).find(‘input’, ‘textarea’).attr(‘placeholder’), ‘data-placeholder’: jQuery(this).find(‘input’, ‘textarea’).attr(‘placeholder’) }).text(”); jQuery(this).find(‘input’, ‘textarea’).attr(‘placeholder’,…Continue reading

Scroll Reveal JS (reference)

function scrollFunction() { if (document.body.scrollTop > 160 || document.documentElement.scrollTop > 160) { document.getElementById(“profile-bubble”).style.display = “inline-block”; } else { document.getElementById(“profile-bubble”).style.display = “none”; } } window.onscroll = function() {scrollFunction()};Continue reading

Tasty Pins – Remove the Pin button for an image by URL

(function(callback) { if (document.readyState !== “loading”) { callback(); } else { document.addEventListener(“DOMContentLoaded”, callback); } })(() => { let tp_exclusions = document.querySelectorAll(‘img[src=”https://example.com/wp-content/uploads/2023/12/logo.png”]’); if ( tp_exclusions.length === 0 ) { return; } for( const tp_exclusion of tp_exclusions ) { tp_exclusion.dataset.pinNopin = ‘nopin’;…Continue reading

Require Terms of Service Link Click

jQuery( function() { var fieldId = ‘simpay-form-771-field-5’; var $checkbox = jQuery(‘#’ + fieldId); $checkbox.prop( ‘disabled’, true ); jQuery(‘label[for=”‘ + fieldId + ‘”] a’).on( ‘click’, function() { $checkbox.prop( ‘disabled’, false ); } ); });Continue reading

Product Count Javascript

// Update values in post counter if ( jQuery( ‘.cwf-products-count’ ) && jQuery( ‘.cwf-products-count’ ).length ) { // TODO maybe found more suitable event in imagesLoaded? $us.$canvas.on( ‘resize’, function(){ // Make sure HTML was appended setTimeout(() => { jQuery( ‘.cwf-products-count’…Continue reading

Observe the Target Node Mutations (DOM)

// Options for the observer (which mutations to observe) const config = { attributes: true, childList: true, characterData: true, subtree: true, }; // Callback function to execute when mutations are observed const callback = (mutationList, observer) => { for (const…Continue reading