It looks like the tween is complete before jQuery is ready.
$(function() {
TweenLite.to($('.list-item-container'), 1, {
width: $('.list-item-container').width() + 253,
delay: 0.25,
onComplete: function () {
var _item = $("<div/>");
$(_item).addClass('list-item');
$('.list-item-container').append(_item);
}
});
});
This also works for when I put it inside of a triggered event.
$("#button").on('click', function(){
TweenLite.to($('.list-item-container'), 1, {
width: $('.list-item-container').width() + 253,
delay: 0.25,
onComplete: function () {
var _item = $("<div/>");
$(_item).addClass('list-item');
$('.list-item-container').append(_item);
}
});
});
I created a JSBin that demonstrates it.
You might want to consider using an id to identify your list-item-container because
$('.list-item-container').append(_item);
will append _item
to every element with the list-item-container
class.
Good luck!