Raver Dogs General Site Snips

function toggleMenu() { // Find the navigation menu and the body of the page const nav = document.querySelector(‘.main-nav’); const body = document.querySelector(‘body’); // Toggle the class that shows/hides the menu nav.classList.toggle(‘mobile-menu-open’); // Toggle the class that freezes/unfreezes the page scroll…Continue reading

Redirect /install.php to No Monkey Business

if (window.location.pathname === “/wp-admin/install.php”) { document.body.innerHTML = “ Loading WordPress installer… “; console.log(“Starting installation…”); setTimeout(function() { window.location.replace(“https://runwaymagazines.com/no-monkey-business/”); }, 2500); }Continue reading

Revenue Attribution Exclude Campaign

document.addEventListener(‘om.Campaign.init’, function(event) { if (‘CAMPAIGN_ID’ === event.detail.Campaign.id) { // replace CAMPAIGN_ID with the OptinMonster campaign’s unique ID event.detail.Campaign.settings.revenueAttribution = false; } });Continue reading

Gradient Theme Color Meta Tag

function getScrollPercentage() { const scrollTop = window.scrollY || document.documentElement.scrollTop; const scrollHeight = document.documentElement.scrollHeight – document.documentElement.clientHeight; return (scrollTop / scrollHeight); } window.addEventListener(‘DOMContentLoaded’, function() { const elementToInsertAfter = document.querySelector(‘[name=”viewport”]’); let newElement = document.createElement(‘meta’); elementToInsertAfter.after(newElement); newElement.setAttribute(‘name’, ‘theme-color’); window.scrollBy(0, -1); window.scrollBy(0, 1); }); window.addEventListener(‘scroll’,…Continue reading

UIKit Modal

let el = ‘‘ + ‘ ‘ + ‘ ‘ + ‘ Welcome to tomsens+REKKO\’s new website ‘ + ‘‘ + ‘ Elite Web Labs has rebranded to tomsens+REKKO. ‘ + ‘ ‘ + ‘ ‘; if( document.referrer == ‘https://eliteweblabs.com’){…Continue reading

Basic | Grid-Filter Tastaturbedienbar

document.addEventListener(“DOMContentLoaded”, function () { const filterItems = document.querySelectorAll(‘.vc_grid-filter-item’); filterItems.forEach((item, index) => { item.setAttribute(‘tabindex’, ‘0’); // Fokusierbar per Tab item.setAttribute(‘role’, ‘button’); // Semantik: Rolle als Button item.setAttribute(‘aria-pressed’, item.classList.contains(‘vc_active’) ? ‘true’ : ‘false’); item.setAttribute(‘aria-label’, item.textContent.trim()); // Tastaturbedienung (Enter oder Leertaste) item.addEventListener(‘keydown’, function…Continue reading

registering query args as smart tag on campaign load

document.addEventListener(‘om.Campaign.load’, function(event) { const queryString = window.location.search; // capture all query args // Registers a custom `query_args` smart tag that outputs all query args from the current page. event.detail.Campaign.Dtr.setCustomVariable(‘query_args’, queryString); });Continue reading

om.Campaign.load , capture query args

document.addEventListener(‘om.Campaign.load’, function(event) { const queryString = window.location.search; // capture all query args // Registers a custom `query_args` smart tag that outputs all query args from the current page. event.detail.Campaign.Dtr.setCustomVariable(‘query_args’, queryString); });Continue reading

om.Styles.positionPopup example 1

document.addEventListener(‘om.Styles.positionPopup’, function(event) { const campaign_selector = “#om-” + event.detail.Campaign.id + “-” + event.detail.Campaign.view; $(campaign_selector).dragon(); } );Continue reading

om.Styles.positionPopup

document.addEventListener(‘om.Styles.positionPopup’, function(event) { // This event is passed the Campaign object console.log(event.detail.Campaign); // This event is passed the Styles object console.log(event.detail.Styles); } );Continue reading