Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS [Solved] Add spacer to anchor link? Reply To: [Solved] Add spacer to anchor link?

#157606
e6z6a6z
Participant

delete your javascript and try this:
$(document).ready(function() {
//Scroll Down Animation on Menu Click
$(‘a[href^=”#”]’).click(function(event) {
var id = $(this).attr(“href”);
var offset = 80;
var target = $(id).offset().top – offset;
$(‘html, body’).animate({scrollTop:target}, 1700);
event.preventDefault();
});
});

you can change the value of var offset=80;

and replace your back to top html with :
`

<a href="#content_wrap">Back to top</a>

`