jQueryTools 要求 div 将工具提示放置在触发元素 (li) 之后 - 文档无法验证
以下是有关如何使用工具提示的 jQueryTools 演示页面: http://flowplayer.org /tools/demos/tooltip/any-html.html
基本上,如果您想要一个包含 HTML 的工具提示,您必须将该 HTML 放在 div 中并将其直接放置在触发元素之后,如下所示:
<a href="http://www.stackoverflow.com" id="link1">
<div class="tooltip">
<img src="img/SOicon.png">stack<span style="font-weight:bold">overflow</span>
</div>
但是我的触发元素不是 。它是一个
,我的猜测是我不能在父
< 中放置
以外的任何内容。 /代码>。换句话说,我无法像我应该的那样将触发元素放置在触发元素之后。
我想出了一种方法来解决这个问题(用浮动
你们会如何解决这个问题?
Here's the jQueryTools demo page on how to use their tooltips: http://flowplayer.org/tools/demos/tooltip/any-html.html
Basically, if you want to have a tooltip that contains HTML, you have to put that HTML in a div and place it directly after the trigger element like so:
<a href="http://www.stackoverflow.com" id="link1">
<div class="tooltip">
<img src="img/SOicon.png">stack<span style="font-weight:bold">overflow</span>
</div>
But my trigger element isn't <a href="http://www.stackoverflow.com" id="link1">
. It's an <li>
, and my guess is that I can't put anything other than an <li>
in the parent <ul>
. In other words, I can't place the after the trigger element like I'm supposed to.
I've come up with a way to fix this (scrapping the unordered list with floated <li>
s and switching over to floated divs) but figured I should probably consult the experts (you guys, of course!) before I got started on fixing the problem.
How would you guys fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用结构之外的另一个元素作为工具提示目标是没有问题的!
最后放入 jQuery 的 read() :
在 docu 中阅读更多内容;-)
It's no problem to use another element outside your structure as tooltip target !
At the end put in your jQuery's ready() :
Read more in the docu ;-)