I have five lines that look like this: This is ul with lis. I want the first li text to be equal to all lines. To do this, I need to find the widest li, and then apply a new one for all li.
(ul> li> span and ul)
Text> Lee 1 | li 2 | Lee 3
Textlong> Li 1 | li 2 | Lee 3
Short> Li 1 | li 2 | Lee 3
Longer13456> Li 1 | li 2 | Li 3
I used the following function to set the same heights. Slightly changed it. But that makes no sense!
function equalWidth() { var span = $('#tableLookAlike li.tr > span'), tallest = 0, thisHeight = 0; setEqWidth = function(elem) { elem.each(function() { widest = 0; thisWidth = $(this).outerWidth(); console.log(tallest, thisWidth)
The log shows 92, 69, 68, 118, when I delete the second item, and when I return it, it gives me 92, 130, 168, 206. Does anyone know what is going on here?
Aynway, how can I solve this?
patad source share