jQuery(document).ready(function($) {
// Target Elementor TOC widget links
$('.elementor-toc__list-item-text-wrapper').parent().on('click', function(e) {
e.preventDefault();
// Get the target section ID from the href attribute
var targetSection = $(this).attr('href');
// Remove the # from the href to get the element ID
var targetId = targetSection.substring(1);
// Get the target element position
var targetPosition = $('#' + targetId).offset().top;
// Adjust for fixed headers if needed (modify this value as needed)
targetPosition = targetPosition - 80;
// Smooth scroll to the section without changing URL
$('html, body').animate({
scrollTop: targetPosition
}, 600);
});
});