我正在使用tablefilter.js在 HTML 表格的顶部生成下拉菜单。在几个表格行中,我有一个跨度用作悬停时的工具提示,因此除非鼠标悬停在它上面,否则它不会显示。
<td>
<a class="tooltip" href="#" id="color">Red
<span>
<strong>Favorite Color</strong><br />
If this is not your favorite color,
please make changes on this page.
</span>
</a>
</td>
问题是列顶部的下拉文本包含跨度,因此当用户单击下拉列表时,它会显示“红色最喜欢的颜色,如果这不是......”而不是简单的“红色”。
有什么办法可以防止 tablefilter 插件在初始锚点“红色”之后抓取任何东西?
这是工具提示的 CSS:
a.tooltip {
outline:none;
text-decoration:none;
}
a.tooltip strong {
line-height:30px;
}
a.tooltip span {
display:none;
line-height:16px;
margin-left:28px;
margin-top:-30px;
padding:14px 20px;
width:240px;
z-index:10;
}
a.tooltip:hover span {
border:1px solid #DCA;
background:#fffAF0;
color:#111;
display:block;
position:absolute;
}
.callout {
border:0;
left:-12px;
position:absolute;
top:30px;
z-index:20;
}
a.tooltip span
{
border-radius:4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
-moz-box-shadow: 5px 5px 8px #CCC;
-webkit-box-shadow: 5px 5px 8px #CCC;
box-shadow: 5px 5px 8px #CCC;
}