Team:Freiburg Bioware/jquery
From 2010.igem.org
(Difference between revisions)
Line 5: | Line 5: | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
- | |||
$(document).ready(function() { | $(document).ready(function() { | ||
- | |||
$("img").wrap('<div class="img" />'); | $("img").wrap('<div class="img" />'); | ||
$("img").after(function() { | $("img").after(function() { | ||
return '<div>' + this.alt + '</div>'; | return '<div>' + this.alt + '</div>'; | ||
}); | }); | ||
- | + | $(".pageContent").append("<ol id=\"footnotes\"></ol>"); | |
- | + | footnote = 1; | |
+ | $("footnote[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++; | ||
+ | }); | ||
}); | }); | ||
</script> | </script> |
Revision as of 20:54, 11 October 2010