Calculate largest width of a set of elements using jQuery

后端 未结 7 1003
轻奢々
轻奢々 2020-12-16 03:07

I have made a quick Jsbin: http://jsbin.com/ujabew/edit#javascript,html,live

What i\'m trying to achieve is to find out which is the largest

相关标签:
7条回答
  • 2020-12-16 04:11

    Here:

    var maxWidth = Math.max.apply( null, $( elems ).map( function () {
        return $( this ).outerWidth( true );
    }).get() );
    

    Live demo: http://jsfiddle.net/rM4UG/

    0 讨论(0)
提交回复
热议问题