且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

一行中有多个选择选项

更新时间:2023-09-18 18:30:34

这是一个(相对)简单的模拟select元素的解决方案。我写过jQuery,但它也可以在纯JS中完成。

This is a (relatively) simple solution that emulates a select element. I've written it in jQuery but it could be done in pure JS as well.

在我的演示中,元素每行浮动两次,但显然这可以很容易地更改。

In my demo the elements are floated two per row but obviously this could be changed easily.

这是小提琴。

编辑:错过了它是多重选择。这是更新的多选版本

Missed that it's a multiple select. Here is an updated multiple select version.