1

私はTipsyjqueryプラグインを使用しており、フォーカストリガーはホバートリガーと同じように機能します。入力フィールドがまだフォーカスされていても、マウスが入力フィールドから離れると、Tipsyは表示を停止します。この問題の原因は何ですか?このjQueryのほろ酔いプラグインに基づいています。フォーカストリガーが機能しない。問題を引き起こしているのは実際のプラグインではありません

これが私がテストしているページです

http://uploads.glumbo.com/?op=registration

4

2 に答える 2

2

使用しているTipsyファイルを更新する必要があります。現在使用しているものは、Tipsyの最新バージョンとは大幅に異なります。

于 2011-03-20T04:38:00.777 に答える
1

Haochiが言うように、Tipsyバージョンを1.0.0aに更新する必要があります。次に、次のコードを使用して、ホバーとフォーカスの両方をほろ酔いツールチップに追加します(デモ)。

$('.registerform [title]')
    .tipsy({
        trigger: 'manual', // manual stops binding of any internal tipsy events
        gravity: 'w',
        fade: true
    })
    .bind('focus mouseenter', function(e) {
        // flag indicating the input has focus
        if (e.type === 'focus') {
            $(this).addClass('hasFocus');
        }
        $(this).tipsy("show");
    })
    .bind('blur mouseleave', function(e) {
        // if mouseleave is triggered but the input has focus, ignore it
        if (!$(this).is('.hasFocus') || e.type === 'blur') {
            $(this).removeClass('hasFocus').tipsy("hide");
        }
    });
于 2011-03-20T05:19:41.937 に答える