3

hoverIntent プラグインを使用して、プログレス バーのアニメーション効果を遅らせようとしています。しかし、なぜか hoverIntent がまったく機能していないようです。

ページヘッダーに次のものがあります(すべてのパスが確認されています):

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="campaign-resources/_js/jquery.easing.1.3.js"></script>
<script type="text/javascript" src="campaign-resources/_js/jquery.hoverintent.js"></script>
<script type="text/javascript" src="campaign-resources/_js/sitewide.js"></script>

sitewide.js では、次を実行します。

$(".cause-block").hoverIntent(function() {
    var originalWidth = $(this).find(".cause-chart-achieved").css("width");
    var chartParams = { width: originalWidth };
    $(this).find(".cause-chart-achieved").css("width", "0");
    $(this).find(".cause-chart-achieved").animate(chartParams, "slow", "easeInOutSine");
});

しかし、関連する div にカーソルを合わせると、ブラウザーで何も起こらず、コンソールに次のエラーが表示されます。

「cfg.over は未​​定義です」および「cfg.out は未定義です」

jQuery の組み込みの「ホバー」を使用してテストしましたが、問題なく動作します。イージング プラグインと競合する可能性も考えましたが、HTML および JS ファイルでイージング プラグインへの参照を削除した後も、同じ問題が発生します。最後に、安全のために他のすべてのカスタム JS を削除しましたが、問題は解決しません。

何か案は?ありがとう!

4

1 に答える 1

4

hoverIntent は 2 つのパラメーターを受け取ります。

$(".cause-block").hoverIntent(function() {
    var originalWidth = $(this).find(".cause-chart-achieved").css("width");
    var chartParams = { width: originalWidth };
    $(this).find(".cause-chart-achieved").css("width", "0");
    $(this).find(".cause-chart-achieved").animate(chartParams, "slow", "easeInOutSine");
},
function(){});
于 2009-09-02T21:51:04.457 に答える