我在div中有一个表,并且div是模式框。我正在尝试使其淡入淡出(例如,通过“可见性”或“不透明度”选项使其缓慢可见),但是我可以使div的背景过渡,但是内容和表格会立即显示(而不是淡入) 。谁能帮我,因为这真让我发疯!谢谢。
<div id="ModalDiv" runat="server" class="ModalStartupClose">
<table id="customers" runat="server" class="customers">
<tr>
<th>Company</th>
<th>Contact</th>
<th>Country</th>
</tr>
<tr>
<td>Alfreds Futterkiste</td>
<td>Maria Anders</td>
<td>Germany</td>
</tr>
<tr>
<td>Berglunds snabbköp</td>
<td>Christina Berglund</td>
<td>Sweden</td>
</tr>
<tr>
<td>Centro comercial Moctezuma</td>
<td>Francisco Chang</td>
<td>Mexico</td>
</tr>
<tr>
<td>Ernst Handel</td>
<td>Roland Mendel</td>
<td>Austria</td>
</tr>
<tr>
<td>Island Trading</td>
<td>Helen Bennett</td>
<td>UK</td>
</tr>
<tr>
<td>Königlich Essen</td>
<td>Philip Cramer</td>
<td>Germany</td>
</tr>
</table>
</div>
css详细信息:
.customers {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%;
opacity: 0;
visibility: hidden;
}
.customers td, .customers th {
border: 2px solid #ddd;
padding: 8px;
opacity: 0;
color: red;
visibility: hidden;
}
.customersOpen {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%;
opacity: 1;
color: blue;
visibility: visible;
transition: opacity 3s 2s, color 3s 2s, visibility 3s 2s;
}
.customersOpen td, .customersOpen th {
border: 2px solid #ddd;
padding: 8px;
opacity: 1;
color: blue;
visibility: visible;
transition: opacity 3s 2s, color 3s 2s, visibility 3s 2s;
}
.customersOpen tr:nth-child(even) {
background-color: #f2f2f2;
}
.customersOpen tr:hover {
background-color: #ddd;
transition: background-color 2s;
}
.customersOpen th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
background-color: #4CAF50;
color: white;
}
以及使用vb.net包含在按钮中的代码:
customers.Attributes("class") = "customersOpen"