Hi, I need to calculate the width between two elements but I'm not sure how I would go about this. Say I have the following:
<ul id="foo">
<li style="width:10px;"><a href="#">1</a></li>
<li style="width:20px;"><a href="#">2</a></li>
<li style="width:30px;"><a href="#">3</a></li>
</ul>
How would I calculate the distance between 1 and 3 (answer being 20px)? The width can be variable as can the number of list items? (I'm using the Prototype framework)
Thanks