Skip to content

Instantly share code, notes, and snippets.

@capndesign
Created October 17, 2011 19:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save capndesign/1293533 to your computer and use it in GitHub Desktop.
Save capndesign/1293533 to your computer and use it in GitHub Desktop.
Hovering Footnotes
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
</head>
<body>
<p>I am a sentence that needs some additional information<sup><a href="#footnote-1-text" rel="footnote" id="footnote-1-link">1</a></sup></p>
<h4>Footnotes</h4>
<ol>
<li id="footnote-1-text">This is some more information. <a href="#footnote-1-link">Back</a></li>
</ol>
<script>
$('a[rel="footnote"]').hover(
function(){
$($(this).attr('href')).addClass('hovering');
},
function(){
$($(this).attr('href')).removeClass('hovering');
}
);
</script>
</body></html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment