title: Close windows after X seconds with jquery
body: <p>I m trying to figure out how to solve this problem, then thing is that I need to close a window after 7 seconds everytime this is open, I can manage that the windows close but the time is still counting using SetInterval, then when I open again the windows probably will close because it passed some seconds so the time when the windows close is not exact.</p>
  
  <p>Here the code I m using , and this is the web - <a href="https://sergioboado.me/photography" rel="nofollow noreferrer">https://sergioboado.me/photography</a> </p>
  
  <pre><code>setInterval(function() {
    if ($(".sqs-lightbox-close")[0]){
    $(".sqs-lightbox-close")[0].click(function(){
      window.close()
    })
     window.clearTimeout(); 
  }
  }, 4000);
  </code></pre>
  
  <p>thanks for your help</p>