以下是這種情況:我在aspx頁面上有多個div控件。我正在使用更新面板來避免頁面刷新。 div包含像按鈕,文本框控件:div與更新面板之間的轉換
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<div id="divEnvironment" runat="server" visible="true">
<asp:Button ID="btnCred" runat="server" OnClick="btnCred_Click" Text="Proceed" Width="100px" />
</div>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnCred" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>
<div id="divConfig" runat="server" visible="false">
<asp:TextBox ID="txtDoamin" runat="server" Width="430px"></asp:TextBox>
</div>
</ContentTemplate>
</asp:UpdatePanel>
在按一下按鈕,我必須提交數據(服務器回傳)以及切換div標籤的知名度,顯示下一格:
protected void btnCred_Click(object sender, EventArgs e)
{
SubmitData();
divEnvironment.Visible = false;
divConfig.Visible = true;
}
其工作正常,但我試圖實現的是divs之間的轉換應該平穩(具有延遲的轉換效果)。我試過這個:
div {
transition: visible 2s;
}
但它沒有奏效。其實問題是更新面板。它工作沒有他們,但與更新面板,CSS效果似乎並沒有工作。 請建議最好的方法來做到這一點。謝謝。
怎麼樣能見度:可見; 不透明度:1; 過渡:不透明度2s線性; –
其實問題是更新面板。它工作沒有他們,但與更新面板,CSS效果似乎並沒有工作。 –