zoukankan      html  css  js  c++  java
  • 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()
    });

  • 相关阅读:
    Spring三大器
    SpringBoot启动过程
    linux常用命令
    Controller当中的参数与返回值
    Spring加载context的几种方法
    Spring基础(imooc)
    SpringMVC框架学习
    Spring MVC(imooc)
    springAOP基础
    《别傻了,你的中年危机真不是因为穷》
  • 原文地址:https://www.cnblogs.com/qxz17760485467/p/12936447.html
Copyright © 2011-2022 走看看