js穿梭框;将两个table中的数据选中移动
2024-09-03 19:31:31
将table中选中的数据移动到右边;
点击一行中的任意一个位置,使其选中:
注:attr()和prop()都是jquery的方法;
.attr() : 获取匹配的元素集合中的第一个元素的属性的值 或 设置每一个匹配元素的一个或多个属性。 •.attr( attributeName ) •.attr( attributeName )
•.attr( attributeName, value ) •.attr( attributeName, value )
•.attr( attributes )
•.attr( attributeName, function(index, attr) )
.prop() : 获取匹配的元素集中第一个元素的属性(property)值或设置每一个匹配元素的一个或多个属性。 •.prop( propertyName ) •.prop( propertyName )
•.prop( propertyName, value ) •.prop( propertyName, value )
•.prop( properties )
•.prop( propertyName, function(index, oldPropertyValue) )
是参数有区别,attr()传入的是attributeName,而prop()传入的是propertyName,
给前面复选框添加选中事件,然后对选中的进行向右边table移动的操作:
将两个table放在两个div中,会存在一根问题,就是td的宽度会不一致;
可以对他们分别设置宽度;
或者,通过js,获取到body中每一个的宽度,然后给thead每一个td加上这个宽度;
最新文章
- 因为多余jar包,所报的错
- iOS持续写文件到本地
- window go protobuf
- python tkinter用Treeview实现ListView效果
- Maven学习总结
- [团队项目]sprint3 &; 团队贡献分。
- 坑爹的对GBK编码的字符进行url编码
- (五)CSS伪类(Pseudo-class)
- Exploring the 7 Different Types of Data Stories
- MATLAB中的函数的归总
- VS2013 编译 MySql Connector C 6.1.6
- C#多线程及GDI(Day 23)
- XML解析中的namespace初探
- Replication--进程无法在“xxxx”上执行“sp_replcmds”
- C语言解析17monipdb.dat(http://www.ipip.net/)免费数据库
- 腾讯技术分享:GIF动图技术详解及手机QQ动态表情压缩技术实践
- Using Information Fragments to Answer the Questions Developers Ask
- 论文笔记:Parallel Tracking and Verifying: A Framework for Real-Time and High Accuracy Visual Tracking
- 玲珑OJ 1129 - 喵哈哈村的战斗魔法师丶坏坏い月
- Golang 语言安装
热门文章
- 014_STM32程序移植之_L298N电机驱动模块
- js中错误处理机制
- F. Make Them Similar ( 暴力折半枚举 + 小技巧 )
- 自己实现dup2
- pom.xml报错 : Missing artifact org.apache.shiro:shiro-spring:bundle:1.2.5
- 微信小程序之简单记账本开发记录(二)
- Redis启动后基础只是讲解
- 表单 Flask-WTF - 校验器
- 使用PyMySQL连接MySQL错误
- electron之环境安装、启动程序