0

我正在使用http://qtip2.com/工具提示。我想使用隐藏元素,因为我正在使用以下代码:

<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>

如果您将鼠标悬停在“悬停我以查看工具提示”上,没有显示工具提示?不知道,为什么?

4

1 回答 1

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 中的一个错误,我不得不手动删除该类

于 2014-07-24T06:11:12.537 回答