For Authors

For more than a century, AGU Publications has been supporting researchers to advance the Earth and space sciences.
`); } } function removePlaceholder() { $('.subNavPlaceholder').remove(); } function hasParentWithClass(element, className) { while (element.parentElement) { element = element.parentElement; if (element.classList.contains(className)) { return true; } } return false; } function updateSubNavWidth() { const hasColMd12Parent = hasParentWithClass(subNav, 'col-md-12'); const maxWidth = parseInt(window.getComputedStyle(fullWidthMenuList).maxWidth, 10); const currentWidth = fullWidthMenuList.offsetWidth; if (hasColMd12Parent) { if (window.innerWidth <= 768) { subNav.css('max-width', `${maxWidth}px`); } else { subNav.css('max-width', `${currentWidth}px`); } } else { subNav.css('max-width', '100%'); } } $(window).on('resize', updateSubNavWidth); updateSubNavWidth(); $(window).on('scroll', function () { const currentScrollY = window.scrollY; const scrollDifference = currentScrollY - lastScrollY; if (currentScrollY >= subNavInitialOffset) { addPlaceholder(); subNav.addClass('navigationFixedTop'); if (scrollDifference > 0) { currentTopSub = Math.max(0, currentTopSub - scrollDifference); } else if (scrollDifference < 0) { currentTopSub = Math.min(mainNavHeight, currentTopSub - scrollDifference); } subNav.css('z-index', `99`); subNav.css('top', `${currentTopSub}px`); } else { subNav.removeClass('navigationFixedTop'); subNav.css('top', ''); removePlaceholder(); currentTopSub = 0; } lastScrollY = currentScrollY; }); }); $(document).ready(function () { var navLinks = $('.fullWidthMenuItem'); var sectionIds = navLinks.map(function () { return $(this).attr('href'); }).get(); var filteredIds = sectionIds.filter(function (id) { return id.startsWith('#') && $(id).length > 0; }); if (filteredIds.length === 0) { return; } var sections = $(filteredIds.join(',')); $(window).on('scroll', function () { var scrollPosition = $(window).scrollTop() + 150; sections.each(function () { var sectionTop = $(this).offset().top; if (scrollPosition >= sectionTop) { var id = $(this).attr('id'); $('.fullWidthMenuTab').removeClass('activeTab'); var $activeTab = $('.fullWidthMenuItem[href="#' + id + '"]').parent(); $activeTab.addClass('activeTab'); $("#activeTabMobile").text($activeTab.find(".fullWidthMenuItemText").text().trim() || $activeTab.find(".fullWidthMenuItem").text().trim()); const tabElement = $activeTab[0]; if (tabElement && typeof tabElement.scrollIntoView === 'function') { tabElement.scrollIntoView({ behavior: 'smooth', inline: 'center', block: 'nearest' }); } } }); }); });