Holidaymakers told the 'ideal way' to save money and beat the crowds during a staycation this month

Revealed - The perfect staycation locations in the UK |

GB NEWS

GB News

By GB News


Published: 03/09/2025

- 04:16

Heading up north can help you save on a last-minute August getaway

August is peak holiday season, with two-thirds of Britons taking a trip during the summer months. Sadly, this often leads to higher costs and larger crowds, especially for staycations.

However, there is a way families in England and Wales can save when booking a last-minute UK getaway before the month is up.


Caravan holiday provider, Parkdean Resorts, shared holidaying in Scotland offers a window of opportunity for families looking for an affordable break while beating the crowds.

The experts explained: "In Scotland, the school holidays start and finish earlier, with most pupils returning to school on Monday August 18, meaning many Scottish holidays enter off-peak pricing while England and Wales holidays are still on-peak."

St Andrews, Scotland

St Andrews is a beautiful choice for a Scottish holiday

|

GETTY

While this means families in Scotland might not be able to benefit from this, others can. There is a lot to discover on a Scottish staycation, whether visiting the iconic beaches in St Andrews, enjoying a historical trip to Edinburgh or a city break in Glasgow.

By booking just after Scottish schools go back, there are likely to be better deals available at holiday parks and hotels, and smaller crowds. Of course, Scots can also benefit from the lower prices if they are not planning to travel with school-aged children.

Chief marketing officer at Parkdean Resorts, Andy Edge, said: “Demand for staycations is high this summer, with families keen to make memories after another busy school year.

"With school holidays falling at different times across the UK, there are some fantastic chances to snap up a great deal on a caravan break.

"Scotland’s earlier school term dates mean our Scottish holiday parks have strong availability and some excellent deals during the second half of August. It’s perfect for families looking to make the most of their budget.

"For those in the North of England, a break across the border is just a short drive away, making it easy to enjoy a change of scenery without going far.

"Whether you’re after a beach escape or a Highland retreat, Scotland is an ideal choice for families, and a great way to beat the crowds."

Research from the holiday providers also showed there has been a spike in 'Scotland holidays', with 158,000 searches over the last month.

\u200bThe Scottish highlandsThe Scottish Highlands was praised for its beautiful landscapes | GETTY

Looking for inspiration for your Scottish break? A travel pro suggested that heading to the Highlands could be one of the most beautiful and affordable places to go.

Travel and tourism expert, Christian Petzold, said: "For outdoor-loving families or couples, the Highlands are unbeatable. You can pick up holiday parks and glamping pods for as little as £45 per night, and the main activities of hiking, wildlife spotting, and castles are free or very low-cost.

"Inverness is a great base, and you have a number of self-catering options under £70 per night, so this is a very cheap break with stunning scenery."

**ARE YOU READING THIS ON OUR APP? DOWNLOAD NOW FOR THE BEST GB NEWS EXPERIENCE**

More From GB News
}); window.REBELMOUSE_TASKS_QUEUE.push(function(){ // // Scroll position for primary navigation // const isMobile = window.innerWidth <= 768; // let menuButtonSize = 0; // const menuButton = document.querySelector('.navbar .nav .sticky-left-click'); // if (menuButton) { // menuButtonSize = menuButton.getBoundingClientRect().width; // } // var doc_body = document.body; // var pri_nav = document.querySelector('.navbar .nav'); // // Checking active primary menu item and calculating left scroll for the navigation // if (isMobile) { // const activeMenuItem = document.querySelector('.navbar .nav .nav--item.active'); // if (activeMenuItem) { // const activeMenuItemLeftPosition = activeMenuItem.offsetLeft; // const navigation = document.querySelector('.navbar .nav'); // const navigationComputedStyles = window.getComputedStyle(navigation); // const marginLeft = parseInt(navigationComputedStyles.getPropertyValue('margin-left')); // pri_nav.scrollLeft = activeMenuItemLeftPosition - marginLeft - menuButtonSize; // } // } else if (window.sessionStorage.getItem("pri_nav_pos")) { // pri_nav.scrollLeft = window.sessionStorage.getItem("pri_nav_pos"); // } // // The logic for the secondary menu wasn't changed // if (window.sessionStorage.getItem("sec_nav_pos") && window.sessionStorage.getItem("sec_nav_wrap")) { // var scrolli__item = document.querySelector('.'+window.sessionStorage.getItem("sec_nav_wrap")+' .list'); // if (scrolli__item) { // scrolli__item.scrollLeft = window.sessionStorage.getItem("sec_nav_pos"); // } // } // var pri_nav_items = pri_nav.querySelectorAll('a'); // var sec_nav_items = document.querySelectorAll('.navbar .secondary--nav a'); // // Function to restore active navigation states after page reload // function restoreActiveNavigation() { // // Restore active primary nav item // const activePriNavItem = sessionStorage.getItem('active_pri_nav_item'); // if (activePriNavItem) { // const priElement = document.querySelector(`[data-pri-nav-id="${activePriNavItem}"]`); // if (priElement) { // // Remove active class from all primary nav items first // document.querySelectorAll('.navbar .nav .nav--item').forEach(el => { // el.classList.remove('active'); // }); // priElement.classList.add('active'); // console.log('Restored active class to primary nav:', priElement); // } // } // // Restore active secondary nav item // const activeSecNavItem = sessionStorage.getItem('active_sec_nav_item'); // if (activeSecNavItem) { // const secElement = document.querySelector(`[data-sec-nav-id="${activeSecNavItem}"]`); // if (secElement) { // // Remove active class from all secondary nav items first // document.querySelectorAll('.navbar .secondary--nav .list__item').forEach(el => { // el.classList.remove('active'); // }); // secElement.classList.add('active'); // console.log('Restored active class to secondary nav:', secElement); // } // } // } // // Add unique identifiers to navigation items // function initializeNavigationIds() { // // Add IDs to primary nav items // pri_nav_items.forEach(function(item, index) { // const navItem = item.closest('.nav--item'); // if (navItem && !navItem.hasAttribute('data-pri-nav-id')) { // navItem.setAttribute('data-pri-nav-id', `pri-nav-${index}`); // } // }); // // Add IDs to secondary nav items // sec_nav_items.forEach(function(item, index) { // if (!item.hasAttribute('data-sec-nav-id')) { // item.setAttribute('data-sec-nav-id', `sec-nav-${index}`); // } // }); // } // // Primary navigation click handlers // pri_nav_items.forEach(function(item) { // item.onclick = function(event) { // console.log('Primary nav clicked:', event.target); // const navItem = event.target.closest('.nav--item'); // if (navItem) { // // Remove active class from all primary nav items // document.querySelectorAll('.navbar .nav .nav--item').forEach(el => { // el.classList.remove('active'); // }); // // Add active class to clicked primary nav item // navItem.classList.add('active'); // // Save active primary nav item to sessionStorage // const priNavId = navItem.getAttribute('data-pri-nav-id'); // if (priNavId) { // sessionStorage.setItem('active_pri_nav_item', priNavId); // console.log('Saved active primary nav item:', priNavId); // } // // Clear secondary nav active state when primary nav changes // sessionStorage.removeItem('active_sec_nav_item'); // document.querySelectorAll('.navbar .secondary--nav .list__item').forEach(el => { // el.classList.remove('active'); // }); // } // // Original sessionStorage handling // sessionStorage.removeItem("pri_nav_pos"); // sessionStorage.removeItem("sec_nav_wrap"); // sessionStorage.removeItem("sec_nav_pos"); // window.sessionStorage.setItem("pri_nav_pos", pri_nav.scrollLeft); // } // }); // // Secondary navigation click handlers (your existing code with modifications) // sec_nav_items.forEach(function(item) { // item.onclick = function(event) { // const target = event.target; // // Remove active class from all secondary nav items in current menu // const currentSecondaryNav = target.closest('.secondary--nav'); // if (currentSecondaryNav) { // currentSecondaryNav.querySelectorAll('.list__item').forEach(el => { // el.classList.remove('active'); // }); // } // // Add active class to clicked secondary nav item // target.classList.add('active'); // // Save active secondary nav item to sessionStorage // const secNavId = target.getAttribute('data-sec-nav-id'); // if (secNavId) { // sessionStorage.setItem('active_sec_nav_item', secNavId); // } // // Reset primary nav active state (optional, depending on your logic) // document.querySelectorAll('.navbar .nav .nav--item').forEach(el => { // el.classList.remove('active'); // }); // sessionStorage.removeItem('active_pri_nav_item'); // // Store scroll positions // sessionStorage.removeItem("sec_nav_wrap"); // sessionStorage.removeItem("sec_nav_pos"); // const sec_nav_wrap = target.closest('.list'); // if (sec_nav_wrap) { // sessionStorage.setItem("sec_nav_pos", sec_nav_wrap.scrollLeft); // const navItem = sec_nav_wrap.closest('.nav--item'); // if (navItem && navItem.classList[1]) { // sessionStorage.setItem("sec_nav_wrap", navItem.classList[1]); // } // } // sessionStorage.setItem("pri_nav_pos", pri_nav.scrollLeft); // }; // }); // // Hover effects for nav items // document.querySelectorAll('.nav--item').forEach(function(item) { // var timeout = null; // var timeout2 = null; // // Uncomment if you want hover effects // // item.onmouseover = function() { // // timeout = setTimeout(function(){ // // item.classList.add('hover_active') // // }, 300); // // clearTimeout(timeout2); // // } // // item.onmouseout = function() { // // timeout2 = setTimeout(function(){ // // item.classList.remove('hover_active') // // }, 300); // // clearTimeout(timeout); // // } // }); // // Initialize navigation system // function initializeNavigation() { // initializeNavigationIds(); // restoreActiveNavigation(); // } // // Initialize when DOM is ready // if (document.readyState === 'loading') { // document.addEventListener('DOMContentLoaded', initializeNavigation); // } else { // initializeNavigation(); // } // // Opinion section scroll handling // if (window.location.search=="?opinion") { // const opinionWidget = document.querySelector('.opinion-wrapper .widget'); // if (opinionWidget) { // if (/constructor/i.test(window.HTMLElement) || (function (p) { return p.toString() === "[object SafariRemoteNotification]"; })(!window['safari'] || (typeof safari !== 'undefined' && window['safari'].pushNotification))) { // opinionWidget.scrollIntoView(true); // } else if(typeof InstallTrigger !== 'undefined') { // opinionWidget.scrollIntoView(true); // } else { // opinionWidget.scrollIntoView({ // block: 'nearest', // behavior: 'smooth' // }); // } // } // } // // Delay function for mouse interactions // var delay = function (elem, callback) { // var timeout = null; // elem.onmouseover = function() { // elem.classList.add('shit') // // Set timeout to be a timer which will invoke callback after 1s // timeout = setTimeout(callback, 1000); // }; // elem.onmouseout = function() { // doc_body.classList.remove('hide-sec_nav'); // clearTimeout(timeout); // } // }; }); window.REBELMOUSE_TASKS_QUEUE.push(function(){ // Scroll position for primary navigation function init() { const isMobile = window.innerWidth <= 768; let menuButtonSize = 0; const menuButton = document.querySelector(".navbar .nav .sticky-left-click"); if (menuButton) { menuButtonSize = menuButton.getBoundingClientRect().width; } var doc_body = document.body; var pri_nav = document.querySelector(".navbar .nav"); var hamb_nav = document.querySelector(".hamburger .nav"); // Checking active primary menu item and calculating left scroll for the navigation const activeMenuItem = document.querySelector( ".navbar .nav .nav--item.active" ); if (activeMenuItem) { const activeMenuItemLeftPosition = activeMenuItem.offsetLeft; const navigation = document.querySelector(".navbar .nav"); const navigationComputedStyles = window.getComputedStyle(navigation); const marginLeft = parseInt( navigationComputedStyles.getPropertyValue("margin-left") ); pri_nav.scrollLeft = activeMenuItemLeftPosition - marginLeft - menuButtonSize; } if (!isMobile && window.sessionStorage.getItem("pri_nav_pos")) { pri_nav.scrollLeft = window.sessionStorage.getItem("pri_nav_pos"); } // The logic for the secondary menu wasn't changed if ( window.sessionStorage.getItem("sec_nav_pos") && window.sessionStorage.getItem("sec_nav_wrap") ) { var scrolli__item = document.querySelector( "." + window.sessionStorage.getItem("sec_nav_wrap") + " .list" ); if (scrolli__item) { scrolli__item.scrollLeft = window.sessionStorage.getItem("sec_nav_pos"); } } window.pri_nav_items = pri_nav.querySelectorAll("a"); window.sec_nav_items = document.querySelectorAll(".navbar .secondary--nav a"); window.hamb_nav_items = hamb_nav.querySelectorAll("a"); // Primary navigation click handlers pri_nav_items.forEach(function (item) { item.onclick = function (event) { console.log("Primary nav clicked:", event.target); const watchLive = event.target?.classList.contains('watch-live-button'); const navItem = event.target.closest(".nav--item"); if (navItem) { // Remove active class from all primary nav items (both navbar and hamburger) document.querySelectorAll(".navbar .nav .nav--item").forEach((el) => { el.classList.remove("active"); }); document .querySelectorAll(".hamburger .nav .nav--item") .forEach((el) => { el.classList.remove("active"); }); // Add active class to clicked primary nav item navItem.classList.add("active"); // Find corresponding item in hamburger menu and activate it const href = item.getAttribute("href"); const correspondingHamb = Array.from(hamb_nav_items).find( (a) => a.getAttribute("href") === href ); if (correspondingHamb) { const corrHambNavItem = correspondingHamb.closest(".nav--item"); if (corrHambNavItem) { corrHambNavItem.classList.add("active"); } } // Save active primary nav item to sessionStorage const priNavId = navItem.getAttribute("data-pri-nav-id"); if (priNavId) { if(watchLive){ let watchChannelActive = document.querySelector('.nav--item.watch--channel__active'); let activeMenuItemLeftPosition = watchChannelActive.offsetLeft; let navigation = document.querySelector(".navbar .nav"); let navigationComputedStyles = window.getComputedStyle(navigation); let marginLeft = parseInt(navigationComputedStyles.getPropertyValue("margin-left")); let targetScrollPosition = activeMenuItemLeftPosition - marginLeft - menuButtonSize; watchLiveLink = document.querySelector('.navbar .nav--item.watch--channel__active') watchLive_navId = watchLiveLink.getAttribute("data-pri-nav-id") watchLive_secId = watchLiveLink.querySelector('[aria-label="Live"]').getAttribute("data-sec-nav-id") sessionStorage.setItem("active_pri_nav_item", watchLive_navId); sessionStorage.setItem("active_sec_nav_item", watchLive_secId); window.sessionStorage.setItem("pri_nav_pos", targetScrollPosition); } else { sessionStorage.setItem("active_pri_nav_item", priNavId); console.log("Saved active primary nav item:", priNavId); } } // Clear secondary nav active state when primary nav changes if(!watchLive){ sessionStorage.removeItem("active_sec_nav_item"); } document .querySelectorAll(".navbar .secondary--nav .list__item") .forEach((el) => { el.classList.remove("active"); }); } // Original sessionStorage handling sessionStorage.removeItem("pri_nav_pos"); sessionStorage.removeItem("sec_nav_wrap"); sessionStorage.removeItem("sec_nav_pos"); if(!watchLive){ window.sessionStorage.setItem("pri_nav_pos", pri_nav.scrollLeft); } }; }); // Secondary navigation click handlers sec_nav_items.forEach(function (item) { item.onclick = function (event) { const target = event.target; // Remove active class from all secondary nav list__items document .querySelectorAll(".navbar .secondary--nav .list__item") .forEach((el) => { el.classList.remove("active"); }); // Add active class to the closest .list__item const listItem = target.closest(".list__item"); if (listItem) { listItem.classList.add("active"); } // Save active secondary nav item to sessionStorage const secNavId = target.getAttribute("data-sec-nav-id"); if (secNavId) { sessionStorage.setItem("active_sec_nav_item", secNavId); } // KEEP primary nav active and save it (if it's a sub-menu) const navItem = target.closest(".nav--item"); if (navItem) { const priNavId = navItem.getAttribute("data-pri-nav-id"); if (priNavId) { sessionStorage.setItem("active_pri_nav_item", priNavId); } } // Store scroll positions sessionStorage.removeItem("sec_nav_wrap"); sessionStorage.removeItem("sec_nav_pos"); const sec_nav_wrap = target.closest(".list"); if (sec_nav_wrap) { sessionStorage.setItem("sec_nav_pos", sec_nav_wrap.scrollLeft); const navItem = sec_nav_wrap.closest(".nav--item"); if (navItem && navItem.classList[1]) { sessionStorage.setItem("sec_nav_wrap", navItem.classList[1]); } } sessionStorage.setItem("pri_nav_pos", pri_nav.scrollLeft); }; }); // Watch Live button click handler const watchLiveButton = document.querySelector('.sticky-left .watch-live-button'); if (watchLiveButton) { watchLiveButton.onclick = function(event) { console.log('Watch Live button clicked:', event.target); // Find the nav--item with watch--channel__active active classes const watchChannelActive = document.querySelector('.nav--item.watch--channel__active.active'); if (watchChannelActive) { // Get the secondary navigation from this element const secondaryNav = watchChannelActive.querySelector('.secondary--nav'); if (secondaryNav) { // Find the active secondary nav item (Live) const activeSecondaryItem = secondaryNav.querySelector('.list__item.active'); if (activeSecondaryItem) { const secNavId = activeSecondaryItem.getAttribute('data-sec-nav-id'); if (secNavId) { sessionStorage.setItem('active_sec_nav_item', secNavId); console.log('Saved active secondary nav item from watch channel:', secNavId); } } // Save the watch channel primary nav as active const priNavId = watchChannelActive.getAttribute('data-pri-nav-id'); if (priNavId) { sessionStorage.setItem('active_pri_nav_item', priNavId); console.log('Saved active primary nav item from watch channel:', priNavId); } // Store scroll positions for secondary nav const secNavList = secondaryNav.querySelector('.list'); if (secNavList) { sessionStorage.setItem("sec_nav_pos", secNavList.scrollLeft); if (watchChannelActive.classList[1]) { sessionStorage.setItem("sec_nav_wrap", watchChannelActive.classList[1]); } } // Store primary nav scroll position sessionStorage.setItem("pri_nav_pos", pri_nav.scrollLeft); } } }; } // Hamburger navigation click handlers hamb_nav_items.forEach(function (item) { item.onclick = function (event) { console.log("Hamburger nav clicked:", event.target); const navItem = event.target.closest(".nav--item"); if (navItem) { // Remove active class from all primary nav items document.querySelectorAll(".navbar .nav .nav--item").forEach((el) => { el.classList.remove("active"); }); document .querySelectorAll(".hamburger .nav .nav--item") .forEach((el) => { el.classList.remove("active"); }); // Add active class to clicked hamburger nav item navItem.classList.add("active"); // Find corresponding item in primary nav and activate it const href = item.getAttribute("href"); const corresponding = Array.from( document.querySelectorAll(".navbar .nav .nav--item a") ).find((a) => a.getAttribute("href") === href); if (corresponding) { const corrNavItem = corresponding.closest(".nav--item"); if (corrNavItem) { corrNavItem.classList.add("active"); } } // Save active primary nav item to sessionStorage const priNavId = navItem.getAttribute("data-pri-nav-id"); if (priNavId) { sessionStorage.setItem("active_pri_nav_item", priNavId); console.log("Saved active primary nav item:", priNavId); } // Clear secondary nav active state when primary nav changes sessionStorage.removeItem("active_sec_nav_item"); document .querySelectorAll(".navbar .secondary--nav .list__item") .forEach((el) => { el.classList.remove("active"); }); } // Original sessionStorage handling sessionStorage.removeItem("pri_nav_pos"); sessionStorage.removeItem("sec_nav_wrap"); sessionStorage.removeItem("sec_nav_pos"); window.sessionStorage.setItem("pri_nav_pos", pri_nav.scrollLeft); }; }); // Hover effects for nav items document.querySelectorAll(".nav--item").forEach(function (item) { var timeout = null; var timeout2 = null; // Uncomment if you want hover effects // item.onmouseover = function() { // timeout = setTimeout(function(){ // item.classList.add('hover_active') // }, 300); // clearTimeout(timeout2); // } // item.onmouseout = function() { // timeout2 = setTimeout(function(){ // item.classList.remove('hover_active') // }, 300); // clearTimeout(timeout); // } }); } function restoreActiveNavigation() { const isMobile = window.innerWidth <= 768; if (isMobile) { console.log("Mobile detected - skipping sessionStorage restore"); return; } const activePriNavItem = sessionStorage.getItem("active_pri_nav_item"); const activeSecNavItem = sessionStorage.getItem("active_sec_nav_item"); // Always restore primary nav first (if it exists) if (activePriNavItem) { const priElement = document.querySelector( `.navbar [data-pri-nav-id="${activePriNavItem}"]` ); if (priElement) { // Clear all primary nav items document .querySelectorAll(".navbar .nav .nav--item") .forEach((el) => el.classList.remove("active")); document .querySelectorAll(".hamburger .nav .nav--item") .forEach((el) => el.classList.remove("active")); // Set primary nav as active priElement.classList.add("active"); console.log("Restored active class to primary nav:", priElement); // Activate corresponding hamburger item const priLink = priElement.querySelector("a"); if (priLink) { const href = priLink.getAttribute("href"); const correspondingHamb = Array.from(window.hamb_nav_items).find( (a) => a.getAttribute("href") === href ); if (correspondingHamb) { const corrHambNavItem = correspondingHamb.closest(".nav--item"); if (corrHambNavItem) { corrHambNavItem.classList.add("active"); console.log( "Restored active class to hamburger nav:", corrHambNavItem ); } } } } } // Then restore secondary nav (if it exists) if (activeSecNavItem) { const secElement = document.querySelector( `[data-sec-nav-id="${activeSecNavItem}"]` ); if (secElement) { document .querySelectorAll(".navbar .secondary--nav .list__item") .forEach((el) => el.classList.remove("active")); const listItem = secElement.closest(".list__item"); if (listItem) { listItem.classList.add("active"); console.log("Restored active secondary nav:", listItem); } } } } // Add unique identifiers to navigation items function initializeNavigationIds() { // Add IDs to primary nav items pri_nav_items.forEach(function (item, index) { const navItem = item.closest(".nav--item"); if (navItem && !navItem.hasAttribute("data-pri-nav-id")) { navItem.setAttribute("data-pri-nav-id", `pri-nav-${index}`); } }); // Add IDs to hamburger nav items hamb_nav_items.forEach(function (item, index) { const navItem = item.closest(".nav--item"); if (navItem && !navItem.hasAttribute("data-pri-nav-id")) { navItem.setAttribute("data-pri-nav-id", `pri-nav-${index}`); } }); // Add IDs to secondary nav items sec_nav_items.forEach(function (item, index) { if (!item.hasAttribute("data-sec-nav-id")) { item.setAttribute("data-sec-nav-id", `sec-nav-${index}`); } }); } // Initialize navigation system function initializeNavigation() { init(); initializeNavigationIds(); if(window.location.pathname === "/watch/live"){ restoreActiveNavigation(); } } // Initialize when DOM is ready // if (document.readyState === 'loading') { // document.addEventListener('DOMContentLoaded', initializeNavigation); // } else { // initializeNavigation(); // } REBELMOUSE_STDLIB.createElementChangeListener(".hamburger", function () { initializeNavigation(); }); // Opinion section scroll handling if (window.location.search == "?opinion") { const opinionWidget = document.querySelector(".opinion-wrapper .widget"); if (opinionWidget) { if ( /constructor/i.test(window.HTMLElement) || (function (p) { return p.toString() === "[object SafariRemoteNotification]"; })( !window["safari"] || (typeof safari !== "undefined" && window["safari"].pushNotification) ) ) { opinionWidget.scrollIntoView(true); } else if (typeof InstallTrigger !== "undefined") { opinionWidget.scrollIntoView(true); } else { opinionWidget.scrollIntoView({ block: "nearest", behavior: "smooth", }); } } } // Delay function for mouse interactions var delay = function (elem, callback) { var timeout = null; elem.onmouseover = function () { elem.classList.add("shit"); // Set timeout to be a timer which will invoke callback after 1s timeout = setTimeout(callback, 1000); }; elem.onmouseout = function () { doc_body.classList.remove("hide-sec_nav"); clearTimeout(timeout); }; }; }); window.REBELMOUSE_TASKS_QUEUE.push(function(){ var pri_nav = document.querySelector('.navbar .nav'); var secondary_navs = Array.from(document.querySelectorAll('.secondary--nav')); var sec_nav_left_btn = document.querySelector(".secondary--nav__arrow.left"); var sec_nav_right_btn = document.querySelector(".secondary--nav__arrow.right"); secondary_navs.map(item => { const left = sec_nav_left_btn.cloneNode(true); const right = sec_nav_right_btn.cloneNode(true); item.append(left); item.append(right) }); REBELMOUSE_STDLIB.createElementChangeListener('.primary--nav__arrow', function (item) { buttonNextPrevVisiblity(0, item, pri_nav, ""); item.addEventListener("click", function () { const scroll_distance = item.classList.contains('left') ? -(pri_nav.clientWidth) : pri_nav.clientWidth; pri_nav.scrollBy({ left: scroll_distance, behavior: 'smooth' }); buttonNextPrevVisiblity(770,item,pri_nav,item.classList.contains('left')?"left":"right") }) }) REBELMOUSE_STDLIB.createElementChangeListener('.secondary--nav .secondary--nav__arrow', function (item) { const secondary_nav = item.closest('.secondary--nav').querySelector('.list'); if (secondary_nav) { buttonNextPrevVisiblity(0, item, secondary_nav, item, ""); } item.addEventListener("click", function () { if (secondary_nav) { const scroll_distance = item.classList.contains('left') ? -calculateScrollDistance(secondary_nav) : calculateScrollDistance(secondary_nav); secondary_nav.scrollBy({ left: scroll_distance, behavior: 'smooth' }); buttonNextPrevVisiblity(770, item, secondary_nav, item.classList.contains('left') ? "left" : "right"); } }); }); function calculateScrollDistance(secondary_nav) { const navLeft = secondary_nav.getBoundingClientRect().left; window.nav_leftttt = secondary_nav; const list = secondary_nav.querySelectorAll('a'); const navWidth = secondary_nav.clientWidth; let scroll_distance = 0; let j = 0; while (j < list.length) { //debugger const item = list[j++]; const itemWidth = item.clientWidth; const itemLeft = item.getBoundingClientRect().left; if (itemWidth + 20 + scroll_distance < navWidth + 20 && (itemLeft >= navLeft && itemLeft + 2 < navWidth + navLeft)) { scroll_distance=scroll_distance+itemWidth + 20; } else if (itemWidth + 20 + scroll_distance > navWidth) { break; } } return scroll_distance; } function buttonNextPrevVisiblity(timeOffset, btn, scrolling_item, clicked) { //console.log('scrolling item scroll - ', scrolling_item.scrollWidth); if (scrolling_item.scrollWidth <= scrolling_item.clientWidth + 5 && btn.classList.contains('right')) { btn.classList.remove("hidden"); } setTimeout(sccc => { if (btn.classList.contains('left')) { //console.log('scroll left - ', scrolling_item.scrollLeft); scrolling_item.scrollLeft > 0 ? btn.classList.remove("hidden") : btn.classList.add("hidden"); } if (btn.classList.contains('right')) { if (scrolling_item.scrollWidth <= scrolling_item.clientWidth + scrolling_item.scrollLeft + 5) { btn.classList.add("hidden"); } else { btn.classList.remove("hidden"); } } if (clicked == "left") { btn.nextElementSibling.classList.remove("hidden"); } if (clicked == "right") { btn.previousElementSibling.classList.remove("hidden") } }, timeOffset); } }); window.REBELMOUSE_TASKS_QUEUE.push(function(){ REBELMOUSE_STDLIB.createElementChangeListener('.show-only-if-post-present', function (item) { if (!item.querySelector('.widget')) { item.classList.add('hidden'); if(item.nextSibling.classList.contains('ad--placeholder')){ item.nextSibling.remove(); } } }); REBELMOUSE_STDLIB.createElementChangeListener('.show-only-if-four-post-present', function (item) { if (item.querySelectorAll('.widget').length <= 3) { item.classList.add('hidden'); } }) REBELMOUSE_STDLIB.createElementChangeListener('.rebellt-ecommerce--price', function (item) { item.innerHTML = item.innerHTML.replace(/\$/g, '£'); }) }); window.REBELMOUSE_TASKS_QUEUE.push(function(){ // Piano object tp = window['tp'] || []; const addInfoToTP = () => { const preDefinedInfo = document.querySelector('.js-all-tags'); let allTags = `${preDefinedInfo.dataset.tags.replace(/[\[\]']+/g,'')}`; let primarySectionTitle = preDefinedInfo.dataset.contentSection; let postAuthor = preDefinedInfo.dataset.author; let postType = preDefinedInfo.dataset.contentType; let cd1 = preDefinedInfo.dataset.cd1; let cd2 = preDefinedInfo.dataset.cd2; let cd9 = preDefinedInfo.dataset.cd9; let cd11 = window.matchMedia('(display-mode: standalone)').matches ? 'pwa' : 'web'; // console.log(cd11); let cd12 = preDefinedInfo.dataset.cd12; let cd13 = preDefinedInfo.dataset.cd13; let cd14 = preDefinedInfo.dataset.cd14; let cd15 = preDefinedInfo.dataset.cd15; let cd16 = preDefinedInfo.dataset.cd16; let cd17 = preDefinedInfo.dataset.cd17; let cd18 = preDefinedInfo.dataset.cd18; let cd19 = document.referrer.split("/")[2] || 'not set'; let cd23 = 'not set'; let cd25 = window.navigator.userAgent; const getInfo = (string) => string.split('\':')[1].replace(/[&#,+()$~%.'"*?<>{}]/g, '').trim(); const passDataToTp = (type, data) => tp.push([type, data]); const passCustomDataToTp = (name, data) => tp.push(['setCustomVariable', name, data]); primarySectionTitle = getInfo(primarySectionTitle); passDataToTp('setContentSection', primarySectionTitle); postAuthor = getInfo(postAuthor); passDataToTp('setContentAuthor', postAuthor); postType = getInfo(postType); passCustomDataToTp('content_type', postType); cd1 = getInfo(cd1); passCustomDataToTp('cd1', cd1); cd2 = getInfo(cd2); passCustomDataToTp('cd2', cd2); cd9 = getInfo(cd9); passCustomDataToTp('cd9', cd9); passCustomDataToTp('cd11', cd11); cd12 = getInfo(cd12); passCustomDataToTp('cd12', cd12); cd13 = getInfo(cd13); passCustomDataToTp('cd13', cd13); cd14 = getInfo(cd14); passCustomDataToTp('cd14', cd14); cd15 = getInfo(cd15); passCustomDataToTp('cd15', cd15); cd16 = getInfo(cd16); passCustomDataToTp('cd16', cd16); cd17 = getInfo(cd17); passCustomDataToTp('cd17', cd17); cd18 = getInfo(cd18); passCustomDataToTp('cd18', cd18); passCustomDataToTp('cd19', cd19); passCustomDataToTp('cd23', cd23); passCustomDataToTp('cd25', cd25); return allTags.length ? passDataToTp('setTags', allTags) : false; } addInfoToTP(); });