Forum Moderators: phranque
<header style="position: fixed; height: 100px">
Blah blah blah
</header>
<main>
<a href="#10">Click</a>
blah blah blah
<a name="30">Results</a>
</main> if (
$('header').css('position') == 'fixed' &&
document.URL.toLowerCase().indexOf('#') !== -1
)
$('html, body').animate({ scrollTop: 102 }, 'slow'); <main>
<a class="shift" href="#10"></a>Click
blah blah blah
<a class="shift" name="30"></a>Result
</main>And in CSS: .shift {
display: block;
position: relative;
top: -100px;
visibility: hidden;
}This should move the position of the anchor 100 px above the position of the anchor text.