I have a question that was answered before probably, but I was not able to make a code work.
I have an <a href="#page-contact">
, and once the user click on it, it should scroll down (with animation) to a div with id "page-contact"
. It does take me to the form but with no animation
Here is the code:
<li class=""><a href="#page-contact">Contact</a></li>
<section id="page-contact" class="page-contact">
</section>
$('.page-contact').on('click', function(event) {
var target = $(this.href);
if( target.length ) {
event.preventDefault();
$('html, body').animate({
scrollTop: $("#page-contact").offset().top
}, "slow");
}
});