Oh ... you want to make sure the width of the li adds up to the width of all
the images? The earlier snippet just made sure the li was as wide as the
widest image. You could do something like this to add up all the widths.
var width = 0;
$.each( $('li.hello img').widths(), function(i,w){ width +=
Hi Brandon!
in your blog post you ask for suggested features.
Frankly i'm stunned by how in one line you addition all the widths values
(although i didn't expect less from you). Personally, I had to loop through
the returned array in order to achieve that.
Wouldn't it be a nice feature to add som
I misspelled reverse in my code example... It should be:
var width = $('li.hello img').widths().sort().reverse()[0];
$('li.hello').animate({ width: width }, 'slow');
--
Brandon Aaron
On May 9, 9:47 am, "Brandon Aaron" <[EMAIL PROTECTED]> wrote:
> Close but in your example newWidths is an array
Close but in your example newWidths is an array of numbers. In your case
you'll want a way to extract the largest width from the array and then use
that value to animate the li width. Maybe something like this.
var width = $('li.hello img').widths().sort().revers()[0];
$('li.hello').animate({ widt
Brandon, i believe this is a clever little plugin. I i understand correctly,
here is a real life example i experienced just 2 days ago where i had such
markup:
5 matches
Mail list logo