The problem is that my scroll function is not scrolling properly on different screen resolutions. Problem is coming from the offset. Is there any way to have offset in percents? I've tried -10% for example but it didn't worked.
$(".scrollto_home").click(function (event) {
event.preventDefault();
var defaultAnchorOffset = 0;
var anchor = $('#home').attr('data-attr-scroll');
var anchorOffset = $('#home').attr('data-scroll-offset');
if (!anchorOffset)
anchorOffset = defaultAnchorOffset;
$('html,body').animate({
scrollTop: $('#home').offset().top - 100 - anchorOffset
}, 500);
});
The problem is that the scroll is going too far when going up on smaller resolutions that 1920x1080