2011-05-31 61 views
1
<div dojoType="dijit.Dialog" id="errorDialog" title="An error occured" style="display: none"> 
<p id="errorMessage">An unexpected error occurred</p> 
<button dojoType="dijit.form.Button" type="submit" onClick="hideErrorDialog();"> 
OK 
</button> 

我可以将图像添加到dojo对话框吗?为了使它看起来像一个警告框或什么?以上是我目前的代码?添加图像(警报)到DOJO对话框

喜欢的东西

enter image description here

回答

1

您将需要一个名为 'alertIcon' CSS样式,喜欢的东西:当前版本1.6.1一些dijit.Dialog例子

.alertIcon { 
    width:32px; 
    height:32px; 
    background-repeat:no-repeat; 
    background: url("path/to/alert/icon/alertIcon.png"); 
} 

,这里是一些修改HTML:

<div dojoType="dijit.Dialog" id="errorDialog" title="An error occured" style="display: none"> 
<div> 
<span class="dijitInline alertIcon"></span> 
<span id="errorMessage" class="dijitInline">An unexpected error occurred</span> 
</div> 
<button dojoType="dijit.form.Button" type="submit" onClick="hideErrorDialog();"> 
OK 
</button>