In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the "how to use jQuery to achieve multi-input drop-down combo box" related knowledge, editor through the actual case to show you the process of operation, the method of operation is simple and fast, practical, hope that this "how to use jQuery to achieve multi-input drop-down combo box" article can help you solve the problem.
The code is as follows:
Container {margin: 20px auto; padding:0 15px; width: 50%; height:300px; box-sizing: border-box;}. Text-container {display: inline-block; float:left; width: 15%; height: 32px; line-height: 32px; box-sizing: border-box;} .selectContainer {width: 70%; height:200px; float:left; position: relative; padding:0; margin:0; box-sizing: border-box } .selectedContent {width:85%; height: 25px; float:left;} .dropDown-toggle {width:14%; height:31px; line-height: 31px; text-align: center; border: 1px solid silver; border-left:none; float:left; padding:0; margin:0; box-sizing: border-box; cursor: pointer;} .dropDown-menu {margin:0; padding:0 15px 10px; width:100% Border:1px solid silver; border-top: none; box-sizing: border-box; list-style: none; position: absolute; top:31px; right:0;} .items {margin-top:8px; padding: 2px; cursor: pointer;} .items: hover {background: # ddd;} .isSelectedText {display: inline-block; width:90%;} .dsn {display: none } favorite fruit choose apples, pears, oranges, confirm $('. IsSelected input [type=checkbox]'). On ('click', function () {var selectedItems = $(this) .fruit (' .dropDown-menu'). PrevAll ('.selectedContent'). Val (). Split ('') Var thisItem = $(this). Parent (). Prev (). Text (); var isExisted = 0; var isChecked = $(this) .is (': checked'); if (isChecked) {selectedItems.map (function (item, index) {if (item = thisItem) {isExisted++}}) If (! isExisted) {selectedItems.push (thisItem)}} else {selectedItems.map (function (item, index) {if (item = thisItem) {selectedItems.splice (index, 1);}});} $(this) .requests ('.dropDown-menu') .prevAll (' .selectedContent') .val (selectedItems.join (')) }) $('.roommSelect') .on ('click', function () {$(this) .addClass (' dsn');}) $('.dropDown-toggle') .on (' click', function () {$(this) .next () .toggleClass ('dsn')})
Because the array map method is used in this component, this method may not be compatible in ie. Because my computer ie can not be opened, it can also be used normally after testing with 360browser.
This is the end of the introduction of "how to use jQuery to achieve multi-choice drop-down combo boxes". Thank you for your reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.