Skip to content

Instantly share code, notes, and snippets.

@devdays
Created February 22, 2015 23:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save devdays/a9fe8a1736c41b62f465 to your computer and use it in GitHub Desktop.
Save devdays/a9fe8a1736c41b62f465 to your computer and use it in GitHub Desktop.
Sample for moving footnotes using jQuery plugin
(function ($) {
$.fn.footnote = function () {
// console.log("footnote");
var footnotes = this.find("span.footnote");
footnotes.each(function (key, value) {
//console.log("footnote" + key + " : " + $(value).contents().text());
var footnoteContentsNode = $(value).clone();
var footnoteNumberTextNode = document.createTextNode("[" + key + "] ");
$("#references").append(footnoteNumberTextNode).append(footnoteContentsNode).css("color", "blue").append("<br />");
$(value).text("[" + key + "] ").css("color", "blue").css("vertical-align", "super").css("font-size", "60%");
});
return footnotes;
};
}(jQuery));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment