Apply a padding-top
to the .wrapper
class. An example could be padding-top:100px
to ensure that the content is not hidden under the navbar
. You can refer to this for more details.
Update:
Adjust your javascript by adding .offset().top -100
where 100 represents the height of the navbar, as shown below:
$("#circlediv").click(function() {
$('html, body').animate({
scrollTop: $("#benefits").offset().top-100
}, 2000);
});
Also, include the following script:
$(function() {
$('a[href*=#]:not([href=#])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top - 100
}, 1000);
return false;
}
}
});
});