【问题标题】:Display message for 5 seconds显示信息 5 秒
【发布时间】:2012-05-11 03:03:09
【问题描述】:

我需要将以下消息显示 5 秒钟,然后将其隐藏。

显示消息的代码是;

Ext.Msg.alert("Alert","How are you?");

隐藏消息的代码是;

Ext.Msg.hide();

但是如何只为5 seconds 显示呢?

【问题讨论】:

    标签: cordova sencha-touch extjs sencha-touch-2


    【解决方案1】:
    var alertBox = Ext.Msg.alert("Alert","How are you?");
    setTimeout(function(){
       alertBox.hide();
    }, 
    5000);
    

    【讨论】:

      【解决方案2】:

      使用 setTimeout 应该可以解决问题:

      setTimeout(function () {
          Ext.Msg.hide();
      }, 5000);
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-06-03
        • 2021-08-03
        • 1970-01-01
        • 2011-03-26
        • 2011-11-07
        相关资源
        最近更新 更多