I grab an array of jQuery objects and then through .each () it modifies every single jquery in the array.
In this case, I am updating the class names to call the -webkit-transition-property to use the css transition.
I want to have a pause before the start of each css transition. I use the following, but there is no delay between each update. Instead, they all seem to be updated immediately.
function positionCards() { $cards = $('#gameboard .card'); $cards.each(function() { setTimeout( function(){ addPositioningClass($(this)); }, 500 ) }); } function addPositioningClasses($card){ $card .addClass('position') }
I was hoping setTimeout would solve this, but it looks like it is not working. Is there a way to pause before each CLASS name update for each object?
jquery each settimeout
DA Mar 05 '11 at 7:32 2011-03-05 07:32
source share