How can I calculate the width of individual li with varying widths within a ul
<p>Say I have this list below.  Each image has a varying width and the a tag has a margin right of 15px which extends the list item a little more to give it some space from the next image.</p>

<pre><code>&lt;div id="otherproducts"&gt;
  &lt;ul&gt;
    &lt;li&gt;&lt;a href="products/sign-materials/"&gt;&lt;img border="0" src="assets/images/subbrands/slider/slider.png" alt="" /&gt;&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="products/sign-materials/"&gt;&lt;img border="0" src="assets/images/subbrands/slider/alight-slider.png" alt="" /&gt;&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="products/sign-materials/"&gt;&lt;img border="0" src="assets/images/subbrands/slider/eclider.png" alt="" /&gt;&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="products/sign-materials/"&gt;&lt;img border="0" src="assets/images/subbrands/slider/aluer.png" alt="" /&gt;&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="products/sign-materials/"&gt;&lt;img border="0" src="assets/images/subbrands/slider/alucr.png" alt="" /&gt;&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</code></pre>

<p>How can I get jquery to give me the correct width of the items in my calculation below so I can give the UL the correct total width because currently the total is coming out much greater than it should...</p>

<pre><code>var obj = $(this);              
var s = $("li", obj).length;
var w = $("li", obj).width(); 
var h = $("li", obj).height(); 
obj.width(w); 
obj.height(h); 
$("ul", obj).css('width',s*w);  
</code></pre>
