jQuery min/max property from array of elements

前端 未结 8 1482
陌清茗
陌清茗 2020-11-29 02:09

Is there a simple way to find the min/max property from an array of elements in jQuery?

I constantly find myself dynamically resizing groups of elements based on the

8条回答
  •  感动是毒
    2020-11-29 02:15

    I wrote a simple plugin to do exactly this - see gregbrown.co.nz/code/jquery-aggregate . With it installed, you could do:

    var maxWidth = $('img').aggregate('width', 'max');

提交回复
热议问题