From 129e9563a2919b5fcf74d0c3ceab9ed34ec29840 Mon Sep 17 00:00:00 2001 From: Ivan Miskovic Date: Sat, 14 Jan 2012 19:45:08 +1300 Subject: [PATCH] Calculate heading height properly --- resources/app.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/app.js b/resources/app.js index 882d9b3..c680e3b 100644 --- a/resources/app.js +++ b/resources/app.js @@ -23,6 +23,7 @@ $(document).ready(function() { } var calcNsPositions = function() { + var hheight = $('.docs-header').first().height(); var nss = [] var anchors = [] var positions = [] @@ -31,7 +32,7 @@ $(document).ready(function() { nss.push(ns) var a = $("a[name='"+ns+"']") anchors.push(a) - positions.push(a.offset().top - 50) + positions.push(a.offset().top - hheight) // console.log(a.offset().top) });