jquery - 如何用jquery显示隐藏行?

标签 jquery responsive-design footable

我正在使用footable (一个 jquery 脚本,用于使表格在手机、平板电脑等上响应)但我有一个问题。对于我的项目来说,触摸并单击每一行的展开是不必要的。

通常使用此代码可以正常工作:

 <table class="footable">
      <thead>
        <tr>
          <th data-class="expand">
            First Name
          </th>
          <th>
            Last Name
          </th>
          <th data-hide="phone,tablet">
            Job Title
          </th>
          <th data-hide="phone,tablet">
            DOB
          </th>
          <th data-hide="phone">
            Status
          </th>
        </tr>
      </thead>

$(function() { $('table').footable(); });

但是我如何默认展开所有行?

jsfiddle 上的示例代码

最佳答案

查看此演示 http://jsfiddle.net/yeyene/nZEu2/2/

在您的 footable 调用之后添加这一行脚本 $('table tr').addClass('footable-detail-show');

$(document).ready(function(){
    $(function() {
        $('table').footable();
    });
    $('table tr').addClass('footable-detail-show');
}); 

关于jquery - 如何用jquery显示隐藏行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17645527/

相关文章:

javascript - 如何动态创建单选按钮?

javascript - 在 FooTable 插件上增加过滤器搜索的宽度

javascript - 无法触发绑定(bind)事件

javascript - <div> 高度在 if 语句中不变

javascript - 如何使链接恢复到正常(不活动)状态?

javascript - 如何向可容纳行/单元格添加数据值

jquery - 由于字符串排序,对整数的可容纳列进行排序会呈现意外结果

iPhone 5 CSS 媒体查询

javascript - 根据分辨率渲染 html

javascript - 为什么我的页面不是 100% 响应?