JSFiddle - React, Tailwind, and code Playground
by Addy Osmani
JavaScript
var winObj = $('<div>Left AND Top set to Zero</div>')
.hide()
.appendTo('body')
.css({
width : 100,
height : 100,
left : '100px',
top : '100px',
position : 'absolute',
opacity : 0
}).animate({
width : 420,
height : 150,
opacity : 1,
left : ($(window).width() / 2 - 210) + 'px',
top : Math.round($(window).height() / 5) + 'px'
}, 450, function() {
console.log('animation complete');
console.log(winObj.attr('style'));
console.log(winObj.css('left'));
console.log(winObj.css('top'));
});
console.log(winObj.attr('style'));
console.log(winObj.css('left'));
console.log(winObj.css('top'));