2011-08-30 132 views

回答

47

如果你希望它保持可見,當你鼠標移到提示,但仍然希望它解僱mouseout,使用固定和延時選項described in the documentation here

$('.selector').qtip({ 
    content: { 
      text: 'I hide on mouseout, but you can mouse into me within 500ms', 
    }, 
    hide: { 
      fixed: true, 
      delay: 500 
    } 
}); 

的隱藏參數有許多選項。例如,如果你只是想掩飾不了它無限期,只需設置隱藏到假:

$('.selector').qtip({ 
    content: { 
     text: 'I never hide', 
    }, 
    hide: false 
}); 

如果你想讓它隱藏在不同的事件,如點擊尖端以外的任何地方,明確地設置事件:

$('.selector').qtip({ 
    content: { 
      text: 'I hide when you click anywhere else on the document', 
    }, 
    hide: { 
      event: 'unfocus' 
    } 
}); 

如果你想點擊觸發,當它隱藏,指定click事件:

$('.selector').qtip({ 
    content: { 
      text: 'I hide when you click the tooltip trigger', 
    }, 
    hide: { 
      event: 'click' 
    } 
}); 

更多信息請參見具體the "hide" options documentation

+1

太感謝你了..這對我幫助很大。我只是隻發現這一點。 –

5

如果你想尖端保持打開,然後把它隱藏在目標外的用戶點擊或離開時的目標:

show: { 
    event: 'mouseover' 
}, 

hide: { 
    event: 'click mouseleave' 
} 
相關問題