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>

「Hover me to see a tooltip」にカーソルを合わせると、ツールチップが表示されませんか? わかりません、なぜですか?

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 に答える