• iCheck插件的基础用法


    1、初始化:
    选中元素进行初始化;
    $('input').iCheck({
      checkboxClass: 'icheckbox_flat-blue', //选择框的风格。
      radioClass: 'icheckbox_flat-blue',
    });
    具体颜色:
    Black — minimal.css //黑色
    Red — red.css //红色
    Green — green.css //绿色
    Blue — blue.css //蓝色
    Aero — aero.css //win7中的那种玻璃效果
    Grey — grey.css //银灰色
    Orange — orange.css //橙色
    Yellow — yellow.css //黄色
    Pink — pink.css //粉红色
    Purple — purple.css //紫色

    2、触发事件详解:
    选中事件
    $('input').on('ifChecked', function(event){ })
    取消选中事件
    $('input').on('ifUnchecked', function(event){ })
    改变事件
    $('input').on('ifChanged', function(event){ })
    用户点击了自定义的输入框或与其相关联的label
    $('input').on('ifClicked', function(event){ })
    输入框状态变为 disabled
    $('input').on('ifDisabled', function(event){ })
    disabled 状态被移除
    $('input').on('ifEnabled', function(event){ })
    输入框被应用了iCheck样式
    $('input').on('ifCreated', function(event){ })
    iCheck样式被移除
    $('input').on('ifDestroyed', function(event){ })

    3、主动触发设置
    $('input').iCheck('check'); //将输入框的状态设置为checked
    $('input').iCheck('uncheck'); //移除 checked 状态
    $('input').iCheck('toggle'); //toggle checked state
    $('input').iCheck('disable'); //将输入框的状态设置为 disabled
    $('input').iCheck('enable'); //移除 disabled 状态
    $('input').iCheck('update'); //apply input changes, which were done outside the plugin
    $('input').iCheck('destroy'); //移除iCheck样式

    4、获取操作
    1)获取选中的input:
    $('input').on('ifChecked', function(event){
    $(event.target)
    });
    2)event对象:
    $(".icheckbox_flat-blue.checked").find("input")

    3)获取当前选中的input的val值:
    $('input').on('ifChecked', function(event){
    $(event.target).val()
    });

  • 相关阅读:
    按日期重命名宾得相机的照片
    Intellij笔记
    quartznet笔记
    优秀的UI插件
    我的ORM之示例项目
    Redis笔记
    Idol之坑
    ORACLE查询表最近更改的数据 VERSIONS BETWEEN TIMESTAMP MINVALUE AND MAXVALUE
    如何drop大表的中不用的字段 set unused column
    Oracle DUL/AUL/ODU 工具说明
  • 原文地址:https://www.cnblogs.com/Taiweis/p/12936447.html
Copyright © 2020-2023  润新知