jqueryでホバーイベントを遅らせたいです。ユーザーがリンクまたはラベルにカーソルを合わせると、ファイルから読み取っています。ユーザーが画面上でマウスを動かしているだけの場合に、このイベントをすぐに発生させたくありません。イベントの発火を遅らせる方法はありますか?
ありがとうございました。
コード例:
$(function() {
    $('#container a').hover(function() {
        $('<div id="fileinfo" />').load('ReadTextFileX.aspx',
            {filename:'file.txt'},
            function() {
                $(this).appendTo('#info');
            }
         );
    },
        function() { $('#info').remove(); }
    });
});
更新: (2009 年 1 月 14 日) HoverIntent プラグインを追加した後、上記のコードはそれを実装するために次のように変更されました。実装は非常に簡単です。
$(function() {
    hiConfig = {
        sensitivity: 3, // number = sensitivity threshold (must be 1 or higher)
        interval: 200, // number = milliseconds for onMouseOver polling interval
        timeout: 200, // number = milliseconds delay before onMouseOut
        over: function() {
            $('<div id="fileinfo" />').load('ReadTextFileX.aspx', {filename:'file.txt'},
                function() {
                   $(this).appendTo('#info');
                }
             );
        }, // function = onMouseOver callback (REQUIRED)
        out: function() { $('#info').remove();  } // function = onMouseOut callback (REQUIRED)
    }
    $('#container a').hoverIntent(hiConfig)
}