【问题标题】:Why isn't iCheck iradio_square-blue working为什么 iCheck iradio_square-blue 不工作
【发布时间】:2018-04-13 12:08:15
【问题描述】:

我正在尝试使用通过 iCheck 部署的 Square 皮肤在我的网站上实现 iCheck

问题是收音机没有得到 css 样式,我不知道为什么。这是我的代码:

在我的 document.ready 函数中,我有以下代码:

$(function(){
 $('input1').iCheck({
radioClass: 'iradio_square-blue',
increaseArea: '20%' // optional
                });

    });

我这样调用 .js 和 .css 并且我已经验证路径是正确的。

<link href="plugins/iCheck/square/blue.css" rel="stylesheet">
<script src="plugins/iCheck/icheck.js"></script>

html 看起来像这样:

<input type="radio" name="input1" id="input1" checked></br>

有人知道是什么原因造成的吗?

谢谢!

【问题讨论】:

    标签: jquery icheck


    【解决方案1】:

    id 选择器在 jquery 中应以 # 开头。

    代码

    $('input1').iCheck({
    

    应该改为

     $('#input1').iCheck({
    

    【讨论】:

    • 恐怕这并没有改变什么
    • 好吧,这是一个典型的错误。在包含 js 之前,我调用了 jquery 代码。还是谢谢你
    猜你喜欢
    • 2018-04-24
    • 2018-02-23
    • 2016-11-19
    • 1970-01-01
    • 1970-01-01
    • 2015-06-15
    • 2013-06-01
    • 2011-09-29
    • 2014-05-16
    相关资源
    最近更新 更多