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」にカーソルを合わせると、ツールチップが表示されませんか? わかりません、なぜですか?