table中td超出内容隐藏,鼠标悬停全部显示(完整版,含js代码)
2021-06-19 18:03
标签:overflow width hidden code 元素 seo logs cli hid table中td超出内容隐藏,鼠标悬停全部显示(完整版,含js代码) 标签:overflow width hidden code 元素 seo logs cli hid 原文地址:http://www.cnblogs.com/zyl1994/p/7191400.htmltable {
width: 100%;
float: left;
table-layout:fixed;
width:500px;
border:1px solid #ccc;
}
table tr {
line-height: 25px;
border:1px solid #ccc;
}
table td {
border:1px solid #ccc;
text-align:center;
}
.MHover{
border:1px solid #ccc;
white-space:nowrap;
text-overflow:ellipsis;
overflow:hidden;
}
table>
tr>
th>姓名th>
th>个性签名th>
th>性别th>
tr>
tr>
td>张国荣td>
td>
div class="MHover">我就是我,是颜色不一样的烟火!div>
div class="MALL">我就是我,是颜色不一样的烟火!div>
td>
td>男td>
tr>
table>
$(document).ready(function () {
$(".MALL").hide();
$(".MHover").mouseover(function (e) {
$(this).next(".MALL").css({"position":"absolute","top":e.pageY+5,"left":e.pageX+5}).show();
});
$(".MHover").mousemove(function (e) {
$(this).next(".MALL").css({ "color": "fff", "position": "absolute", "opacity": "0.7", "background-color": "666", "top": e.pageY + 5, "left": e.pageX + 5 });
});
$(".MHover").mouseout(function () {
$(this).next(".MALL").hide();
});
});
文章标题:table中td超出内容隐藏,鼠标悬停全部显示(完整版,含js代码)
文章链接:http://soscw.com/essay/96054.html