Gravity simulation in jQuery

Example:

Touch the red strings to make the blocks fall.

Click here to rewind

Block 1
 
Block 2
Block 3
 
Block 4
Block 5
 
Block 6