Opens in a new tab
function updateHeaderHeight() {
        // Get the height of #brx-header
        const headerHeight = document.querySelector('#brx-header').offsetHeight;
          
        // Store the height in the CSS custom property --header-height
        document.documentElement.style.setProperty('--brxw-header-height', headerHeight + 'px');
    }

    // Execute the function as soon as the document is ready
    document.addEventListener('DOMContentLoaded', function() {
        updateHeaderHeight();  // Initial update of header height when the document is ready

        // Update the header height on window resize and orientation change
        window.addEventListener('resize', updateHeaderHeight);
        window.addEventListener('orientationchange', updateHeaderHeight);
});

joan-lluis-ferrer

Joan Lluis Ferrer

He holds a degree in Information Sciences from the University of the Basque Country (UPV-EHU). He has been the Environment Coordinator for the Prensa Ibérica group since 2020. He is the author of several books on the ecological and tourism problems of the Balearic Islands, including ‘Ibiza, the Destruction of Paradise’. Since the late 1980s, he has worked in various print, radio, and television media outlets.