I am looking for a solution where the anchor position is 100px below the top of the page instead of jumping to the very top. I prefer not to have any animations, and I want to avoid the anchor jumping twice.
I am seeking a universal fix for this issue.
I have attempted the following code but it doesn't seem to be working...
$("a.inpage").click(function (e) {
e.preventDefault();
$(":target").each(function () {
var targetpos = $(this).position();
var scrollpos = targetpos.top - 100;
window.scrollTo(0,scrollpos);
})
}
Thank you, David