Skip to content

Instantly share code, notes, and snippets.

@mikeoberdick
Created April 14, 2021 00:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikeoberdick/fbcb64590cdfc23beeed54793d6b2aca to your computer and use it in GitHub Desktop.
Save mikeoberdick/fbcb64590cdfc23beeed54793d6b2aca to your computer and use it in GitHub Desktop.
function for setting a set of elements to match the widest in the set
$.fn.widest = function() {
return this.length ? this.width(Math.max.apply(Math, this.map(function() {
return $(this).width();
}))) : this;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment