Sha256: 2e984d8621264731c6a53a9af059c8aa678d769b27b7da4f8a869e4b3376fd07

Contents?: true

Size: 1.08 KB

Versions: 6

Compression:

Stored size: 1.08 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 %>
<% 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

6 entries across 6 versions & 1 rubygems

Version Path
spree-0.8.4 app/views/products/_thumbnails.html.erb
spree-0.8.5 app/views/products/_thumbnails.html.erb
spree-0.8.0 app/views/products/_thumbnails.html.erb
spree-0.8.1 app/views/products/_thumbnails.html.erb
spree-0.8.2 app/views/products/_thumbnails.html.erb
spree-0.8.3 app/views/products/_thumbnails.html.erb