format source
authorDan Allen <dan@opendevise.com>
Wed, 14 Aug 2019 00:15:07 +0000 (18:15 -0600)
committerDan Allen <dan@opendevise.com>
Wed, 14 Aug 2019 00:15:07 +0000 (18:15 -0600)
src/js/01-nav.js

index 3001c0d..3d1a8a7 100644 (file)
@@ -86,7 +86,7 @@
     var rect = panel.getBoundingClientRect()
     var effectiveHeight = rect.height
     var navStyle = window.getComputedStyle(nav)
-    if (navStyle.position === 'sticky') effectiveHeight -= (rect.top - parseFloat(navStyle.top))
+    if (navStyle.position === 'sticky') effectiveHeight -= rect.top - parseFloat(navStyle.top)
     panel.scrollTop = Math.max(0, (el.getBoundingClientRect().height - effectiveHeight) * 0.5 + el.offsetTop)
   }