Trying to make the browser scroll to a specific ID with an added offset -
$(\'html, body\').animate({scrollTop: $(\'#contact\').offset().top}, \'slow\');
var top = ($(".apps_intro_wrapper_inner").offset() || { "top": NaN }).top;
if (!isNaN(top)) {
$("#app_scroler").click(function () {
$('html, body').animate({
scrollTop: top
}, 100);
});
}
if you want to scroll a little above or below from specific div that add value to the top like this.....like I add 800
var top = ($(".apps_intro_wrapper_inner").offset() || { "top": NaN }).top + 800;
No magic involved, just subtract from the offset top of the element
$('html, body').animate({scrollTop: $('#contact').offset().top -100 }, 'slow');