【特效】复选框分行控制文本框
也是实际项目中遇到的一个小小效果,意义不大,就是复习了一下if表达式中,复选框被选中了怎么写。
html:
<table class="box">
<tr>
<td><input type="checkbox" class="check_1"></td>
<td><input type="text" class="text_1" disabled></td>
</tr>
<tr>
<td><input type="checkbox" class="check_1"></td>
<td><input type="text" class="text_1" disabled></td>
</tr>
<tr>
<td><input type="checkbox" class="check_1"></td>
<td><input type="text" class="text_1" disabled></td>
</tr>
</table>
css:
table{ width:800px; margin:100px 0 0 100px; border-collapse:collapse;}
.box td{ height:60px; border:1px solid #ccc; padding:0 20px;}
.text_1{ width:300px; padding:0 10px; height:35px; border:1px solid #ccc; background:#fff;}
js:
<script>
$(document).ready(function(){
var check=$(".check_1");
var text=$(".text_1");
check.each(function(){
$(this).click(function(){
if(this.checked){
$(this).parents("tr").find(".text_1").attr("disabled",false).css("border","1px solid #000");
}
else{
$(this).parents("tr").find(".text_1").attr("disabled",true).css("border","1px solid #ccc");
}
});
});
});
</script>
效果预览:http://www.gbtags.com/gb/rtreplayerpreview-standalone/2917.htm
- 【maven 报错】maven项目执行maven install时报错Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode)
- java学习之Tcp网络程序
- 浅谈httpd的了解
- popuweindow 里面嵌套 keyboardview 报错
- IP 算法
- 【特效】复选框的值动态添加
- WINCE 6.0 RDP相关的Terminal server Client License界面修改
- FZU 1911 Construct a Matrix
- C# 不重复的随机数
- ViewData与ViewBag的使用区别
- 11个让你吃惊的 Linux 终端命令
- 如何用Fiddler对Android应用进行抓包
- 李洪强实现横向滚动的View<一>
- android之swiperefreshlayout与scrollview冲突解决
- 算法基础知识科普:8大搜索算法之二叉搜索树(上)
- 一个简单的redis性能测试程序和性能测试结果
- (OK) install WINE in Fedora 23 or Later
- jquery中的this 到底是什么意思? $(this)
- JAVA log4j 控制台输出日志
- Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 69760 at MyFirstApp.main(MyFir