Information Hub

Penske technician working on a truck, highlighting National Technician Appreciation Week, June 14-20, 2026.

Driven by Precision: Celebrating National Technician Appreciation Week

This week, we're proud to celebrate National Technician Appreciation Week and recognize the more than 11,500 associates whose precision drives our performance.

This year's theme, Precision Driven, reflects what sets Penske's technicians and CSRs apart – a relentless commitment to doing things the right way, every time. The work may happen in the shop, but its impact is felt with every delivery, every single day.

Keep reading... Show less
}); }); window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){ function fixTextWidow(element) { let wordArray = element.textContent.split(" "); const filteredArray = wordArray.filter(function(element) { return element.trim() !== ""; }); if (filteredArray.length > 1) { filteredArray[filteredArray.length - 2] += " " + filteredArray[filteredArray.length - 1]; filteredArray.pop(); element.innerHTML = filteredArray.join(" "); } } /*REBELMOUSE_STDLIB.createElementChangeListener(".post-header h1 .widget__headline-text", function(element){ fixTextWidow(element); })*/ REBELMOUSE_STDLIB.createElementChangeListener(".widget__headline .widget__headline-text", function(element){ fixTextWidow(element); }) REBELMOUSE_STDLIB.createElementChangeListener(".rm-breadcrumb__item:last-of-type .rm-breadcrumb__link", function(element){ fixTextWidow(element); }) REBELMOUSE_STDLIB.createElementChangeListener(".current-post .body-description h2", function(element){ let spanElement = element.querySelector("span"); let supElem = element.querySelector("sup"); if (spanElement == null && supElem == null) { fixTextWidow(element); } }) REBELMOUSE_STDLIB.createElementChangeListener(".current-post .body-description h3", function(element){ let spanElement = element.querySelector("span"); let supElem = element.querySelector("sup"); if (!element.classList.contains('h3-img') && spanElement == null && supElem == null) { fixTextWidow(element); } }) REBELMOUSE_STDLIB.createElementChangeListener(".current-post .body-description h4", function(element){ fixTextWidow(element); }) REBELMOUSE_STDLIB.createElementChangeListener(".current-post .body-description .acc-header", function(element){ fixTextWidow(element); }) REBELMOUSE_STDLIB.createElementChangeListener(".callouts-wrapper .widget__subheadline-text p", function(element){ fixTextWidow(element); }) REBELMOUSE_STDLIB.createElementChangeListener(".callouts-wrapper .custom-field-callout-title", function(element){ fixTextWidow(element); }) REBELMOUSE_STDLIB.createElementChangeListener(".sidebar-post .widget__subheadline-text p", function(element){ fixTextWidow(element); }) REBELMOUSE_STDLIB.createElementChangeListener(".section-header h1.title", function(element){ fixTextWidow(element); }) REBELMOUSE_STDLIB.createElementChangeListener(".truck-info h2.text-element", function(element){ fixTextWidow(element); }) REBELMOUSE_STDLIB.createElementChangeListener(".container.trucks h1", function(element){ fixTextWidow(element); }) REBELMOUSE_STDLIB.createElementChangeListener(".subtitle .text-element", function(element){ fixTextWidow(element); }) // REVERT WIDOWS ON INDUSTRY ARTICLES COMMERCIAL HOMEPAGE CALLOUTS function removeNonBreakingSpace(element) { element.innerHTML = element.innerHTML.replace(/ /g, " "); } REBELMOUSE_STDLIB.createElementChangeListener(".industry-articles .widget__headline .widget__headline-text", function(element) { removeNonBreakingSpace(element); }); REBELMOUSE_STDLIB.createElementChangeListener(".tag-beverage-manufacturing-industry .widget__headline .widget__headline-text", function(element) { removeNonBreakingSpace(element); }); REBELMOUSE_STDLIB.createElementChangeListener(".tag-healthcare-industry .widget__headline .widget__headline-text", function(element) { removeNonBreakingSpace(element); }); REBELMOUSE_STDLIB.createElementChangeListener(".no-break", function(element) { removeNonBreakingSpace(element); }); }); window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){ function removeEmptyParagraphBeforeDiv() { // Select all divs with the class "rebellt-item" document.querySelectorAll('div.rebellt-item').forEach(function(div) { // Check if the previous sibling is a

element var prevElem = div.previousElementSibling; if (prevElem && prevElem.tagName.toLowerCase() === 'p') { // Check if the

element is empty or contains only
or whitespace if (prevElem.innerHTML.trim() === '' || prevElem.innerHTML.trim() === '
') { prevElem.remove(); // Remove the empty

element } } }); } // Call the function to remove empty

elements before .rebellt-item divs removeEmptyParagraphBeforeDiv(); }); window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){ window.addEventListener("keydown", (e) => { if(e.key === "Tab"){ REBELMOUSE_STDLIB.createElementChangeListener(".topbar-wrapper .nav-icons svg", function(el){ let item = el.parentNode; //detec if focus is by tab keyboard //el.addEventListener("keydown", (e) => { el.classList.add("key-focus"); //}); el.addEventListener("focusin", (e) => { //show dropdown let dropdown = item.querySelector('.dropdown'); if (dropdown) { //remove keyshow class document.querySelectorAll(".navbar .dropdown.key-show").forEach((item) => { item.classList.remove("key-show"); }) dropdown.classList.add("key-show"); } el.addEventListener("focusout", (e) => { item.classList.remove("key-focus"); }) }) }) } //remove focus from default nav.menu-global links REBELMOUSE_STDLIB.createElementChangeListener(".menu-global a", function(el){ el.tabIndex = '-1'; }) document.querySelector(".top-promo").tabIndex = '0'; REBELMOUSE_STDLIB.createElementChangeListener(".topbar-wrapper .navbar .text-element a", function(el){ //console.log(el); el.addEventListener("focusin", () => { let item = el.parentNode.parentNode; let dropdown = item.querySelector('.dropdown'); if (dropdown) { //remove keyshow class document.querySelectorAll(".navbar .dropdown.key-show").forEach((item) => { item.classList.remove("key-show"); }) dropdown.classList.add("key-show"); } }) }) REBELMOUSE_STDLIB.createElementChangeListener(".topbar-wrapper", function(el){ el.addEventListener("mouseover", ()=>{ document.querySelectorAll(".navbar .item ").forEach((item)=>{ if(item.querySelector(".dropdown")){ item.querySelector(".dropdown").classList.remove("key-show") } }) }) }) REBELMOUSE_STDLIB.createElementChangeListener(".nav-lang a:last-child", function(el){ //console.log(el); el.addEventListener("focusin", () => { el.addEventListener("keydown", (e) => { if(e.key === "Tab"){ e.preventDefault(); //alert("Tab Key Pressed"); el.parentNode.classList.remove("key-show"); document.querySelector(".top-promo").classList.remove("hidden"); document.querySelector(".top-promo").tabIndex = '0'; } }); }) }) REBELMOUSE_STDLIB.createElementChangeListener(".promo-desktop .all-promo-link", function(el){ el.addEventListener("focusin", () => { document.querySelector(".all-promotions").style.display = "block"; let lastChild = document.querySelector(".all-promotions .promo-cont:last-child .order-btn"); lastChild.addEventListener("focusin", () => { lastChild.addEventListener("focusout", () => { document.querySelector(".all-promotions").style.display = "none"; document.querySelector(".promo-desktop .promo-btn").focus(); }) }) }) }) }) // Remove accessibility to link images when images have text redirecting to the same link REBELMOUSE_STDLIB.createElementChangeListener("a img", function(el){ let parent = el.parentNode; if (parent.tagName === 'A') { parent.setAttribute("tabIndex", "-1"); } }) // COMMERCIAL WIDGET KEYBOARD ACCESSIBILITY REBELMOUSE_STDLIB.createElementChangeListener(".booking-container form", function(el){ el.addEventListener('keydown', function(event) { if (event.key === 'Enter') { event.preventDefault(); } }); }) REBELMOUSE_STDLIB.createElementChangeListener(".returnto-input-container input", function(el){ el.addEventListener("keydown", (event)=>{ if(event.key === "Enter") { el.click(); } }) }) REBELMOUSE_STDLIB.createElementChangeListener(".booking-container .quote-submit-button button", function(el){ el.addEventListener('keydown', function(event) { if (event.key === 'Enter') { el.click(); } }); }) //remove tabindex of calkendar input function removeCalendarTabInd(el, section) { el.addEventListener("focus", () => { if (document.querySelector(`.${section} .pickup-date-time commercial-date-selector`)) { document.querySelector(`.${section} .pickup-date-time commercial-date-selector .cr-date-picker__input`).setAttribute("tabindex", "-1"); document.querySelector(`.${section} .dropoff-date-time commercial-date-selector .cr-date-picker__input`).setAttribute("tabindex", "-1"); } }) } REBELMOUSE_STDLIB.createElementChangeListener(".home-rental .pickup-container input", function(el){ removeCalendarTabInd(el, "home-rental"); }) REBELMOUSE_STDLIB.createElementChangeListener(".top-promo .pickup-container input", function(el){ removeCalendarTabInd(el, "top-promo"); }) REBELMOUSE_STDLIB.createElementChangeListener(".sidebar .pickup-container input", function(el){ removeCalendarTabInd(el, "sidebar"); }) function keybLocItem(el, section) { el.setAttribute("tabindex", "0"); el.addEventListener("keydown", (event) => { if(event.key === 'Enter') { el.click(); el.parentNode.parentNode.classList.add("hidden"); document.querySelector(`.${section} .pickup-date-time .cr-date-picker__input`).focus(); } }) } REBELMOUSE_STDLIB.createElementChangeListener(".home-rental .dropdown-loc .location-item", function(el){ keybLocItem(el, "home-rental") }) REBELMOUSE_STDLIB.createElementChangeListener(".top-promo .dropdown-loc .location-item", function(el){ keybLocItem(el, "top-promo") }) REBELMOUSE_STDLIB.createElementChangeListener(".sidebar .dropdown-loc .location-item", function(el){ keybLocItem(el, "sidebar") }) function keylastLocItem(el, section) { el.addEventListener('keydown', function(event) { if (event.key === 'Tab' && event.shiftKey) { console.log('Shift + Tab was pressed'); } else if (event.key === 'Tab') { el.parentNode.parentNode.classList.add("hidden"); let commercialCalendar = document.querySelector(`.${section} .pickup-date-time .cr-date-picker__input`); if(commercialCalendar) { commercialCalendar.focus(); } } }); } REBELMOUSE_STDLIB.createElementChangeListener(".home-rental .dropdown-loc .location-item:nth-of-type(5)", function(el){ keylastLocItem(el, "home-rental") }) REBELMOUSE_STDLIB.createElementChangeListener(".top-promo .dropdown-loc .location-item:nth-of-type(5)", function(el){ keylastLocItem(el, "top-promo") }) REBELMOUSE_STDLIB.createElementChangeListener(".sidebar .dropdown-loc .location-item:nth-of-type(5)", function(el){ keylastLocItem(el, "sidebar") }) function keyCurrLoc(el, section, inputType) { el.setAttribute("tabindex", "0"); el.addEventListener("focus", () => { setTimeout(()=>{ el.parentNode.classList.remove("hidden"); document.querySelector(`.${section} .${inputType} .gmap-loc`).style.display = 'block'; el.addEventListener("keydown", (event) => { if(event.key === 'Enter') { el.click(); el.parentNode.classList.add("hidden"); document.querySelector(`.${section} .pickup-date-time .cr-date-picker__input`).focus(); } if(event.key === 'Tab') { console.log("is running here in tab") } }) },500) }) } REBELMOUSE_STDLIB.createElementChangeListener(".home-rental .pickup-container .dropdown-loc .current-loc", function(el){ keyCurrLoc(el, "home-rental", "pickup-container"); }) REBELMOUSE_STDLIB.createElementChangeListener(".top-promo .pickup-container .dropdown-loc .current-loc", function(el){ keyCurrLoc(el, "top-promo", "pickup-container"); }) REBELMOUSE_STDLIB.createElementChangeListener(".sibar .pickup-container .dropdown-loc .current-loc", function(el){ keyCurrLoc(el, "sidebar", "pickup-container"); }) REBELMOUSE_STDLIB.createElementChangeListener(".home-rental .dropoff-container .dropdown-loc .current-loc", function(el){ keyCurrLoc(el, "home-rental", "dropoff-container"); }) REBELMOUSE_STDLIB.createElementChangeListener(".top-promo .dropoff-container .dropdown-loc .current-loc", function(el){ keyCurrLoc(el, "top-promo", "dropoff-container"); }) REBELMOUSE_STDLIB.createElementChangeListener(".sibar .dropoff-container .dropdown-loc .current-loc", function(el){ keyCurrLoc(el, "sidebar", "dropoff-container"); }) let typeTimeSelector, typeSection, widgetSection; function keycalendarfocus(el, section, calendarSec) { el.addEventListener("focus", () => { el.click(); setTimeout(()=> { //document.querySelector(`.${section} .${calendarSec} .cr-date-range-picker__close-button`).focus(); document.querySelector(`.${section} .dropdown-loc`).classList.add("hidden"); let calendarCells = document.querySelectorAll(`.${section} .${calendarSec} commercial-date-selector .cr-date-range-picker__month-cell`); calendarCells.forEach((calCell) => { if (!calCell.classList.contains('cr-date-range-picker__month-cell--disabled') && !calCell.classList.contains('cr-date-range-picker__month-cell--empty')) { calCell.setAttribute("tabindex", "0"); } calCell.addEventListener("keydown", (event) => { if (event.key === 'Enter') { calCell.click(); document.querySelector(`.${section} .${calendarSec} commercial-date-selector .cr-date-range-picker__button`).focus(); setTimeout(()=>{ let timeSelector = document.querySelector(`.${section} .${calendarSec} .quote_pickup_time_select`) || document.querySelector(`.${section} .${calendarSec} .quote_dropoff_time_select`); typeTimeSelector = timeSelector.className; typeSection = timeSelector.getAttribute("data-section"); widgetSection = section; timeSelector.click(); },1000) } }) }) },500) }) } REBELMOUSE_STDLIB.createElementChangeListener(".home-rental .pickup-date-time commercial-date-selector .cr-date-picker input", function (el) { keycalendarfocus(el, "home-rental", "pickup-date-time"); }) REBELMOUSE_STDLIB.createElementChangeListener(".home-rental .dropoff-date-time commercial-date-selector .cr-date-picker input", function (el) { keycalendarfocus(el, "home-rental", "dropoff-date-time"); }) REBELMOUSE_STDLIB.createElementChangeListener(".top-promo .pickup-date-time commercial-date-selector .cr-date-picker input", function (el) { keycalendarfocus(el, "top-promo", "pickup-date-time"); }) REBELMOUSE_STDLIB.createElementChangeListener(".top-promo .dropoff-date-time commercial-date-selector .cr-date-picker input", function (el) { keycalendarfocus(el, "top-promo", "dropoff-date-time"); }) REBELMOUSE_STDLIB.createElementChangeListener(".sidebar .pickup-date-time commercial-date-selector .cr-date-picker input", function (el) { keycalendarfocus(el, "sidebar", "pickup-date-time"); }) REBELMOUSE_STDLIB.createElementChangeListener(".sidebar .dropoff-date-time commercial-date-selector .cr-date-picker input", function (el) { keycalendarfocus(el, "sidebar", "dropoff-date-time"); }) //close calendar popup by keyboard accessibility REBELMOUSE_STDLIB.createElementChangeListener("commercial-date-selector .cr-date-range-picker__close-button", function (el) { el.setAttribute("tabindex", "0"); el.addEventListener("keydown", (event) => { if (event.key === 'Enter') { el.click(); } }) }) function keyTimeVal(el, section, typeTime) { el.addEventListener("keydown", (event) => { if(event.key === 'Enter') { el.click(); let widgetError = document.querySelector(".widget-overlay-error"); if (widgetError.classList.contains("hidden") && typeTime === "quote_widget_pickup-time") { document.querySelector(`.${section} .dropoff-date-time .cr-date-picker__input`).focus(); } else { document.querySelector(".widget-overlay-error").focus(); } } }) } REBELMOUSE_STDLIB.createElementChangeListener(".home-rental .date-time-select .quote_widget_pickup-time .time-val", function(el){ keyTimeVal(el, "home-rental", "quote_widget_pickup-time") }) REBELMOUSE_STDLIB.createElementChangeListener(".home-rental .date-time-select .quote_widget_dropoff-time .time-val", function(el){ keyTimeVal(el, "home-rental", "quote_widget_dropoff-time") }) REBELMOUSE_STDLIB.createElementChangeListener(".top-promo .date-time-select .quote_widget_pickup-time .time-val", function(el){ keyTimeVal(el, "top-promo", "quote_widget_pickup-time") }) REBELMOUSE_STDLIB.createElementChangeListener(".top-promo .date-time-select .quote_widget_dropoff-time .time-val", function(el){ keyTimeVal(el, "top-promo", "quote_widget_dropoff-time") }) REBELMOUSE_STDLIB.createElementChangeListener(".sidebar .date-time-select .quote_widget_pickup-time .time-val", function(el){ keyTimeVal(el, "sidebar", "quote_widget_pickup-time") }) REBELMOUSE_STDLIB.createElementChangeListener(".sidebar .date-time-select .quote_widget_dropoff-time .time-val", function(el){ keyTimeVal(el, "sidebar", "quote_widget_dropoff-time") }) REBELMOUSE_STDLIB.createElementChangeListener(".widget-error .error-close", function(el){ el.addEventListener("keydown", (event) => { if(event.key === 'Enter') { el.click(); //console.log(document.querySelector(`.${typeSection} .${typeTimeSelector}`)); setTimeout(()=>{document.querySelector(`.${typeSection} .${typeTimeSelector}`).click();},500) } }) }) REBELMOUSE_STDLIB.createElementChangeListener(".widget-popup-info .close", function(close){ close.addEventListener("click", () => { close.parentNode.parentNode.classList.add("hidden"); document.querySelector(".widget-overlay-error").classList.add("hidden"); }) }) let lastInteractionType = null; // Detect keyboard interactions at the document level document.addEventListener("keydown", (event) => { lastInteractionType = 'keyboard'; }); // Detect mouse interactions at the document level document.addEventListener("mousedown", (event) => { lastInteractionType = 'mouse'; }); REBELMOUSE_STDLIB.createElementChangeListener(".booking-container .quote_truck_size_select", function(el){ el.setAttribute("tabindex", "0"); // Handle focus event el.addEventListener("focus", (event) => { if (lastInteractionType === 'keyboard') { el.parentNode.querySelector(".truck-options").classList.remove("hidden"); console.log("Keyboard interaction detected, key:", event.key); } else if (lastInteractionType === 'mouse') { console.log("Mouse click detected, no need to show options."); } lastInteractionType = null; }); }) REBELMOUSE_STDLIB.createElementChangeListener(".booking-container .truck-sizes-options", function(el){ el.setAttribute("tabindex", "0"); }) REBELMOUSE_STDLIB.createElementChangeListener(".booking-container .compare-option", function(el){ el.setAttribute("tabindex", "0"); el.addEventListener('keydown', function(event) { if (event.key === 'Tab' && event.shiftKey) { console.log('Shift + Tab was pressed'); } else if (event.key === 'Tab') { el.parentNode.parentNode.classList.add("hidden"); } }); }) // Detect when user has scroll at the end of the what's difference popup to clear linear gradient let isScrolling; const scrollContainer = document.querySelector('.popup-scroll-content'); scrollContainer.addEventListener('scroll', function() { window.clearTimeout(isScrolling); isScrolling = setTimeout(function() { const scrollTop = scrollContainer.scrollTop; const scrollHeight = scrollContainer.scrollHeight; const offsetHeight = scrollContainer.offsetHeight; if (scrollTop + offsetHeight >= scrollHeight) { console.log('User has scrolled to the end of .popup-info-content.'); // scrolling reaches the end document.querySelector('.popup-info-content').classList.add("remove-gradient"); } else { console.log('User has not scrolled to the end of .popup-info-content.'); // scrolling stops but hasn't reached the end document.querySelector('.popup-info-content').classList.remove("remove-gradient") } }, 200); }, false); }); window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){ window.REBELMOUSE_STDLIB.loadExternalScript("https://rm.gopenske.com/ptr/assets/maint/maintenance.js", function() { }); }); window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){ window.getCookie = function getCookie(name) { let matches = document.cookie.match(new RegExp( "(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)" )); return matches ? decodeURIComponent(matches[1]) : undefined; } var isMaintenance = window.getCookie('isMaintenance'); if('Y' == isMaintenance){ document.querySelectorAll(".booking-container").forEach(function (item) { item.remove(); document.querySelector("body").classList.add("maintenance-y"); }); } function closeWidgetError(el) { el.classList.add("hidden"); if (document.querySelector(".widget-overlay-error")) { document.querySelector(".widget-overlay-error").classList.add("hidden"); } } //Close Widget Errors REBELMOUSE_STDLIB.createElementChangeListener(".widget-error", function(el){ let close_btn = el.querySelector(".error-close"); let blue_btn = el.querySelector(".blue-full-btn"); if (close_btn) { close_btn.addEventListener("click", ()=>{ closeWidgetError(el); }) } if (blue_btn) { blue_btn.addEventListener("click", ()=>{ closeWidgetError(el); }) } }) }); window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){ // Function to get URL parameters function getUrlParameter(name) { name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]'); var regex = new RegExp('[\\?&]' + name + '=([^&#]*)'); var results = regex.exec(location.search); return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' ')); } // Function to hide content based on the "userway" parameter function hideContentBasedOnUserway() { var userwayParam = getUrlParameter('userway'); if (userwayParam === 'off') { // Hide the content you want to hide document.getElementById('userway-override').style.display = 'none'; } } // Call the function when the page loads hideContentBasedOnUserway(); }); window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){ document.querySelector(".widget-overlay-error").addEventListener("click", (event) => { if(event.target.classList.contains("widget-overlay-error")) { document.querySelectorAll(".widget-error").forEach((widget) => { if (!widget.classList.contains("hidden")) { widget.classList.add("hidden"); } }) // Add "hidden" class to the clicked element document.querySelector(".widget-overlay-error").classList.add("hidden"); } }) }); window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){ document.addEventListener('contextmenu', function(event) { if (event.target.matches('img, .display-block.image-element, .section-header-full-img, .header-image, svg, .hero-home-texts, .truck-category-headline, .truck-promo, .truck-promo .promo-card-left-container, .truck-category-header')) { event.preventDefault(); } }); }); window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){ function getUrlParameter(name) { const urlParams = new URLSearchParams(window.location.search); return urlParams.get(name); } function setCookie(name, value, days, path) { const expires = new Date(Date.now() + days * 24 * 60 * 60 * 1000).toUTCString(); //document.cookie = `${name}=${value}; expires=${expires}; path=${path}; domain=pensketruckrental.com`; document.cookie = `${name}=${value}; expires=${expires}; path=${path}`; } function deleteCookie(name) { document.cookie = `${name}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`; } (function() { const clickref = getUrlParameter('clickref'); const partnercode = getUrlParameter('partnercode'); if(clickref && clickref != null) { setCookie('it_ptr_click_ref_id', clickref, 7, '/'); if(partnercode && partnercode != null) { setCookie('it_ptr_partner_code', partnercode, 7, '/'); } deleteCookie('penskelinkid'); deleteCookie('urlRef'); } })(); }); window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){ (function(d){var s = d.createElement("script");s.setAttribute("data-account", "NRnEL6ljSb");s.setAttribute("src", "https://cdn.userway.org/widget.js");(d.body || d.head).appendChild(s);})(document) }); window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){ let category_tab = document.querySelector(".tabs.categories"); // When the user clicks anywhere on the page, check if it's outside of the modal window.addEventListener("click", function(event) { if (event.target == category_tab) { // Clicked directly on the modal, do nothing return; } // Check if the clicked element is a child of the modal var modalChildren = category_tab.querySelectorAll("*"); for (var i = 0; i < modalChildren.length; i++) { if (event.target == modalChildren[i]) { // Clicked on a child element of the modal, do nothing return; } } // Clicked outside of the modal, close it category_tab.classList.remove("show-dropdown") }); // Update image quality function imageQuality(width, height, img) { let currentSrc = img.src; // Replace the width and quality parameters with new values let newSrc = currentSrc.replace(/width=\d+/i, `width=${width}`); newSrc = newSrc.replace(/height=\d+/i, `height=${height}`); img.src = newSrc; } //PREVENT WIDOW TEXT function onPageLoadAndResize() { let screenWidth = window.innerWidth; REBELMOUSE_STDLIB.createElementChangeListener(".press-posts .widget__headline a", function(item){ let characterCount = item.innerText.length; let spaceCount = (item.innerText.match(/\s/g) || []).length; let totalCount = characterCount + spaceCount; if (screenWidth >= 768 && screenWidth <= 1023) { if (totalCount >= 60 && totalCount <= 75) { item.parentNode.classList.add("widow-text"); } else { item.parentNode.classList.remove("widow-text"); } } if (screenWidth >= 1024 && screenWidth <= 1399) { if (totalCount >= 85 && totalCount <= 95) { item.parentNode.classList.add("widow-text"); } else { item.parentNode.classList.remove("widow-text"); } } if (screenWidth >= 1440) { if (totalCount >= 140 && totalCount <= 150) { item.parentNode.classList.add("widow-text"); } else { item.parentNode.classList.remove("widow-text"); } } }) if (screenWidth < 768) { REBELMOUSE_STDLIB.createElementChangeListener(".info-subsection .widget__head img", function(el){ let screenWidth = window.innerWidth; imageQuality(696, 464, el); }) } } onPageLoadAndResize(); // Event listener for page resize window.onresize = onPageLoadAndResize; }); window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){ window.onclick = function(e){ let element = document.querySelector('.language-selector'); if (element) { let elemChild = element.querySelector('span'); if(e.target != element && e.target != elemChild) { element.classList.remove('show-dropdown'); } } } REBELMOUSE_STDLIB.createElementChangeListener(".tabs.dropdown", function(el){ el.addEventListener("click", function(){ el.classList.toggle('show-dropdown') }) }) });