简体   繁体   中英

Drop-Down Combo-box in HTML (with Javascript or JQuery)?

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?

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/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM