Accordion Scroll To Item in Grid-Frame

When an accordion opens, I want to scroll the page to be at the top of that accordion item.
I use this code, which usually does the job

$('.accordion')
.on("down.zf.accordion", function () {
  $('section').animate({scrollTop: $(this).offset().top - 100}, 'slow');
});

But now I’m using the Foundation Grid-Frame and somehow, if the accordion element is below the 100vh, it will just scroll to the Top of the Frame instead: