这是我为解释这种情况而创建的代码示例。它工作得很好,但当它切换到隐藏tbody时,它会产生一种奇怪的效果(首先将tbody扩展三到四倍,然后它会垂直折叠,当它向下滑动时,它也会垂直折叠)。
当滑下时对我来说不是问题,但当它崩溃时对我来说是个问题。
你能帮个忙吗?
谢谢
代码。
<html>
<head>
<script type="text/javascript">
$(function() {
$(".tblGeneral thead").click(function() {
$(this).next(".tblGeneral tbody").slideToggle("fast");
});
});
</script>
</head>
<body>
<table class="tblGeneral">
<thead>
<tr>
<td colspan="2">Title</td>
</tr>
</thead>
<tbody>
<tr>
<td class="title">Name:</td>
<td>Some name</td>
</tr>
</tbody>
</table>
</body>发布于 2010-09-21 07:43:34
嘿,你想把css
position: relative; 添加到您的表中,这应该可以解决问题。
所以在你的情况下,它将是
.tblGeneral { position: relative; }https://stackoverflow.com/questions/2401065
复制相似问题