Team:Freiburg Bioware/jquery
From 2010.igem.org
(Difference between revisions)
Line 16: | Line 16: | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
$(document).ready(function() { | $(document).ready(function() { | ||
- | + | $("#wrap").append("<ol id=\"footnotes\"></ol>"); | |
+ | footnote = 1; | ||
+ | $("span[title],blockquote[cite],blockquote[title]").addClass("footnote"); | ||
+ | $(".footnote").each(function() { | ||
+ | $(this).append("<sup>"+footnote+"</sup>"); | ||
+ | cite="<li>"; | ||
+ | url=$(this).attr("cite"); | ||
+ | title=$(this).attr("title"); | ||
+ | if(title && url) { | ||
+ | cite+="<a href=\""+url+"\">"+title+"</a>"; | ||
+ | } else if(title) { | ||
+ | cite+=title; | ||
+ | } else if(url) { | ||
+ | cite+="<a href=\""+url+"\">"+url+"</a>"; | ||
+ | } | ||
+ | cite+="</li>"; | ||
+ | $("#footnotes").append(cite); | ||
+ | footnote++; | ||
+ | }); | ||
+ | }); | ||
+ | |||
+ | $(".pageContent").append("<ul id=\"footnotes\"></ul>"); | ||
footnote = 1; | footnote = 1; | ||
$("q[title],blockquote[cite],blockquote[title]").addClass("footnote") | $("q[title],blockquote[cite],blockquote[title]").addClass("footnote") | ||
Line 33: | Line 54: | ||
footnote++; | footnote++; | ||
}); | }); | ||
- | |||
</script> | </script> | ||
</head> | </head> | ||
</html> | </html> |
Revision as of 21:36, 11 October 2010