Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jakobbossek/jquery.footnote

Plugin for the jQuery framework. Allows to place footnotes in articles similar to LaTeX footnotes. Dynamically extracts the footnotes and appends them in a handy ordered list.
https://github.com/jakobbossek/jquery.footnote

Last synced: 3 days ago
JSON representation

Plugin for the jQuery framework. Allows to place footnotes in articles similar to LaTeX footnotes. Dynamically extracts the footnotes and appends them in a handy ordered list.

Awesome Lists containing this project

README

        

jquery.footnote
===============

Recently I had the idea to place footnotes in blog articles as it is done in LaTeX. There you simply place a \footnote{My footnote text} directive in the floating text and TeX handles the construction of the footnotes list at the bottom of the corresponding page. The footnote plugin for jQuery offers a similar functionality.

## Usage
In the following we take a glance at a simple example. Here we define an article containging some text and inside this text there is a nested footnote, marked up with the footnote class.

```HTML

Examplary article


Lorem ipsum Duis esse laborum id voluptate consectetur in veniam aute laboris
Amet eiusmod dolor consequat proident in voluptate
consectetur eu eiusmod officia veniam fugiat elit culpa in dolore elit.

```

In the header of out HTML document we simply load the current jQuery framework version and the footnote plugin. Finally we apply the footnote plugin to all ariticles if the DOM-tree is loaded entirely.

```HTML

...



jQuery(document).ready(function($) {
$("article").footnote();
});

...

```

This call results in a LaTeX-like transformation of the embeded footnotes. Each one is replaced by a incrementing number and placed at the bottom of the article. Moreover it it clickable. A click smoothly scrolls down the article to the corresponing footnote list item.

## Parameters
The plugin offers some means of customizability. Beside declaring the class attribute of the footnote list one can set the time in milliseconds for the smooth scroll animation and an optional callback handler. For details take a glance at the implementation.