행을 클릭 한 행 수가 숨겨진 행을 아래로 슬라이드하는 표가 있습니다. 문제는 내가 각 rows.is 거기에 빈 공간을 삭제하고 각 행을 클릭 할 때만이 방법을 추가 할 수있는 몇 가지 빈 공간이 있습니다.행을 클릭하면 테이블의 높이가 변경됩니다.
var clicked=true;
$(".one").on('click', function(){
if(clicked)
{
clicked=false;
$(".two").css({"top": 0});
}
else
{
clicked=true;
$(".two").css({"top": "-25px"});
}
});
.one {
position: relative;
top: 0;
background-color: lightblue;
z-index: 1;
cursor:pointer;
}
.two {
position: relative;
top: -25px;
background-color: yellow;
z-index: -1;
-webkit-transition: top 1s;
-moz-transition: top 1s;
-o-transition: top 1s;
transition: top 1s;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<table border="0" style="border:1px solid #000;">
<tr class="one"> <td>HELLO WORLD</td></tr>
<tr class="two"><td>THIS IS HIDE TEXT</td></tr>
<tr class="one"> <td>HELLO WORLD</td></tr>
<tr class="two"><td>THIS IS HIDE TEXT</td></tr>
</table>
너무 감사 개별적으로 각 라인에 대한 작업을 지금 높이를 전환하는 것은
편집이 ... NP이다. 각 행을 클릭 할 때 각 숨겨진 행을 별도로 표시하는 방법이 있습니까? – inaz
예제가 각 행에 대해 sepaprately 작동하도록 업데이트되었습니다. –