Return to Snippet

Revision: 16020
at July 23, 2009 10:47 by Tate


Initial Code
<% if @players.size > 10 %>
  <style type="text/css">
    #player_list li img { width: <%= 1115 / @players.size %>px; height: <%= ((206/109.to_f) * (1115 / @players.size)).to_i %>px; }
  </style>
<% end %>

Initial URL

                                

Initial Description
1115px is the width of the containing ul, 206px x 109px is the size of the original images

Initial Title
Adjust the size of an image based on the amount of images in a row

Initial Tags

                                

Initial Language
Rails