Created
February 22, 2015 23:30
-
-
Save devdays/a9fe8a1736c41b62f465 to your computer and use it in GitHub Desktop.
Sample for moving footnotes using jQuery plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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