Skip to content

Instantly share code, notes, and snippets.

@bradrobertson bradrobertson/gist:6177412
Last active Dec 20, 2015

Embed
What would you like to do?
jquery live example
# /app/views/contacts/index.html.erb
<div class="contacts">
<div class="contact" id="contact_1">
<p class='name'>Cool Dude 1</p>
<div class="details">...</div>
</div>
<div class="contact" id="contact_2">
<p class='name'>Cool Dude 2</p>
<div class="details">...</div>
</div>
...
</div>
<script>
$(function(){
$(".contact").live('click', function(){
$(this).find('.details').toggle();
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.