|
@@ -18,10 +18,8 @@ $(document).ready(function () {
|
|
|
// insertBefore <elem> prependTo <children /> appendTo </elem> insertAfter
|
|
|
|
|
|
// Create footnotes.
|
|
|
- // This works just as well, in spite of what the book says.
|
|
|
- // $('span.footnote').insertAfter('div.chapter');
|
|
|
- $('span.footnote')
|
|
|
- .insertBefore('#footer')
|
|
|
- .wrapAll('<ol id="notes"></ol>')
|
|
|
- .wrap('<li></li>');
|
|
|
+ var $notes = $('<ol id="notes"></ol>').insertBefore('#footer');
|
|
|
+ $('span.footnote').each (function (index) {
|
|
|
+ $(this).appendTo($notes).wrap('<li></li>');
|
|
|
+ });
|
|
|
});
|