Hey I’m wonder what’s the difference between these 2 codes? The first works but the 2nd doesnt?
First >>
for (i=0; i<$sequencingArray.length; i++){
...
$($sequencingArray[i]).delay(i*100).animate({'margin-left':$masterWidth});
...
}
Second >>
$propToAnimate = 'margin-left';
for (i=0; i<$sequencingArray.length; i++){
...
$($sequencingArray[i]).delay(i*100).animate({$propToAnimate:$masterWidth});
...
}
This is a working solution…
“You cannot use a variable as a property name inside an object literal.” from here