diff --git a/_includes/head.html b/_includes/head.html index 96c9454..00882df 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -61,7 +61,7 @@ - {% include js-selector.html %} diff --git a/_includes/js-selector.html b/_includes/js-selector.html index a892e2a..b02e076 100644 --- a/_includes/js-selector.html +++ b/_includes/js-selector.html @@ -18,8 +18,8 @@ {% if page.math %} - - + + {% endif %} {% if jekyll.environment == 'production' %} diff --git a/_includes/mermaid.html b/_includes/mermaid.html index 7c63656..6abef73 100644 --- a/_includes/mermaid.html +++ b/_includes/mermaid.html @@ -3,26 +3,27 @@ --> diff --git a/assets/js/_commons/back-to-top.js b/assets/js/_commons/back-to-top.js index 07532ae..21a91da 100644 --- a/assets/js/_commons/back-to-top.js +++ b/assets/js/_commons/back-to-top.js @@ -1,18 +1,21 @@ /* Reference: https://bootsnipp.com/snippets/featured/link-to-top-page */ -$(window).scroll(function() { - if ($(this).scrollTop() > 50 - && $("#sidebar-trigger").css("display") === "none") { - $("#back-to-top").fadeIn(); - } else { - $("#back-to-top").fadeOut(); - } -}); $(function() { + $(window).scroll(function() { + if ($(this).scrollTop() > 50 && + $("#sidebar-trigger").css("display") === "none") { + $("#back-to-top").fadeIn(); + } else { + $("#back-to-top").fadeOut(); + } + }); + $("#back-to-top").click(function() { - $("body,html").animate({scrollTop: 0}, 800); + $("body,html").animate({ + scrollTop: 0 + }, 800); return false; }); -}); \ No newline at end of file +});