You need to hook into the resize event:
$(window).resize(function(){ $('li img').each(function(){ console.log( $(this).width() ); }); });
If you want it to fire when the page loads, fire the resize event yourself:
$(window).resize(function(){ $('li img').each(function(){ console.log( $(this).width() ); }); }) .resize();
Here's the fiddle: http://jsfiddle.net/39JFQ/
If you need the total of all widths, use this:
$(window).resize(function(){ var totalWidths = 0; $('li img').each(function(){ totalWidths += $(this).width(); }); console.log(totalWidths); }) .resize();
Here is the script for this: http://jsfiddle.net/39JFQ/2/
You should replace the li img selector with something more specific.
source share