0
我想讓我的佈局更新另一個元素的寬度,但我需要在其寬度不包括其滾動條(如果一個確實存在)。在這種情況下getMainContentBounds()似乎與滾動條一起返回整個寬度。如何獲取不包含滾動條的layoutUnit的寬度?
我也嘗試過getSizes(),結果相同。
myDataTable.on('postRenderEvent', function() {
var bounds = YAHOO.specify.app.layout.getMainContentBounds();
Dom.setStyle(YAHOO.util.Selector.query('div.yui-dt-hd', c.body), 'width', bounds.width+'px');
Dom.setStyle(YAHOO.util.Selector.query('div.yui-dt-bd', c.body), 'width', bounds.width+'px');
});
你說得對,我本來應該一直做這種方式! – 2010-02-19 17:22:04