Created
September 9, 2013 15:28
-
-
Save rderoldan1/6497198 to your computer and use it in GitHub Desktop.
Simple photo gallery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ -> | |
$('.gallery .image').click -> | |
element = $(this).find("img").attr("src") | |
$('#image').hide(); | |
$('#image').fadeIn('slow'); | |
$('#image img').attr("src", element) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="gallery"> | |
<div id="image"><%= image_tag @user.photos.first.documento %></div> | |
<% @user.photos.each do |d| %> | |
<div class="image"><%= image_tag d.photo %></div> | |
<% end %> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment