Как управлять всплывающей подсказкой jquery - PullRequest
1 голос
/ 14 февраля 2012

Я разрабатываю подсказку. Он должен отображаться, когда я нажимаю на ссылку, и я хочу скрыть его, нажимая вне всплывающей подсказки, или после задержки. я делаю так:

$('#aiuti').qtip({
        content: {
            text: "In questa sezione e' possibile pianificare l'invio delle notifiche scegliendo Il Target degli utenti - il Tipo di notifica - Titolo della notifica - Il Messaggio - Periodicita' invio e date - inoltre la periodicita' e gli stati di invio possono essere verificati da apposito pannello con filtri di ricerca."
        },
        show: {
            event: 'click'
        },
        hide: {
            delay: 1000
        }
    }).click(function() {
        var _$this = $(this);

        if(_$this.html() === 'Attiva aiuti') {

            _$this.html('Chiudi aiuti');
        } else {
            _$this.html('Attiva aiuti');
        }
    })

Таким образом, если всплывающая подсказка будет скрыта после задержки, если я снова нажму на ссылку, всплывающая подсказка отобразится снова. Как я могу сделать ? ты можешь мне помочь?

1 Ответ

0 голосов
/ 14 февраля 2012

Я нашел два способа:

Первая подсказка скрывается после задержки:

$('#aiuti').qtip({
   content: {
            text: "text text text"
    }
    ,show: {
        event: 'click',
        solo: true // Only show one tooltip at a time
    }
    ,hide: {
        delay: 1000
    }
}

Или после нажатия вне подсказки:

$('#aiuti').qtip({
    content: {
            text: "text text text"
    }
    ,show: {
        event: 'click',
        solo: true // Only show one tooltip at a time
    }
    ,hide: {
        event:'unfocus'
    }
}

Объединениеоба способа работают, но вы можете попытаться найти решение в документации

...