2016-09-20 65 views
0

我已經爲使用下面的JavaScript電子郵件收件箱自動刷新:隱藏工具提示時,單擊事件發生

setInterval(function() { 
      document.getElementById("emailReload").click(); 
      }, 
     120000 
); 

,但它也觸發提示出現其在屏幕上顯示。爲了防止我試圖隱藏它點擊事件:

setInterval(function() { 
     document.getElementById("emailReload").click(function() { 
      $('div[id="opentip-5"]').css("visibility","hidden"); 
     }); 
     }, 
    120000 
    ); 

但這是不符合我的預期。

工具提示HTML代碼如下所示:

<div id="opentip-5" class="opentip-container style-standard ot-fixed ot-show-effect-fade ot-hide-effect-fade stem-center stem-top ot-visible" style="position: absolute; width: 151px; left: 147px; top: 48px; z-index: 105; transition-duration: 0.2s; visibility: visible;"> 
<canvas width="153" height="40" style="position: absolute; width: 153px; height: 40px; left: -1px; top: -6px;"></canvas> 
<div class="opentip"> 
    <div class="ot-header"></div> 
    <div class="ot-content">Reload Message List</div> 
</div> 
</div> 

有什麼想法?

+1

請提供完整的代碼示例,如JSFiddle。 – Feathercrown

+0

@ Feathercrown這是一個完整的代碼,我已經添加到默認Rainloop代碼 – JackTheKnife

+0

啊。對不起'回合。 – Feathercrown

回答

0

得到解決

setInterval(function() { 
    document.getElementById("emailReload").click(); 
    document.getElementById("opentip-5").setAttribute('style','visibility: hidden'); 
    }, 
    12000 
); 

貌似Rainloop做不僅方便用戶的jQuery只是純粹的JavaScript。