I've never heard of Zurb before, but you need to modify the function that adds/removes the active
class. See the code here:
https://github.com/zurb/foundation/blob/master/js/foundation/foundation.accordion.js
I recommend changing line 33 from this:
target.addClass(settings.active_class);
to this
$('html, body')
.animate({ scrollTop: target.offset().top }, 2000)
.promise()
.done(function() {
target.addClass(settings.active_class);
});
But I haven't tried it so I don't know if it will actually work D:
It should take 2 seconds (look for the 2000
) to scroll, and when that's done, add the class like before