Created
October 17, 2011 19:30
-
-
Save capndesign/1293533 to your computer and use it in GitHub Desktop.
Hovering Footnotes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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