title: How can I trigger jquery event at random time intervals?
body: <p>I created a header using jquery.flip.js, found at <a href="https://github.com/nnattawat/flip" rel="nofollow noreferrer">https://github.com/nnattawat/flip</a>. The plugin allows several ways to trigger the flip, the two relevant ones are 'click' and 'hover'. I was hoping to have the div's flip at random intervals automatically. I did find a similar question on stackoverflow that Heretic Monkey suggested using a recursive approach (<a href="https://stackoverflow.com/questions/41450212/trigger-mouse-click-and-random-intervals">Trigger mouse click and random intervals</a>)...</p>
  <pre><code>var clickHand = function() {
    $(&quot;[id^='hand_'].handIcon&quot;).trigger('click');
    setTimeout(clickHand, (Math.random() * 3000) + 32000);
  }
  
  clickHand();
  </code></pre>
  <p>EDIT: sorry for not being clear. In the jquery code, the following method (?) handles the flip on click, however what I would like to do is have the  divs flip automatically (if possible) without a hover or click to trigger. I tried using a setTimeout inside attachEvents, but it seemed to cause an issue with the styling.</p>
  <pre><code>attachEvents: function() {
          var self = this;
          if (self.setting.trigger === &quot;click&quot;) {
            self.element.on($.fn.tap ? &quot;tap.flip&quot; : &quot;click.flip&quot;, $.proxy(self.clickHandler, self));
          } else if (self.setting.trigger === &quot;hover&quot;) {
            self.element.on('mouseenter.flip', $.proxy(self.hoverHandler, self));
            self.element.on('mouseleave.flip', $.proxy(self.unflip, self));
          }
          
        },
  </code></pre>
  <p>I am pretty new to javascript and am having a difficult time with this and any help would be appreciated.</p>
  <p>I created a simple codepen, demonstrating the 3D flip, <a href="https://codepen.io/coeyflyer/pen/eYZGymG" rel="nofollow noreferrer">https://codepen.io/coeyflyer/pen/eYZGymG</a>.</p>
  <p>Thank you for any suggestions,
  C</p>