2013-09-23 124 views
0

我正在使用http://qtip2.com/工具提示。我想使用此代碼使用一個隱藏的元素,對於i'm:Qtip2-隱藏元素的工具提示未顯示

<script type="text/javascript"> 

// <![CDATA[ 
// Grab all elements with the class "hasTooltip" 
$('.hasTooltip').each(function() { // Notice the .each() loop, discussed below 
    $(this).qtip({ 
     content: { 
      text: $(this).next('div') // Use the "div" element next to this for the content 
     } 
    }); 
}); 
// ]]> 

而且根據此代碼:

<div class="hasTooltip">Hover me to see a tooltip</div> 
<div class="hidden"> 
<!-- This class should hide the element, change it if needed --> 
<p><strong>Complex HTML</strong> for your tooltip <em>here</em>!</p> 
</div> 

如果你將鼠標懸停在「懸停我看看一個工具提示「,沒有工具提示顯示?不知道,爲什麼?

回答

0
events: { 
    render: (event, api) -> 
    show: (event, api) -> 
     $('.qtip:visible').qtip('hide') 
     elements = $(api.get('content.text')).removeClass('hidden') 
     api.set('content.text', elements) 
    , 
    hide: (event, api) -> 
    } 

我認爲它在Qtip2的錯誤,我不得不手動刪除類