I am using jquery scrollTop(), and I have some issues
This is HTML
<a class="jumper" href="#first">Jump</a>
<div class="first"></div>
<div id="second"></div>
<div id="third"></div>
<div id="fourth"></div>
<div id="fifth"></div>
And Jquery
$(document).ready(function () {
$('.jumper').click(function () {
$('html, body').animate({
scrollTop: $("#fourth").offset().top
}, 2000);
});
});
It is working OK, but what i need, is not to scroll element #third to top of page, just to scroll it little under about few px smaller like 100px, because i want to leave something in previous element to be seen to, is that possible?
Here is working fiddle
I want to leave yellow element to be seen abaout 100px?
$("#fourth").offset().top - 100?