兼容chrome与firefox使用offsetWidth得到不同值的问题
Ext3.x
?
Ext.MessageBox.alert 在chrome与firefox显示的宽度不一致问题
?
究其原因是因为msgEl.getWidth()得到的值不一致导致的
?
修正宽度应方法:
?
chrome:
?
rect = dom.getBoundingClientRect();
Math.ceil(rect.right - rect.left)
?
firefox:
?
dom.offsetWidth;
?
?
updateText : function(text) {if (!dlg.isVisible() && !opt.width) {dlg.setSize(this.maxWidth, 100);}msgEl.update(text ? text + ' ' : ' ');var iw = iconCls != '' ? (iconEl.getWidth() + iconEl.getMargins('lr')) : 0, mw = msgEl.getWidth()+ msgEl.getMargins('lr'), fw = dlg.getFrameWidth('lr'), bw = dlg.body.getFrameWidth('lr'), w;// @fixed chrome widthif (Ext.isChrome) {rect = msgEl.dom.getBoundingClientRect();mw = Math.ceil(rect.right - rect.left);}w = Math.max(Math.min(opt.width || iw + mw + fw + bw, opt.maxWidth|| this.maxWidth), Math.max(opt.minWidth || this.minWidth,bwidth || 0));??