How to add a class, and the top margin to the script?

Hello!
How to add a class, and the top margin to this script?
$(document).ready(function(){
$("a[href*=#]").bind("click", function(e){
var anchor = $(this);
var name = anchor.attr("href").replace(new RegExp("#", "gi"), "");
$('html, body').stop().animate({
scrollTop: $("a[name=" + name + "]").offset().top
}, 700);
e.preventDefault();
return false;
});
});
July 8th 19 at 15:30
2 answers
July 8th 19 at 15:32
So
0fda7c910f94475d89bfac3c2fb83e5b.gif
XD Gorgeous - rachelle.Gutkows commented on July 8th 19 at 15:35
July 8th 19 at 15:34
On a subject - question will indicate if the answer above was not satisfied

Find more questions by tags JavaScript