显示额外div的jQuery工具提示
我是jQuery的新手,一直在尝试 显示工具提示时,内容下还会显示一个额外的div,其文本与显示的工具提示相同 这是不想要的,我不知道如何摆脱它 请参阅: 有关我遇到的问题的代码示例 以下是我在JSFIDLE上发布的代码:显示额外div的jQuery工具提示,jquery,jquery-tooltip,Jquery,Jquery Tooltip,我是jQuery的新手,一直在尝试 显示工具提示时,内容下还会显示一个额外的div,其文本与显示的工具提示相同 这是不想要的,我不知道如何摆脱它 请参阅: 有关我遇到的问题的代码示例 以下是我在JSFIDLE上发布的代码: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>tooltip demo</title> <script
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>tooltip demo</title>
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.0/jquery-ui.js"></script>
<style type="text/css">
.ui-tooltip
{
padding: 8px;
position: absolute;
z-index: 9999;
max-width: 300px;
-webkit-box-shadow: 0 0 5px #aaa;
box-shadow: 0 0 5px #aaa;
background: black;
color: White;
}
body .ui-tooltip
{
border-width: 2px;
}
</style>
</head>
<body>
<p>
<a href="#" title="Anchor description">Anchor text</a>
<input title="Input help">
</p>
<script type="text/javascript">
$(document).tooltip();
</script>
</body>
</html>
工具提示演示
.ui工具提示
{
填充:8px;
位置:绝对位置;
z指数:9999;
最大宽度:300px;
-webkit盒阴影:0 5px#aaa;
盒影:0 0 5px#aaa;
背景:黑色;
颜色:白色;
}
body.ui工具提示
{
边框宽度:2倍;
}
$(document.tooltip();
如果您将jQuery更改为这样,它将如您所希望的那样工作(不显示该div)
工作小提琴--看起来这是预期的功能,当您:
- 添加jquery ui.cssjquery-ui.css文件对元素进行样式设置,并隐藏您看到的日志。我使用我找到的样式表
- 使用css隐藏元素您也可以使用自定义css隐藏元素:
以下是更新的.ui-helper-hidden-accessible{display:none}
$(function() {
$(document).tooltip();
$(".ui-helper-hidden-accessible").hide();
});