Sha256: c47d453cc26e75751c41dd5596ce85253d46a0de9ca3f87db37ce159a285057a
Contents?: true
Size: 1.09 KB
Versions: 1
Compression:
Stored size: 1.09 KB
Contents
<!-- no need for thumnails unless there is more then one image --> <% if product.images.size > 1 %> <ul id="product-thumbnails"> <% product.images.each do |i| %> <li><%= link_to(image_tag(i.attachment.url(:mini)), i.attachment.url(:product)) %></li> <% end %> </ul> <% end %> <% content_for :head do %> <script type="text/javascript" charset="utf-8"> jQuery(document).ready(function($){ $("#main-image").data('selectedThumb', $('#main-image img').attr('src')); $('ul#product-thumbnails li').eq(0).addClass('selected'); $('ul#product-thumbnails li a').click(function() { $("#main-image").data('selectedThumb', $(this).attr('href')); $('ul#product-thumbnails li').removeClass('selected'); $(this).parent('li').addClass('selected'); return false; }).hover( function() { $('#main-image img').attr('src', $(this).attr('href').replace('mini', 'product')); }, function() { $('#main-image img').attr('src', $("#main-image").data('selectedThumb')); } ); }); </script> <% end %>
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
kdmny-spree-0.0.1 | app/views/products/_thumbnails.html.erb |