The closest you can get is something like this, which calculates the auto
width, then updates the DOM style property using jQuery's .attr
$("button").click(function(){
$("#div1").animate(
{
marginLeft: 0
}, {
step: function(){
$('#div2').width('auto');
var width = $('#div2').width();
$('#div2').attr('style', 'width: ' + width + 'px;');
}
}, 5000
)
});
Overall this reallyisn't that useful because the browser inspector isn't an instantaneous change, so it jumps to the next values. Plus there is really no need for displaying the changes inline. If you want to display the change through another element (this shows immediate changes), then you can do so by using the same approach as my updated version of David Link's fiddle