2016-09-20 68 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。