jQuery special event hoverintent isn’t working properly with `mouseleave` functions

jQuery special event hoverintent isn’t working properly with `mouseleave` functions

I'm having difficulty getting the `jQuery` special event `hoverintent` to work with `mouseleave` functions. *(I’ve also tried substituting `mouseout` for `mouseleave`)*

I need to utilize the same functionality so that the `mouseleave` event is only fired when the user's mouse has slowed down beneath the sensitivity threshold.

I’ve included the script below, and have also uploaded a working example to http://click2fit.com/test_files/accordion_hoverintent.html

  1.     $(function () {    
  2.         $(".accordion_close_leave").accordion({
  3.                     event: "click hoverintent",
  4.                     collapsible: true,
  5.                     active: false,    
  6.                     autoHeight: false,
  7.                  }).mouseleave(function() {
  8.         $(this).accordion({ active: false});
  9.         }); 
  10.                           
  11.     var cfg = ($.hoverintent = {
  12.         sensitivity: 100,
  13.         interval: 500
  14.     });
  15.     $.event.special.hoverintent = {
  16.         setup: function() {
  17.             $( this ).bind( "mouseover", jQuery.event.special.hoverintent.handler );
  18.         },
  19.         teardown: function() {
  20.             $( this ).unbind( "mouseover", jQuery.event.special.hoverintent.handler );
  21.         },
  22.         handler: function( event ) {
  23.             var that = this,
  24.                 args = arguments,
  25.                 target = $( event.target ),
  26.                 cX, cY, pX, pY;
  27.             function track( event ) {
  28.                 cX = event.pageX;
  29.                 cY = event.pageY;
  30.             };
  31.             pX = event.pageX;
  32.             pY = event.pageY;
  33.             function clear() {
  34.                 target
  35.                     .unbind( "mousemove", track )
  36.                     .unbind( "mouseout", arguments.callee );
  37.                 clearTimeout( timeout );
  38.             }
  39.             function handler() {
  40.                 if ( ( Math.abs( pX - cX ) + Math.abs( pY - cY ) ) < cfg.sensitivity ) {
  41.                     clear();
  42.                     event.type = "hoverintent";
  43.                     event.originalEvent = {};
  44.                     jQuery.event.handle.apply( that, args );
  45.                 } else {
  46.                     pX = cX;
  47.                     pY = cY;
  48.                     timeout = setTimeout( handler, cfg.interval );
  49.                 }
  50.             }
  51.             var timeout = setTimeout( handler, cfg.interval );
  52.             target.mousemove( track ).mouseout( clear );
  53.             return true;
  54.         }
  55.     };