jQuery(window).on('load', function () { const $ = jQuery; // jQuery(document).ready(function($) { // if ($('body').hasClass('page-id-1963') || $('body').hasClass('page-id-2303')) { // $('.top-main-menu .elementor-nav-menu li a[href^="#"], .Nababur-mobile-menu li a[href^="#"]').attr('href', ''); // } // }); // Site Preloader js (function preloaderHandler(){ function hidePreloader() { $('body').addClass('site-loaded'); } if (document.readyState === 'interactive' || document.readyState === 'complete') { hidePreloader(); } else { $(document).ready(hidePreloader); } $(window).on('load', hidePreloader); })(); // Sticky Menu $(window).on('scroll', function () { if ($(window).scrollTop() < 50) { $(".header-top-main-menu").removeClass("sticky"); } else { $(".header-top-main-menu").addClass("sticky"); } }); // Remove br tag from mobile function removeBrFromHeadings() { if (window.innerWidth { link.addEventListener('click', function(e) { const targetId = this.getAttribute('href'); // Proceed only for hash-based internal links if (!targetId || !targetId.startsWith('#')) return; e.preventDefault(); // now safe to prevent const targetEl = document.querySelector(targetId); if (!targetEl) { console.warn(`Target not found for: ${targetId}`); return; } const headerOffset = 80; // Customize as needed (sticky header height) const elementPosition = targetEl.getBoundingClientRect().top; const offsetPosition = elementPosition + window.scrollY - headerOffset; // Smooth scroll using animation frame const startY = window.scrollY; const distance = offsetPosition - startY; const duration = 500; const startTime = performance.now(); function easeInOutQuad(t) { return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t; } function animateScroll(currentTime) { const timeElapsed = currentTime - startTime; const progress = Math.min(timeElapsed / duration, 1); const ease = easeInOutQuad(progress); window.scrollTo(0, startY + distance * ease); if (progress < 1) { requestAnimationFrame(animateScroll); } } requestAnimationFrame(animateScroll); }); }); jQuery(document).ready(function ($) { const isHomePage = window.location.pathname === '/' || window.location.pathname === '/index.php'; $('a[href^="#"]').on('click', function (e) { const hash = $(this).attr('href'); if (!hash || hash === '#') return; // If not on the homepage, redirect to homepage with hash if (!isHomePage) { e.preventDefault(); const redirectTo = window.location.origin + '/' + hash; window.location.href = redirectTo; } // else: do nothing, let smooth scroll work }); }); // Scrollspy (jQuery) jQuery(document).ready(function($) { // Cache selectors var lastId, topMenu = $(".header-top-main-menu .elementor-nav-menu"), topMenuHeight = 150, // offset to consider when scrolling // All list items menuItems = topMenu.find("a"), // Anchors corresponding to menu items scrollItems = menuItems.map(function(){ var href = $(this).attr("href"); if (!href || href.charAt(0) !== "#") return; var item = $(href); if (item.length) { return item; } }); $(window).scroll(function(){ // Get container scroll position var fromTop = $(this).scrollTop() + topMenuHeight; // Get id of current scroll item var cur = scrollItems.map(function(){ if ($(this).offset().top < fromTop) return this; }); // Get the id of the current element cur = cur[cur.length-1]; var id = cur && cur.length ? cur[0].id : ""; if (lastId !== id) { lastId = id; // Set/remove active class on links menuItems.removeClass("active") .filter("[href='#"+id+"']").addClass("active"); } }); // Trigger scroll handler on page load to set initial active $(window).trigger('scroll'); }); jQuery(document).ready(function ($) { $('.single-toggle-box').each(function () { const $box = $(this); const $btn = $box.find('.btn-less-gradient .elementor-button-link'); const $content = $box.find('.elementor-image-box-description'); $btn.on('click', function (e) { e.preventDefault(); $content.toggleClass('expanded'); // German button text $btn.text($content.hasClass('expanded') ? 'Weniger anzeigen' : 'Mehr anzeigen'); }); }); }); });
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique.