toggle  →  Скрипт скрытия/раскрытия таблиц по клику на caption

published 23 August 2011

JS Скрипт

$(document).ready(function(){ $(".table_styles caption").parent().addClass(‘hide’); $(".table_styles caption").click( function() { $(this).parent().toggleClass(‘hide’); }); })

CSS:

table {
  width: 100%;
}
.table_styles .hide thead,
.table_styles  .hide tbody{
  display:none;
}
.table_styles  table caption {
  cursor: pointer;
}
Теги: toggle jquery