ASP.NET 中的淡入和淡出
嗨,我有一个弹出窗口,出现时淡入,关闭时淡出。问题是淡出动画何时也会进行回发,我不希望这样,我希望它像模型弹出窗口中的属性 CancelControlID
一样工作。
注意
我无法将属性CancelControlID
设置为关闭按钮,因为这样就不会执行动画
查看代码
按钮
<asp:Button ID="btnNewPopUp" CssClass="btnNewPopUp" runat="server" Text="Crear Capas"/>
<asp:ModalPopupExtender BackgroundCssClass="modalBackground" DropShadow="true" OkControlID="btnOk" runat="server" PopupControlID="pnlPopUpSetLayers" id="mdlPopUp" TargetControlID="btnNewPopUp" >
</asp:ModalPopupExtender>
面板
<asp:Panel ID="pnlPopUpSetLayers" runat="server" CssClass="popUp" >
<table id="tbl" class="tableFinder">
<tr>
<td colspan="2">
<div class="header1">Crear capas</div>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblLayerName" CssClass="formatText" runat="server" Text="Nombre de la Capa"></asp:Label>
</td>
<td>
</td>
</tr>
</table>
<asp:Button ID="btnOk" runat="server" Text="Ok" />
<asp:Button ID="btnClose" runat="server" Text="Close Me" />
</asp:Panel>
动画
<asp:AnimationExtender id="MyExtender" runat="server" TargetControlID="btnNewPopUp">
<Animations>
<OnClick>
<FadeIn AnimationTarget="pnlPopUpSetLayers" Duration=".5" Fps="20" />
</OnClick>
</Animations>
</asp:AnimationExtender>
<asp:AnimationExtender id="AnimationExtender1" runat="server" TargetControlID="btnClose">
<Animations>
<OnClick>
<FadeOut AnimationTarget="pnlPopUpSetLayers" Duration=".5" Fps="20" />
</OnClick>
</Animations>
</asp:AnimationExtender>
Hi i'm hive a popup that appear's with fade In and close with fadeout. The problem it's when do the fadeout animation also makes a post back i don't want that, i want that works like the property CancelControlID
in the model popUp.
note
i can't set the property CancelControlID
to the close button because then doesn't do the animation
see the code
the Button
<asp:Button ID="btnNewPopUp" CssClass="btnNewPopUp" runat="server" Text="Crear Capas"/>
<asp:ModalPopupExtender BackgroundCssClass="modalBackground" DropShadow="true" OkControlID="btnOk" runat="server" PopupControlID="pnlPopUpSetLayers" id="mdlPopUp" TargetControlID="btnNewPopUp" >
</asp:ModalPopupExtender>
the Panel
<asp:Panel ID="pnlPopUpSetLayers" runat="server" CssClass="popUp" >
<table id="tbl" class="tableFinder">
<tr>
<td colspan="2">
<div class="header1">Crear capas</div>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblLayerName" CssClass="formatText" runat="server" Text="Nombre de la Capa"></asp:Label>
</td>
<td>
</td>
</tr>
</table>
<asp:Button ID="btnOk" runat="server" Text="Ok" />
<asp:Button ID="btnClose" runat="server" Text="Close Me" />
</asp:Panel>
the animations
<asp:AnimationExtender id="MyExtender" runat="server" TargetControlID="btnNewPopUp">
<Animations>
<OnClick>
<FadeIn AnimationTarget="pnlPopUpSetLayers" Duration=".5" Fps="20" />
</OnClick>
</Animations>
</asp:AnimationExtender>
<asp:AnimationExtender id="AnimationExtender1" runat="server" TargetControlID="btnClose">
<Animations>
<OnClick>
<FadeOut AnimationTarget="pnlPopUpSetLayers" Duration=".5" Fps="20" />
</OnClick>
</Animations>
</asp:AnimationExtender>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我个人讨厌动画扩展器...你考虑过改用 jQuery 吗?如果是这样,JavaScript 将像这样简单:
I personally hate the animation extenders...have you thought about changing to jQuery? If so, the JavaScript would be as easy as this: