diff --git a/script.js b/script.js index 3944ec6..2a5c59b 100644 --- a/script.js +++ b/script.js @@ -213,10 +213,15 @@ }); var sections = $('.section'); + var found = false; + sections.each(function (index) { - if ($(this).find('script[data-activity-id]').length > 0) { - // Hide all .section elements after this one - sections.slice(index + 1).css('visibility', 'hidden'); + if (!found && $(this).find('script[data-activity-id]').length > 0) { + // Set found to true when the first matching section is found + found = true; + } else if (found) { + // Hide all .section elements after the found one + $(this).css('visibility', 'hidden'); } }); })