时间延迟后出现面板?

时间:2009-12-12 07:10:48

标签: javascript

我想将面板大小更改为在特定时间自动崩溃::

这是我的代码:

<html>
<head runat="server">
    <title></title>
</head>
<body   onLoad = "StartClock()"  onunload = "KillClock()">
<script language="JavaScript"> 
 <!--
       var ftext ;
               var clockID = 0;
              var g;
               function UpdateClock() {
                   if (clockID) {
                       clearTimeout(clockID);
                       clockID = 0;
                   }
                   var tDate = new Date();
                   g = ""
                                   + tDate.getHours() + ":"
                                   + tDate.getMinutes() + ":"
                                   + tDate.getSeconds();
                   if (ftext == null) {
                                             ftext = prompt("message time:", "");
                   }
                                   if (g == ftext) {
                                          <%--*here i want the panel to be collapse*--%>
                       g = 0;
                  }

                  if (g == 0)
                  { null }
                  else{
                      clockID = setTimeout("UpdateClock()", 1000);
                  }

               }

               function StartClock() {
                   if (g == 0)
                   { null }
                   else{

                       clockID = setTimeout("UpdateClock()", 500);
                   }
                                  }
               function KillClock() {
                   if (clockID) {
                       clearTimeout(clockID);
                       clockID = 0;
                   }
               }
 //-->
</script>



    <asp:Panel ID="Panel1" runat="server" Height="96px" Width="195px">
    <table style="height: 96px; width: 194px">
    <tr><td></td></tr>

    <tr><td>
        <asp:Label ID="Label3" runat="server" Text="Label"></asp:Label>
        </td></tr>

    </table>
    </asp:Panel>

      </form>
      </body>
</html>

我有时钟,但我想要折叠我标有<%-- *here i want the panel to be collapse* --%>的面板。我希望它在页面加载时被隐藏,然后在时间到来时,如果可能的话,会出现崩溃,移动或淡入淡出效果。

1 个答案:

答案 0 :(得分:0)

jQuery JavaScript框架对于此类事情非常有用。它包括用于显示面板的effects负载,如淡入淡出,滑动或动画效果。