十五、UpdatePanelAnimation——带有动画效果的Updatepanel、DragPanel——拖放功能

 

UpdatePanelAnimation带有动画效果的Updatepanel

 

举例如下:

1.       添加一个ScriptManage

2.       添加一个UpdatePanel,并向其中添加一个button

3.       编写响应的button方法

    protected void Button1_Click(object sender, EventArgs e)

    {

        System.Threading.Thread.Sleep(6 * 1000);   //延时六秒

        Button1.Text = DateTime.Now.ToString();

    }

4.       添加一个UpdatePanelAnimation

        <asp:UpdatePanel ID="UpdatePanel1" runat="server">

            <ContentTemplate>

                <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />

            </ContentTemplate>

        </asp:UpdatePanel>

        <cc1:UpdatePanelAnimationExtender ID="UpdatePanelAnimationExtender1" runat="server" TargetControlID="UpdatePanel1">

            <Animations>

                <OnUpdated>             //更新后的动画

                    <Sequence>

                        <Parallel duration="2" Fps="30">            //动画

                            <Color StartValue="#ff3f3f" EndValue="#ffffff" Property="style" PropertyKey="backgroundColor"> </Color>

                        </Parallel>

                    </Sequence>

                </OnUpdated>

                <OnUpdating>            //更新时的动画

                    <Sequence>

                        <Parallel duration="2" Fps="30">

                            <EnableAction Enabled="true"></EnableAction>

                            <Color StartValue="#fffeee" EndValue="#eeefff" Property="style" PropertyKey="backgroundColor"> </Color>

                        </Parallel>

                    </Sequence>

                </OnUpdating >

            </Animations>

        </cc1:UpdatePanelAnimationExtender>

 

 

DragPanelExtender可以使Panel控件变得可拖动,要拖放一个元素,只需要简单的将其放入panel中,然后再将DragPanelExtender放到页面并设置属性就可以了,不过感觉它的作用不大

 

举例如下:

1.       添加一个ScriptManage

2.       添加一个Panel

        <asp:Panel ID="Panel1" runat="server">

            <div id="title" style="background-color:Blue;">title.....................title</div>

            <div id="content" style="background-color:Gray;">content<br /><br /><br />content</div>

        </asp:Panel>

3.       添加一个DragPanelExtender

        <cc1:DragPanelExtender ID="DragPanelExtender1" runat="server"

                               TargetControlID="Panel1"    // Panel控件的ID

                               DragHandleID="title">     //作为手柄的元素ID,该元素必须在被拖动的Panel

        </cc1:DragPanelExtender>

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值