by b3tta · 13y ago · 0 comments
Tim: A better approach would be to iterate through all children and find the maximum using elem.offset(Height|Width).
Then create a new <style> in the head for your plugin if it doesn't exist and append a new rule like:
style.innerHTML += '#' + (elem.id || (elem.id = 'eq' + (Date.now() % 1e9))) + '>*{' + equalize + ':' + val + '}';
If you don't like this you could still use elem.style.(width|height) (and maybe even detach the container beforehand to prevent unnecessary reflows), which will be faster and doesn't require a 90KB lib.Also, jQuery is 32KB minified and gzip'd AND that's if it's not already cached. Using the Google CDN helps as well, chances are you may not even be downloading it. Not looking to get into a jQuery vs. js debate.
"I don't always write jQuery, but when I do, I use Javascript"