我有一个Dojo Dialog box
使用dijit.Dialog
库。它出现在 a 的Rowclick
事件中Dojo grid
。现在,当它出现时,我希望它是透明的或降低它的不透明度,这样无论我的背景中是什么,我都能看到它,它看起来会很好。我的对话框是一个简单的<div> with data-dojo-type="dijit.Dialog"
.
代码是::
<div id="terms" name ="hi" data-dojo-type="dijit.Dialog" style="height:580px;width:900px;" data-dojo-props="title:'Control Activities'" preload="true">
<center><p><strong>EDIT AN ACTIVITY </strong></p></center>
<center><table>
<tr style="height: 50px">
<td style="width: 150px" align="right"><b>ASSIGNED BY :    </b></td>
<td style="width: 600px" align="left"><div id="plets"><input dojoType="dijit.form.ValidationTextBox" id="dassignedbyid" name="dassignedbyname" onfocus="hello()" required="true"></div>
<span dojoType="dijit.Tooltip" connectId="dassignedbyid">Enter Name</span></td>
<td style="width: 150px" align="right"><b>ASSIGNED TO :    </b></td>
<td style="width: 600px" align="left"><div id="plets1"><input dojoType="dijit.form.ValidationTextBox" id="dassignedtoid" name="dassignedtoname" onfocus="hello()" required="true"></div>
<span dojoType="dijit.Tooltip" connectId="dassignedtoid">Enter Name</span></td></tr>
</table></center>
</div>
并Dialog box id= terms
显示在此代码上::
dojo.connect(grid, "onRowClick", grid, function(){
var items = grid.selection.getSelected();
dojo.forEach(items, function(item){
var v = grid.store.getValue(item, "ActID");
getdetailsfordialog(v);
function showDialog(){
dojo.require('dijit.Tooltip');
dijit.byId("terms").show();
document.getElementById('closelabelspan').style.display = 'none';
document.getElementById('holdlabelspan').style.display = 'none';
document.getElementById('startlabelspan').style.display = 'none';
document.getElementById('cancellabelspan').style.display = 'none';
document.getElementById('updatelabelspan').style.display = 'none';
}
showDialog();
}, grid);
});
现在我希望当它dialog box(terms)
弹出时它是透明的。我也尝试了一个 CSS,但这对我不起作用::
<style>
div.transbox
{
width:900px;
height:580px;
background-color:#FFFFFF;
border:2px solid black;
opacity:0.6;
filter:alpha(opacity=60); /* For IE8 and earlier */
}
</style>
我正在使用 IE8。
这该怎么做 ?谢谢 ..
功能showDialog()
编辑::
function showDialog(){
dojo.require('dijit.Tooltip');
dijit.byId("terms").on("show", function() { dojo.style(this.domNode, "opacity", 0.3); });
dijit.byId("terms").show();
document.getElementById('closelabelspan').style.display = 'none';
document.getElementById('holdlabelspan').style.display = 'none';
document.getElementById('startlabelspan').style.display = 'none';
document.getElementById('cancellabelspan').style.display = 'none';
document.getElementById('updatelabelspan').style.display = 'none';
}