$('.home-slide-button').on('click', function (e) {
var matches = window.location.hash.match(/^#([0-9]+)$/);
if (matches) {
var number = matches[1];
$('html, body').animate({
scrollTop: $('#' + number).offset().top -150
}, 1500);
}
});
When clicking on a product link in the "Home" Page (http://buchbinderei.it/) it should redirect to the "Produkte" Page (http://buchbinderei.it/produkte/) an scroll down smoothly to the clicked Product. Some how it doesn't calculate the top -150 offset… Any suggestions?
Actual Wrong Offset Position: https://www.dropbox.com/s/m3cbinuyl4d3pgv/Screenshot%202016-01-24%2022.47.55.png?dl=0
Desired Offset Position: https://www.dropbox.com/s/y0lhldjvult9kdg/Screenshot%202016-01-24%2022.48.49.png?dl=0