为什么淡入淡出效果在转换后不显示背景图像?使用 asp:UpdatePanelAnimationExtender

发布于 2024-12-13 02:21:26 字数 3500 浏览 0 评论 0原文

这是代码:

<body>
<form id="form1" runat="server">
<div>
<table width="100%">
<tr>
<td class="style1"></td>
<td class="style2">
<div id="back">
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></asp:ToolkitScriptManager>
    <asp:UpdatePanel ID="updPanel" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
    <asp:Timer ID="timer1" runat="server" Interval="5000" OnTick="Timer1_Tick"></asp:Timer>
    <asp:Table ID="Table1" runat="server" Width="100%">
        <asp:TableRow>
            <asp:TableCell CssClass="trborder">
                <asp:Label ID="Label1" runat="server" Text="Hello1"></asp:Label>
            </asp:TableCell>
            <asp:TableCell CssClass="trborder">
                <asp:Label ID="Label2" runat="server" Text="Hello2"></asp:Label>
            </asp:TableCell>
            <asp:TableCell CssClass="trborder">
                <asp:Label ID="Label3" runat="server" Text="Hello3"></asp:Label>
            </asp:TableCell>
        </asp:TableRow>
        <asp:TableRow>
            <asp:TableCell CssClass="trborder">
                <asp:Label ID="Label4" runat="server" Text="Hello1"></asp:Label>
            </asp:TableCell>
            <asp:TableCell CssClass="trborder">
                <asp:Label ID="Label5" runat="server" Text="Hello2"></asp:Label>
            </asp:TableCell>
            <asp:TableCell CssClass="trborder">
                <asp:Label ID="Label6" runat="server" Text="Hello3"></asp:Label>
            </asp:TableCell>
        </asp:TableRow>
        <asp:TableRow>
            <asp:TableCell CssClass="trborder">
                <asp:Label ID="Label7" runat="server" Text="Hello1"></asp:Label>
            </asp:TableCell>
            <asp:TableCell CssClass="trborder">
                <asp:Label ID="Label8" runat="server" Text="Hello2"></asp:Label>
            </asp:TableCell>
            <asp:TableCell CssClass="trborder">
                <asp:Label ID="Label9" runat="server" Text="Hello3"></asp:Label>
            </asp:TableCell>
        </asp:TableRow>
    </asp:Table>
    </ContentTemplate>
    </asp:UpdatePanel>
    <asp:AnimationExtender ID="upaeTopPanel" runat="server" TargetControlID="updPanel" BehaviorID="animation">
                    <Animations>                            
                        <OnUpdated>
                            <FadeIn Duration="1.5" Fps="30"></FadeIn>                                 
                        </OnUpdated> 
                    </Animations>
                </asp:AnimationExtender>
</div>
</td>
<td></td>
</tr>
</table>    
</div>
</form>

还有CSS:

 <style type="text/css">
    .trborder
    {
        border: solid 1px #000000;
    }
    #back
    {
        background-image: url(Images/mickey.jpg);
        background-position: center center;
        background-repeat: no-repeat;           
    }
    .style1
    {
        width: 317px;
    }
    .style2
    {
        width: 322px;
    }
</style>

Here is the code:

<body>
<form id="form1" runat="server">
<div>
<table width="100%">
<tr>
<td class="style1"></td>
<td class="style2">
<div id="back">
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></asp:ToolkitScriptManager>
    <asp:UpdatePanel ID="updPanel" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
    <asp:Timer ID="timer1" runat="server" Interval="5000" OnTick="Timer1_Tick"></asp:Timer>
    <asp:Table ID="Table1" runat="server" Width="100%">
        <asp:TableRow>
            <asp:TableCell CssClass="trborder">
                <asp:Label ID="Label1" runat="server" Text="Hello1"></asp:Label>
            </asp:TableCell>
            <asp:TableCell CssClass="trborder">
                <asp:Label ID="Label2" runat="server" Text="Hello2"></asp:Label>
            </asp:TableCell>
            <asp:TableCell CssClass="trborder">
                <asp:Label ID="Label3" runat="server" Text="Hello3"></asp:Label>
            </asp:TableCell>
        </asp:TableRow>
        <asp:TableRow>
            <asp:TableCell CssClass="trborder">
                <asp:Label ID="Label4" runat="server" Text="Hello1"></asp:Label>
            </asp:TableCell>
            <asp:TableCell CssClass="trborder">
                <asp:Label ID="Label5" runat="server" Text="Hello2"></asp:Label>
            </asp:TableCell>
            <asp:TableCell CssClass="trborder">
                <asp:Label ID="Label6" runat="server" Text="Hello3"></asp:Label>
            </asp:TableCell>
        </asp:TableRow>
        <asp:TableRow>
            <asp:TableCell CssClass="trborder">
                <asp:Label ID="Label7" runat="server" Text="Hello1"></asp:Label>
            </asp:TableCell>
            <asp:TableCell CssClass="trborder">
                <asp:Label ID="Label8" runat="server" Text="Hello2"></asp:Label>
            </asp:TableCell>
            <asp:TableCell CssClass="trborder">
                <asp:Label ID="Label9" runat="server" Text="Hello3"></asp:Label>
            </asp:TableCell>
        </asp:TableRow>
    </asp:Table>
    </ContentTemplate>
    </asp:UpdatePanel>
    <asp:AnimationExtender ID="upaeTopPanel" runat="server" TargetControlID="updPanel" BehaviorID="animation">
                    <Animations>                            
                        <OnUpdated>
                            <FadeIn Duration="1.5" Fps="30"></FadeIn>                                 
                        </OnUpdated> 
                    </Animations>
                </asp:AnimationExtender>
</div>
</td>
<td></td>
</tr>
</table>    
</div>
</form>

And the CSS:

 <style type="text/css">
    .trborder
    {
        border: solid 1px #000000;
    }
    #back
    {
        background-image: url(Images/mickey.jpg);
        background-position: center center;
        background-repeat: no-repeat;           
    }
    .style1
    {
        width: 317px;
    }
    .style2
    {
        width: 322px;
    }
</style>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

白况 2024-12-20 02:21:26

我已经弄清楚了该怎么做,根据Ajax库中描述的fadeIn效果,FadeInAnimation执行从当前不透明度到最大不透明度的淡入,所以我添加了一个小于1的值(这是顶部)

<FadeIn Duration="1.5" Fps="30" MaximumOpacity=".8"></FadeIn>

并且它起作用了。

谢谢。

I have figured it out how to do it, according to the fadeIn effect described in the Ajax library, the FadeInAnimation performs a fade in from the current opacity to the maximum opacity, so I added a value for that less than 1 (which is the top)

<FadeIn Duration="1.5" Fps="30" MaximumOpacity=".8"></FadeIn>

and it worked.

thanks.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文