settimeout

    0熱度

    2回答

    我在使用的setTimeout我的反應,本機應用程序是這樣的: run() { console.log('test'); let x = setTimeout(()=>{ this.run(); }, 500); } componentDidMount() { this.run(); } 我測試了其上面的代碼,同時使其10個組件時間

    1熱度

    3回答

    我試圖用反應顯示閃爍的文字: class BlinkLable extends React.Component { constructor(props) { super(props); this.state = {showlabel: true, label: this.props.label }; this.myFuncti

    2熱度

    4回答

    工作,我需要點擊按鈕後只有5秒跑完的功能。 控制檯顯示此消息: VM9200:1 Uncaught ReferenceError: getId is not defined at :1:1 function getId() { $.getJSON("https://maxtechglobal.com/vencimientos/perfil/perfil.php?cuit="+$("#

    0熱度

    1回答

    我有一個事件來檢測鼠標或觸摸,並使用setTimeout將此事件發送到另一個函數。 我沒有問題檢測鼠標或觸摸事件,我不能做的是發送觸摸事件的功能。 $(divst + ' #sortable1').on('touchstart mousedown',function(e){ e.preventDefault(); setTimeout(function(){

    1熱度

    2回答

    我想在鼠標離開時將.close類添加到元素,然後我想刪除此類。 $("#nav > li").mouseleave(function(){ alert($(this).children(".subs").length); // value 1 $(this).children(".subs").addClass("close"); setTimeout(functio

    0熱度

    1回答

    我正在使用http://www.jquery-steps.com/Examples#advanced-form插件。 如何在兩步之間添加延遲? 我已經嘗試在onStepChanging和onStepChanged中添加超時功能,但它不起作用。 這裏是我的代碼如下所示: var form = $("#example-advanced-form").show(); form.steps({

    0熱度

    1回答

    我有一個ajax函數返回一個項目列表。然後我會獲取這些物品的一些定價信息。價格信息來自外部資源,速度有點慢,所以我總是加載這些項目來進行適當的DOM更改,然後獲取價格。問題是我需要延遲價格通話。我要的是如下: loadPricesDelayed delay 5sec loadPricesDelayed delay 5sec loadPricesDelayed delay 5sec lo

    0熱度

    1回答

    我想檢查一個變量是使用JavaScript等於1 ... myvalue = 1; function check() { if (myvalue == 1) { return setTimeout(check, 1000); } alert("Value Is Set"); } check(); <scr

    0熱度

    2回答

    我有一個工作負載組件,當它已被加載8秒鐘時取消。此代碼有效,但感覺對我來說,我想知道是否有更好的方法來做到這一點。 沒有設置this.mounted我得到的錯誤: Warning: Can only update a mounted or mounting component. This usually means you called setState, replaceState, or for

    0熱度

    2回答

    我正在使用Geolocation的離子科爾多瓦應用程序。 根據應用程序流程,有必要得到一個準確的位置。 我寫了專門的方法來實現位置,我在其中使用了setTimeout。 根據我的日誌,似乎我沒有正確使用setTimeout - 或者甚至最糟糕的是我選擇得不好,setTimeout不是我所需要的。 這是我的代碼: getFixedLocation() { let coordinates: