Scroll the readme anchors below the navbar.

This commit is contained in:
Marin Jankovski 2015-01-13 13:01:50 +01:00
parent 90e4b400ba
commit b1792d9e4c
2 changed files with 29 additions and 0 deletions

View File

@ -13,3 +13,18 @@ class @ProjectShow
$("a[href=" + defaultView + "]").tab "show"
else
$("a[data-toggle='tab']:first").tab "show"
$(document).ready ->
$(window).load (e) ->
e.preventDefault()
unless location.hash is ""
$("html, body").animate
scrollTop: $(".navbar").offset().top - $(".navbar").height()
, 200
false
$("a").click (e) ->
unless location.hash is ""
$("html,body").animate
scrollTop: $(this).offset().top - $(".navbar").height() - 3
, 200

View File

@ -0,0 +1,14 @@
$(document).ready ->
$(window).load (e) ->
e.preventDefault()
unless location.hash is ""
$("html, body").animate
scrollTop: $(".navbar").offset().top - $(".navbar").height()
, 200
false
$("a").click (e) ->
unless location.hash is ""
$("html,body").animate
scrollTop: $(this).offset().top - $(".navbar").height() - 3
, 200