Skip to content

Instantly share code, notes, and snippets.

@visnup
Created February 5, 2010 21:42
Show Gist options
  • Save visnup/296291 to your computer and use it in GitHub Desktop.
Save visnup/296291 to your computer and use it in GitHub Desktop.
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('a').click(function() {
$(this).toggleClass('open').next().toggle('fast');
return false;
});
});
</script>
<style type="text/css">
a { text-decoration: none; }
a:before { content: '▸ '; }
a.open:before { content: '▾ '; }
</style>
</head>
<body>
<a href="#" class="open">file</a>
<ul>
<li>new
<li>open
</ul>
<a href="#" class="open">edit</a>
<ul>
<li>copy
<li>paste
</ul>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment