getHiddenDimensions: function(element) { element = $(element); var check = element.ancestors(), restore = [], styles = []; check.push(element); // All *Width and *Height properties give 0 on elements with display none, // or when ancestors have display none, so enable those temporarily check.each(function(c) { if (c != element && c.visible()) return; restore.push(c); styles.push({ display: c.getStyle('display'), position: c.getStyle('position'), visibility: c.getStyle('visibility') }); c.setStyle({display: 'block', position: 'absolute', visibility: 'visible'}); }); var dimensions = {width: element.clientWidth, height: element.clientHeight}; restore.each(function(r, index) { r.setStyle(styles[index]); }); return dimensions; }