checkbox:用jquery写的
来源:互联网 发布:win7 关闭端口443 编辑:程序博客网 时间:2024/05/17 06:08
/*
* @author
* @param _this:插入的位置,比如id选择器;
* @param checkboxshow:传入的函数,用来返回是否选中
*/
function mycheckbox(_this,checkboxshow){
$(_this).append("<div class='zhengli_input'><label><span></span></label><input value='1'/></div>")$(_this).find(".zhengli_input").css("width","25px")
.css("margin","20px 100px")
.css("position","relative");
$(_this).find(".zhengli_input input").css("display","none")
$(_this).find(".zhengli_input label").css("cursor","pointer")
.css("position","absolute")
.css("width","20px")
.css("height","20px")
.css("top","0px")
.css("left","0px")
.css("border","1px solid #111");
$(_this).find(".zhengli_input label span").css("opacity","0")
.css("position","absolute")
.css("display","block")
.css("width","11px")
.css("height","6px")
.css("background","transparent")
.css("left","4px")
.css("top","5px")
.css("border","3px solid #111")
.css("border-top","none")
.css("border-right","none")
.css("-webkit-transform","rotate(-45deg)")
.css("-moz-transform","rotate(-45deg)")
.css("-o-transform","rotate(-45deg)")
.css("-ms-transform","rotate(-45deg)")
.css("transform","rotate(-45deg)");
$(_this).find(".zhengli_input label").hover(function(){
$(this).find("span").css("opacity","0.5");
},function(){
if($(this).next().val()=="1"){
$(this).find("span").css("opacity","0");
}
})
$(_this).find(".zhengli_input label").click(function(){
if($(this).next().val()=="1"){
$(this).children().css("opacity","1");
$(this).next().val("2");
checkboxshow(true);
}else{
$(this).children().css("opacity","0");
$(this).next().val("1");
checkboxshow(false);
}
})
}
阅读全文
0 0
- checkbox:用jquery写的
- jquery的checkbox操作
- jquery的checkbox
- 用jQuery控制checkbox
- 用jQuery控制checkbox
- 自己写的树形checkbox
- jquery 对checkbox的操作
- jquery 对checkbox的操作
- jquery得到选择的checkbox
- jQuery对checkbox的操作
- jquery 对checkbox的操作
- jquery对checkbox的操作
- jquery取checkbox的状态
- jquery获取checkbox 的值
- JQuery对checkbox的操作
- jquery操作checkbox的问题
- jquery对checkbox的操作
- jquery 的checkbox 操作1
- java中Math方法的ceil,floor,round方法
- 第十一周项目3-图遍历算法实现
- 第11周 项目1
- es6学习第2天,迭代器
- 第九周项目3(1)-计算二叉树节点个数
- checkbox:用jquery写的
- Intellij 编译报错:不支持diamond 运算符
- hive与es交互bug
- set XACT_ABORT ON与判断事务的异同
- Array Util (C#)
- 【第七周】项目3-负数把正数赶出队列
- gulp简单入门
- 第九周项目二
- 机器学习资源备份,转载自大神https://zhuanlan.zhihu.com/p/26876504