I got a website which basically is 80% index.html plus a few minor subpages. Index.html is divided into few sections. However, the navigation has position:fixed and height of - say - 100px, so links like
<a href="#section">
need a 100px offset. I achieve it through jQuery (ill leave all ifs for specific sections out):
$("#navigation a").click(function() {
event.preventDefault();
var offset = $("#section1").offset().top - 100;
$(window).scrollTop(offset);
}
The problem is that when i navigate to index.html from subpages, this trick won't work, so i must not use this function on subpages and simply "allow default".
Is there a way to navigate to a #section of an other html document with a proper offset (cant be hard coded)?