【发布时间】:2013-06-11 20:29:29
【问题描述】:
您能否看看这个JsFiddle 并告诉我如何在 SVG 中居中显示工具提示?我已经在this post 上看到了同样的问题,但老实说这对我来说太混乱了!
这是我的代码:
<div class="container">
<div class="well">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="400px" height="400px" viewBox="0 0 400 400" enable-background="new 0 0 400 400" xml:space="preserve">
<ellipse class="firststar" cx="200" cy="200" rx="150" ry="150"/>
</svg>
</div>
</div>
和jquery代码:
$('.firststar').tooltip({title:'Test SVG Centering', container:'.well', placement: 'top'});
【问题讨论】:
-
另一个问题及其答案到底有什么令人困惑的地方?
-
嗨罗伯特,谢谢你的评论,我可以说代码的所有部分。如你所见,我有一个非常简单的 SVG,但我不知道如何使用 jquery 部分中的代码?另外我不知道'w3.org/2000/svg'是什么?由于有人已经在该问题上发布过,该帖子包含问题的一小部分,很难完全理解
-
您必须在您的 jquery 副本中找到该函数并对其进行修改。
-
函数在你的 jquery 副本中!哪个副本?我只是从 jquery.com 下载 jquery,我什么都没有!都是上面提到的链接
-
有什么办法可以解决这个问题吗?
标签: jquery css twitter-bootstrap svg tooltip