$(function() { $('.button').click(function(e) { $('.all').quicksand( $('.warm li'), { duration: 3000, attribute: 'id' }); e.preventDefault(); }); }); <ul class="colors all"> <li id="c463033" style="background: #463033"></li> <li id="c77343d" style="background: #77343d"></li> <li id="ce83f2f" style="background: #e83f2f"></li> <li id="cffc223" style="background: #ffc223"></li> <li id="cffdb59" style