【发布时间】:2017-02-11 03:08:09
【问题描述】:
这个 .XHTML 文件中的 jQuery 工具提示器工作正常
<?xml version="1.0" encoding="utf-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:t="http://www.tei-c.org/ns/1.0" >
<head>
<title>Sandbox</title>
<link rel="stylesheet" type="text/css" href="tooltipster.bundle.css" />
<link rel="stylesheet" type="text/css" href="tooltipster-sideTip-light.min.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-3.1.0.min.js"></script>
<script type="text/javascript" src="tooltipster.bundle.min.js"></script>
<script>$(document).ready(function() {
$('.tooltip').tooltipster({
functionInit: function(instance, helper) {
var content = $(helper.origin).children().detach();
instance.content(content);
}
})
});</script>
</head>
<body>
<span class="tooltip">Hover here.
<p>Red</p>
<p>Green</p>
<p>Blue</p>
</span>
</body>
</html>
直到我在 HTML 正文中添加 <t:body></t:body>,在 </span> 之后。工具提示出现在悬停时,但不会消失。
<t:body> 应该无关紧要。 t:body 位于不同的命名空间中! (应该没关系吧?)
如果我将 t:body 更改为 t:bod 或将文件名从 .xhtml 更改为 .html,问题就会消失。 (我使用的是深渊网络服务器。)
发生了什么事?我怎样才能使这项工作?此应用广泛使用 XHTML 中的命名空间,以及在 HTML 命名空间中有意义的命名空间元素(如 <body>)。
【问题讨论】:
-
这似乎是 Tooltipster 的问题,目前正在调查中。 github.com/iamceege/tooltipster/issues/655
-
这已在 Tooltipster 4.1.8 中修复。
标签: jquery tooltipster