前段时间项目需要用到双向列表选择,想直接用select,结果发现某些样式不支持,只好用div模拟了以下,功能基本实现能用了,需要其他功能自己加上,譬如列表里展示多列数据等。
select版链接:http://www.cnblogs.com/tie123abc/p/6018912.html
双向列表选择器DIV模拟 @charset "utf-8"; .two_way_list_selector { width: 100%; height: 250px; } .two_way_list_selector .select_l, .two_way_list_selector .select_r { width: 40%; height: 250px; float: left; border: 1px solid #CCC; } .two_way_list_selector .select_l .option { height: 29px; line-height: 29px; border-bottom: 1px solid #ddd; } .two_way_list_selector .select_l .option .l { width: 30%; float: left; text-indent: 10px; } .two_way_list_selector .select_l .option .r { width: 70%; float: right; text-align: center; } .two_way_list_selector .select_l .select_a, .two_way_list_selector .select_r .select_b { width: 100%; height: 220px; overflow: auto; } .two_way_list_selector .select_r .select_b { height: 250px; } .two_way_list_selector .select_l .select_a div, .two_way_list_selector .select_r .select_b div { padding: 10px; height: 25px; line-height: 25px; border-bottom: 1px solid #ddd; background: #FFF; } .two_way_list_selector .select_l .select_a div:last-child, .two_way_list_selector .select_r .select_b div:last-child { border-bottom: none; } .two_way_list_selector .select_btn { width: 10%; height: 250px; float: left; display: table; text-align: center; } .two_way_list_selector .select_btn div { height: 250px; display: table-cell; vertical-align: middle; } .two_way_list_selector .select_btn div input { width: 90%; margin: 1px; text-align: center; font-weight: 100; color: #999; } .two_way_list_selector .select_l .select_a .is_select, .two_way_list_selector .select_r .select_b .is_select { color: #FFF; background: #3399FF; } 名称 数量 1 2 3 4 5 6 7
名称 数量 a b c d e f g
以上所述是小编给大家介绍的jQuery双向列表选择器DIV模拟版,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对考高分网网站的支持!



