我正在尝试像这样一起使用AlloyUI图和模态:
var Y = YUI().use(
'aui-diagram-builder',
'aui-button',
'aui-modal',
function (Y) {
var availableFields = [{
iconClass: 'aui-diagram-node-start-icon',
label: 'Start',
type: 'start'
}, {
iconClass: 'aui-diagram-node-task-icon',
label: 'Task',
type: 'task'
}];
var diagram = new Y.DiagramBuilder({
availableFields: availableFields,
boundingBox: '#myDiagramContainer',
srcNode: '#myDiagramBuilder'
}).render();
var modal = new Y.Modal({
bodyContent: 'Modal body',
centered: true,
headerContent: '<h3>Modal header</h3>',
modal: true,
render: '#modal',
width: 450
}).render();
..
});
但无论我为 z 值设置什么值,模态总是显示在图表下方。HTML 文件的结构如下:
<div id="myDiagramContainer">
<div id="myDiagramBuilder"></div>
</div>
<button id="showModal" class="aui-btn">Show Modal</button>
<div class="yui3-skin-sam">
<div id="modal"></div>
</div>
我错过了什么?