以下是一个可能的解决方案:
<div id="sponsors">
<div class="wrap">
<h1><span>Our Corporate Sponsors</span></h1>
<ul class="lcp_catlist">
<li>
<h5 class="header-sponsor-title"><a href="http://dacc.fredrixdesign.com/global-imports-bmw-2/" title="Global Imports BMW">Global Imports BMW</a></h5><a href="http://dacc.fredrixdesign.com/global-imports-bmw-2/"><img width="50" height="50" src="http://dacc.fredrixdesign.com/wp-content/uploads/bmw-150x150.jpg" class="attachment-50x50 wp-post-image" alt="DACC Sponsor" /></a>
<span>Hello, I\'m text!</span>
</li>
<li>
<h5 class="header-sponsor-title"><a href="http://dacc.fredrixdesign.com/caroline-e-taylor-llc-2/" title="Caroline E. Taylor, LLC">Caroline E. Taylor, LLC</a></h5><a href="http://dacc.fredrixdesign.com/caroline-e-taylor-llc-2/"><img width="50" height="50" src="http://dacc.fredrixdesign.com/wp-content/uploads/caroline-e-taylor-150x150.jpg" class="attachment-50x50 wp-post-image" alt="DACC Sponsor" /></a>
<span>
<p>Me too!<br />New line.</p>
<p>But I have several lines, yay!</p>
</span>
</li>
</ul>
</div>
</div>
正如我所用
span
而不是
p
, 我必须调整CSS:
#sponsors .wrap .lcp_catlist li span {
display: none;
}
JavaScript:
$(document).ready(function () {
$(\'.lcp_catlist a img\').each(function () {
$(this).qtip({
content: $(this).parent().next(\'span\')[0].innerHTML
});
});
});
基本上,您只需将帖子内容包装到
span
标签,就是这样。
小提琴:http://jsfiddle.net/jv8WN/33/