om.Api.init
document.addEventListener(‘om.Api.init’, function(event) {} );Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
document.addEventListener(‘om.Api.init’, function(event) {} );Continue reading
document.addEventListener(‘om.Campaign.load’, function(event) { console.log(event.detail); });Continue reading
document.addEventListener(‘EVENT NAME’, function(event) {} );Continue reading
/** * Restrict countries inside the Smart Phone form field * * @link https://wpforms.com/how-to-restrict-countries-inside-smart-phone-form-fields/ */ function wpf_dev_smart_phone_field_restrict_countries() { ?>Continue reading
document.addEventListener(‘DOMContentLoaded’, () => { const observer = new MutationObserver(() => { const form = document.querySelector(‘[data-screen]’); if (form) { const screen = form.getAttribute(‘data-screen’); if (screen === ‘confirm’) { document.body.classList.add(‘smf-confirm’); observer.disconnect(); } else if (screen === ‘complete’) { document.body.classList.add(‘smf-complete’); observer.disconnect(); } }…Continue reading
jQuery(function ($) { const body = $(‘body’); const page = $(‘#page’); const navWrapper = $(‘.dt-mobile-header’); const mobileMenu = $(‘#mobile-menu’); const miniWidgets = $(‘.mobile-mini-widgets-in-menu’); let lastFocusedElement = null; // Fokusfalle aktivieren function trapFocus(container) { const focusableEls = container.find(‘a, button, input, [tabindex]:not([tabindex=”-1″])’).filter(‘:visible’);…Continue reading
// Klassen bei querySelectorAll (”); eingeben: Analog CSS + durch Komma getrennt jQuery(document).ready(function() { const items = document.querySelectorAll(‘.section-green-dark .vc_column-inner > .wpb_wrapper .wpb_text_column *, .cta .wpb_text_column *, .vc_tta-title-text’); items.forEach(item => { item.classList.add(‘da-skip-contrast’); }); });Continue reading
jQuery(document).ready(function() { const items = document.querySelectorAll(‘#bottom-bar’); items.forEach(item => { item.removeAttribute(‘role’); }); });Continue reading
document.addEventListener(‘om.Campaign.startShow’, function(event) { if(document.referrer.search.indexOf(‘google.com’) > 0) { // replace with the specific referral domain var optinCampaign = document.querySelector(‘#om-CAMPAIGN_ID’); // replace CAMPAIGN_ID with the unique ID for your campaign optinCampaign.parentNode.removeChild(optinCampaign); } });Continue reading
document.addEventListener(‘om.Campaign.startShow’, function(event) { if(window.location.search.indexOf(‘shopping-cart’) > -1) { // replace shopping-cart wtih your specific URL path var optinCampaign = document.querySelector(‘#om-CAMPAIGN_ID’); // replace CAMPAIGN_ID with the unique ID of your campaign optinCampaign.parentNode.removeChild(optinCampaign); } });Continue reading