Skip to content

Instantly share code, notes, and snippets.

@flinhong
Created April 16, 2021 12:28
Show Gist options
  • Save flinhong/bc6b3807789d8605a7ff3fc5129754b8 to your computer and use it in GitHub Desktop.
Save flinhong/bc6b3807789d8605a7ff3fc5129754b8 to your computer and use it in GitHub Desktop.
// footnote with protip
function footNote() {
if ($(".footnote").length != 0) {
$(".footnote").each(function () {
var target = $(this)
.attr("href")
.replace(":", "\\:");
var content =
$(target)
.html()
.split("&nbsp;")[0] + "</p>";
$(this).addClass("protip");
$(this).attr({
"data-pt-title": content,
"data-pt-position": "bottom",
"data-pt-scheme": "dark-transparent"
});
});
$.protip(); // initial protip.js
} else if ($(".protip").length != 0) {
$.protip();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment