Skip to content

Instantly share code, notes, and snippets.

View msmorgan's full-sized avatar

Michael Morgan msmorgan

View GitHub Profile
@msmorgan
msmorgan / gist:2511337
Created April 27, 2012 17:58 — forked from richardsondx/view
This is what I've done
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
var micropostIds = [<%= @microposts.map {|micropost| micropost.id }.join(',') %>];
$.each(micropostIds, function (index, value) {
$(".slidingDiv" + value).hide();
$(".show_hide" + value).show().click(function () {
$(".slidingDiv" + value).slideToggle();
});
});