尝试给你的标题窗格一个 id,然后添加如下所示的 evenhooks。要给一个小部件一个 id,只需将它作为id:'leftId'
. 在示例中,我将使用您的 classNames 作为 id。
dojo.addOnLoad(function() {
var wLeft = dijit.byId('leftTitlePane');
var wRight = dijit.byId('rightTitlePane');
dojo.connect(wLeft, 'onShow', function() {
wRight.domNode.style.display = 'none';
});
dojo.connect(wLeft, 'onHide', function() {
// wait a few for collapse to finish
setTimeout(function() {wRight.domNode.style.display = '';}, 120);
});
dojo.connect(wRight, 'onShow', function() {
wLeft.domNode.style.display = 'none';
});
dojo.connect(wRight, 'onHide', function() {
// wait a few for collapse to finish
setTimeout(function() {wLeft.domNode.style.display = '';}, 120);
});
});