Idle plugin

Idle plugin

Hello all,

I'm using this plugin:  https://github.com/kidh0/jquery.idle

...like this:

  1. $(document).idle({
  2.             onIdle: function(){
  3.                   if(timer + 1) return;                    
  4.                 _slide();
  5.             },
  6.             onActive: function(){
  7.                 if(currEl) currEl.removeClass(addclass);
  8.                 if(timer + 1) clearInterval(timer);
  9.            timer = -1;
  10.             },
  11.             idle: idleTime
  12.         });

...and am quite happy with it.

I would now like to trigger an event programmatically to invoke this handler:

  1. onIdle()

Tried lots of combinations like:

  1. $(window).trigger('idle');

How is it done properly?


Thanks in advance!


jQuery Ajaxify Plugin: http://4nf.org/