1

アニメーションでテーブルを開閉したい。この目的でjQueryを使用してみたところ、jqueryがテーブルに対してslideUp/Downを実行できないことがわかりました。確かに私は.wrap()そのテーブルをdivで囲むために使用できますが、それは不器用で、時々バグを与えます

他に選択肢はありますか?また、jqueryアニメーションはスムーズではありません。http://www.dynamicdrive.com/dynamicindex17/animatedcollapse.htmのようなスムーズなアニメーションを実現する方法

4

1 に答える 1

0

jsFiddle の例

<button id="hidr">Hide</button>
<button id="showr">Show</button>

<table border="1">
  <tr>
    <td>row 1, cell 1</td>
    <td>row 1, cell 2</td>
  </tr>
  <tr>
    <td>row 2, cell 1</td>
    <td>row 2, cell 2</td>
  </tr>
</table>

<script>
    $("#hidr").click(function () {
      $("table").hide("fast");
    });
    $("#showr").click(function () {
      $("table").show("fast");
    });
</script>
于 2012-08-07T12:13:32.630 に答える