【问题标题】:ICheck not working with bootstrap tableICheck 不适用于引导表
【发布时间】:2015-11-04 13:34:07
【问题描述】:

我正在使用带有 Admin LTE 模板的复选框的 iCheck(v1.0.2) jquery 插件。 iCheck 除了引导表之外工作正常。在 chrome 开发人员工具中检查元素时,我可以在 <td> 中找到由插件创建的 div,但它不可见。

这里是html

   <div class="table-responsive">
     <table class="table table-bordered table-striped table-condensed">
       <thead>
         <tr>
           <th>Functionality</th>
           <th>View</th>
           <th>Add</th>
           <th>Edit</th>
           <th>Delete</th>
         </tr>
       </thead>   
       <tbody>
         <tr>
           <td>New Function</td>
           <td><input type="checkbox" class="icheck"></td>
           <td><input type="checkbox" class="icheck"></td>
           <td><input type="checkbox" class="icheck"></td>
           <td><input type="checkbox" class="icheck"></td>
         </tr>
       </tbody>
     </table>
   </div>

jquery:

   <script>
     $(function () {
       $('.icheck').iCheck();
      });
   </script>

开发者工具:

不要考虑控制台错误。这是关于favicon.ico。我该如何解决这个问题?

【问题讨论】:

  • 请分享您的实时链接。
  • 抱歉。它没有托管。正在本地主机上处理它。
  • JS有没有报错?
  • JS 中没有错误,并且在源选项卡中可以看到必要的文件。

标签: jquery html twitter-bootstrap-3 html-table icheck


【解决方案1】:

在将数据表与 iCheck 一起使用时,我在 chrome 上遇到了同样的问题,在搜索 3 小时后,这是我发现的唯一一篇讨论该问题的帖子。在研究了以下之后,我成功了。

你需要给元素ins添加相对位置css。

 $('.iCheck-helper').css('position', 'relative');

如果您在列中使用它,请在 rowCallBack 中使用它。

$(nRow).find(':checkbox,:radio').iCheck();
$(nRow).find('.iCheck-helper').css('position', 'relative');

希望它能让某人的一天变得轻松。

【讨论】:

    【解决方案2】:

    给你的icheckboxwidthheightdisplay 属性

    例子

    width:20px, height:20px, display:inline-block;
    

    你可以这样试试吗?

    【讨论】:

    • 我已经尝试为 div 指定高度和宽度。它不起作用。
    • 你添加了 display:inline-block; ?
    猜你喜欢
    • 1970-01-01
    • 2018-03-25
    • 1970-01-01
    • 1970-01-01
    • 2019-09-27
    • 1970-01-01
    • 1970-01-01
    • 2017-12-24
    • 1970-01-01
    相关资源
    最近更新 更多