2012-02-14 84 views
1

我正在开发一个工具提示。它必须显示当我点击一个href,并且我想通过点击外部工具提示或延迟后隐藏它。我做了这种方式:如何管理工具提示jquery

$('#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'); 
     } 
    }) 

这样,如果提示将延迟后躲,如果我的链接再次点击,提示再次显示。我能怎么做 ?你可以帮我吗?

+0

中找到解决方案。你有没有使用任何现有的插件覆盖这个原因? (就像自学,这是完全可敬的) – 2012-02-14 16:56:40

回答

0

我发现有两种方式:

第一工具提示的延迟之后隐藏:

$('#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' 
    } 
} 

结合使用这两种方式看起来尽管可以工作,但您可以尝试在documentation