Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 1st, 2012  |  syntax: None  |  size: 0.58 KB  |  hits: 7  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. simple loop in coffeescript
  2. count = $content.find('.post').length;              
  3. for x in [1...count]
  4.     /*
  5.     prev_el_height += $("#content .post:nth-child(" + x + ")").height();
  6.     */
  7.     prev_el_height += $content.find(".post:nth-child(" + x + ")").height();
  8.        
  9. for (x = 1; x < count; x++) { prev_el ... }
  10.        
  11. for (x = 1; 1 <= count ? x < count : x > count; 1 <= count ? x++ : x--) {
  12.        
  13. for x in [1...count] by 1
  14.   ...
  15.        
  16. for (x = 1; x < count; x++) { /* ... */ }
  17.        
  18. for (x = 1; x > count; x--) { /* ... */ }
  19.        
  20. $('#content .post').each ->
  21.     prev_el_height += $(this).height()