<%= image_tag "images/loading-spinner.gif", :class => "spinner" %> <%= image_tag photo.image_url, :class => "gallery_photo" %>
.gallery .image_frame img.gallery_photo { display: none; } $(function() { $('.gallery .image_frame img.gallery_photo').load(function() { $(this).show().siblings('.spinner').hide(); }); });