Skip to content

Instantly share code, notes, and snippets.

@hsquareweb
Created August 3, 2012 15:58
Show Gist options
  • Save hsquareweb/3248941 to your computer and use it in GitHub Desktop.
Save hsquareweb/3248941 to your computer and use it in GitHub Desktop.
HTML+jQuery: Simple Show/Hide Toggle
<h3 class="showhide">&raquo; <a href="javascript:void(0)">Our Volunteers Make Us Strong</a></h3>
<div class="hidden" style="display: none;">
<p>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.</p>
</div>
<script type="text/javascript">
$(document).ready(function () {
$(".showhide").click(function () {
$(this).next().toggle('fast');
return false;
}).next().hide();
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment