Skip to content

Instantly share code, notes, and snippets.

@NickClark
Created September 13, 2010 20:47
Show Gist options
  • Save NickClark/578009 to your computer and use it in GitHub Desktop.
Save NickClark/578009 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.4.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
$('dl.update dd').hide();
$('dl.update dt').toggle(
function(e){
if(e.originalTarget === this){
$(this).next('dd').slideDown(500);
}
},
function(e){
if(e.originalTarget === this){
$(this).next('dd').slideUp(500);
}
});
});
</script>
</head>
<body>
<h2 class='update'> Collapsible Dictionary list test </h2>
<p>
Click <i>Title</i> to toggle. But if you click the link, it still toggles. Expect to go to link href.
</p>
<dl class='update'>
<dt>
Title
<a href="http://www.google.com"> Edit</a>
</dt>
<dd>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</dd>
</dl>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment