If you only need children, do the following:
Example: http://jsfiddle.net/PV2dR/
var t=0; $('#parent > *').width(function(i,w){t+=w;});
Or you can do it with the same result:
var t=0; $('#parent').children().width(function(i,w){t+=w;});
user113716
source share