/ Published in: Rails

1115px is the width of the containing ul, 206px x 109px is the size of the original images
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<% 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 %>
Comments
