I’ve added the suggested code to the page to allow elements to scroll to specific areas of the page, and I’ve set up the buttons with the correct #anchor elements. This is the code I used:
<script>
lp.jQuery(function($) {
// The speed of the scroll in milliseconds
var speed = 1000;
// Find links that are #anchors and scroll to them
$('a$href^=#]')
.not('.lp-pom-form .lp-pom-button')
.unbind('click.smoothScroll')
.bind('click.smoothScroll', function(event) {
event.preventDefault();
$('html, body').animate({ scrollTop: $( $(this).attr('href') ).offset().top }, speed);
});
});
</script>
However when I click the buttons nothing happens and there is an error in the console that says
Uncaught TypeError: Cannot read property ‘top’ of null