Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function setWidth() {
- var finalWidth = 0;
- var $collectionEl = $('.el');
- $collectionEl.each(function (indx, elem) {
- var elWidth = $(elem).width();
- if (elWidth > finalWidth) {
- finalWidth = elWidth;
- }
- });
- $collectionEl.css('min-width', finalWidth);
- }
- $(document).ready(function () {
- setWidth();
- });
- var resizeTimer;
- $(window).resize(function () {
- clearTimeout(resizeTimer);
- resizeTimer = setTimeout(function() {
- setWidth();
- }, 250);
- });
Add Comment
Please, Sign In to add comment