Commit 5140bd88 authored by Marin Jankovski's avatar Marin Jankovski

When anchor is clicked set the correct condition.

parent b1792d9e
......@@ -21,10 +21,12 @@ $(document).ready ->
$("html, body").animate
scrollTop: $(".navbar").offset().top - $(".navbar").height()
, 200
false
$("a").click (e) ->
unless location.hash is ""
$("a").click (event) ->
link = event.target
isAnchor = link instanceof HTMLAnchorElement
if (location.hash != "" || isAnchor)
$("html,body").animate
scrollTop: $(this).offset().top - $(".navbar").height() - 3
, 200
......@@ -5,10 +5,12 @@ $(document).ready ->
$("html, body").animate
scrollTop: $(".navbar").offset().top - $(".navbar").height()
, 200
false
$("a").click (e) ->
unless location.hash is ""
$("a").click (event) ->
link = event.target
isAnchor = link instanceof HTMLAnchorElement
if (location.hash != "" || isAnchor)
$("html,body").animate
scrollTop: $(this).offset().top - $(".navbar").height() - 3
, 200
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment