Scroll the readme anchors below the navbar.
This commit is contained in:
parent
90e4b400ba
commit
b1792d9e4c
2 changed files with 29 additions and 0 deletions
|
@ -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
|
||||
|
|
14
app/assets/javascripts/tree_show.js.coffee
Normal file
14
app/assets/javascripts/tree_show.js.coffee
Normal 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
|
Loading…
Reference in a new issue