HTML<选择>元素缩写在iPhone或Android浏览器缩写、元素、浏览器、LT

2023-09-04 09:48:43 作者:用余生告别

我在一个位的情况与我的HTML <选择> 的下拉列表中,当它们被显示在iPhone或Android浏览器。我经常需要渲染的<选项> 标签是相当长的,如例如

I'm in a bit of a situation with my HTML <select> dropdowns, when they are displayed in an iPhone or Android browser. I often need to render <option> labels that are quite long, such as for instance

[AccountType] [EUR] - [客户] - CH12 3456 7890 1234 5678 9

[AccountType] [EUR] - [Customer] - CH12 3456 7890 1234 5678 9

在Android上,这将使得这样的事情:

On Android, this will render something like that:

在iPhone上它甚至更糟。虽然我喜欢的本机外观,标签的种植是一个没有去。用红笔圈出来,你会发现怎么下拉本身的呈现方式。我可以住在一起。但检查出出现的是,当我点击它的蓝色弹出。用户永远不会发现他的数据...

On the iPhone it's even worse. While I like the native look and feel, the cropping of the labels is a no-go. Circled in red, you'll find how the dropdown itself is rendered. I could live with that. But check out the blue popup that appears, when I click on it. The user will never find his data...

...考虑以下几点:

... consider these points:

我可以缩写一些信息,但我仍然有与选择长选项标签的情况。因此,没有必要告诉我,IBAN可以缩写等。 在我不能依靠&LT CSS样式,选择&GT; 或&LT;选项&GT; 元素 在用户的猎人已经提出在&LT; OPTGROUP&GT; 标记here.这是一个相当不错的想法,将是一个小的解决办法,但还不够,因为IBAN仍然受到iPhone和Android的浏览器裁剪: - ( 我已经知道了非常好看的 jQuery UI的Selectme​​nu原型。不幸的是,还没有使用jQuery UI的1.8.5兼容,也不能保证什么时候会是稳定的。 在我使用jQuery和jQuery UI的1.8.5,所以任何想法/引用插件是非常欢迎的。 在任何其他的想法来绕过这个问题的一般的欢迎。 I can abbreviate some information, but I will still have cases with long option labels in the select. So no need to tell me that the IBAN could be abbreviated, etc. I cannot rely on CSS styling of <select> or <option> elements. User hunter has already proposed the <optgroup> tag here. That's quite a nice idea and will be a small workaround, but is not enough, as the IBAN is still cropped by both iPhone and Android browsers :-( I already know the very nice looking jQuery UI Selectmenu prototype. Unfortunately, it's not yet compatible with jquery-ui 1.8.5 and there is no guarantee when it will be stable. I am using jquery and jquery-ui 1.8.5, so any ideas / references to plugins are very welcome. Any other ideas to circumvent that problem GENERALLY are welcome.

推荐答案

虽然通过的猎人和伊万Buttinoni 的是有创意,好点子,我给出的建议解决方法发现,在端部的不同的解决方案。现在看起来类似于jQuery用户界面的ComboBox组件:

While the proposed workarounds given by hunter and Ivan Buttinoni were creative, and good ideas, I had to find a different solution in the end. It now looks similar to jQuery UI's combobox component:

http://jqueryui.com/demos/autocomplete/#combobox