The goal is to find the width of the widest word here.
The text is a sentence consisting of words with different fonts, as shown in the image.
the html looks like :
<span style="font:bold 14px Verdana;">LONGESTW</span>
<span style="font:bold 42px Verdana;">ORD</span>
<span style="font:bold 14px Verdana;"> </span>
<span style="font:bold 24px Verdana;">ORD</span>
<span style="font:bold 14px Verdana;"> </span>
<span style="font:bold 24px Verdana;">regular</span>
<span style="font:bold 14px Verdana;"> </span>
<span style="font:bold 32px Verdana;">w</span>
<span style="font:bold 96px Verdana;">id</span>
<span style="font:bold 64px Verdana;">est</span>
So, here the 3rd word is the widest. Any ideas? Everything is html and we can use any thing ( jquery,ES5 techniques etc).
I think this pretends to be a solution.
http://jsfiddle.net/WtcEQ/4/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With