我在网上多次看到这个问题,但没有一个真正有我需要的。
是否有可用的用 Javascript 编写的多选下拉组合框,这样我就可以避免重新发明轮子?
(我还在学习网络编程,所以我还不太习惯制作自己的弹出窗口......)
我需要的是此:
(来源:googlecode.com)
但是,这个有几个缺陷:
- 最新版本的侧面似乎没有按钮
- 宽度任意变大,或者保持固定大小(我需要一个“最大宽度”选项)
- 控件应该看起来浏览器中原生,而非定制。这里的箭头只是一个 PNG 文件,它不关心浏览器实际为常规组合框显示的内容。
有什么想法吗?
I've seen this question many times online, but none of them really have what I need.
Is there any available multi-select drop-down combo-box written in Javascript available, so that I can avoid reinventing the wheel?
(I'm still learning web programming, so I'm not too comfortable with making my own pop-ups yet...)
What I need is pretty much this:
(source: googlecode.com)
However, this one has several flaws:
- The latest version doesn't seem to have the button on the side
- The width grows arbitrarily big, or remains a fixed size (I need a "maximum width" option)
- The control should look native in the browser, not custom-made. The arrow here is just a PNG file, and it pays no attention to what the browser actually displays for a regular combo-box.
Any ideas?
发布评论
评论(1)
有很多可用的插件,我想您已经知道了。
但是,我不确定是否有办法检测浏览器实际呈现的方式。即使在 IE/XP 中,也没有简单的方法来判断视觉样式是否关闭(除了滚动条宽度计算等黑客行为)。找到一个声称具有原生外观和感觉的(不确定是否可以在选项中进行复选框):http://www.thunderguy.com/semicolon/2009/07/16/simple-combo-box-jquery-plugin/
There are plenty of plugins available which I think you're already aware of.
However, I'm not sure if there is a way to detect how the browser renders it actually.Even in IE/XP, there's no easy way to tell if Visual styles are turned off or not (other than hacks like scrollbar width calculation etc).Found one that claims to have native look and feel (not sure if you can do checkboxes in options): http://www.thunderguy.com/semicolon/2009/07/16/simple-combo-box-jquery-plugin/