宝哥软件园

jQuery实现左右两侧菜单添加、移除功能

编辑:宝哥软件园 来源:互联网 时间:2021-09-01

效果图:

射流研究…代码

函数toRight(l,r,v) { $('#' l ' option:selected ').appendo(' # ' r);$('#' l ' option:selected ').移除();var str=$('#' l '选项')。map(function () { return $(this)).val();}).get().join(',')$('#' v).val(字符串);}函数allToRight(l,r,v) { $('#' l ' option ').appendo(' # ' r);$('#' l '选项')。移除();var str=$('#' l '选项')。map(function () { return $(this)).val();}).get().join(',')$('#' v).val(字符串);}函数toLeft(l,r,v) { $('#' r ' option:selected ').appendo(' # ' l);$('#' r ' option:selected ').移除();var str=$('#' l '选项')。map(function () { return $(this)).val();}).get().join(',')$('#' v).val(字符串);}函数allToLeft(l,r,v) { $('#' r ' option ').appendo(' # ' l);$('#' r '选项')。移除();var str=$('#' l '选项')。map(function () { return $(this)).val();}).get().join(',')$('#' v).val(字符串);}html代码

div class=' measuri-layout '数据-选项=' fit : true ' div数据-选项=' region : ' west ',split : false ' style=' width :40 ';padd :0 px ' H3风格=' padd :5 px'边框-底部:1px实心# DDDDDD':已授权权限:/h3分区数据-选项=' region : ' center ' ' style=' padd :3 px;'height :215 px ' border=' false ' select multiple=' multiple ' id=' MenuFuc ' style=' width :100%;高度:100% '/选择输入类型='隐藏'名称=' func ' id=' func '值=' '//div/div数据-选项='区域: '东' '样式='宽度:40 ';padd :0 px ' H3风格=' padd :5 px'边框-底部:1px实心# DDDDDD':未授权权限:/h3分区数据-选项=' region : ' center ' ' style=' padd :3 px;'height :215 px ' border=' false ' select multiple=' multiple ' id=' menuFuncBase ' style=' width :100%;高度:100% '/select/div/div data-options=' region : ' center ' ' style=' padd :40 px;宽度: 197像素;高度:230 px线高' :40 px'文本对齐:中心;a href=' JavaScript : ' rel=' external nofollow ' rel=' external nofollow ' rel=' external nofollow ' rel=' external nofollow ' class=' button button-primary button-rounded button-small ' onclick=' toLeft '(MenuFuncK ',' menuFuncBase ',' func ')'/ABR/a href=' JavaScript :rel=' external nofollow ' rel=' external nofollow ' rel=' external nofollow ' rel=' external nofollow ' class=' button button-primary button-rounded button-small ' onclick=' all to left '(MenuFunc ',' menuFuncBase ',' func ')'/ABR/a href=' JavaScript :rel=' external no follow ' rel=' external no follow ' rel=' external no follow ' rel=' external no follow ' class=' button button-warning button-rounded button-small ' onclick=' Toright(' MenuFuncK ',' menuFuncBase ',' func ')'/ABR/a href=' JavaScript :rel=' external nofollow ' rel=' external nofollow ' rel=' external nofollow ' rel=' external nofollow ' class=' button button-warning button-rounded button-small ' onclick=' all to right(' menuFunc ',' menuFuncBase ',' func ')'/ABR///div/div总结

以上所述是小编给大家介绍的框架实现左右两侧菜单添加、移除功能,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对我们网站的支持!

更多资讯
游戏推荐
更多+