how can i get into the combo box without clicking on the Combo Box. Just by clicking on a link, div or something else? onclick="...."
The ComboBox (multiple) has style="visibility: hidden". It should run on an iphone.
Sample开发者_JAVA技巧 Code:
<div onclick="jumpintoComboBox()">click</div><select id="direct" multiple style="visibility: hidden">...</select>
function jumpintocombobox() { $('#direct').focus() }
Thanks.
The select
element is one of the few form controls that requires a native click event to activate focus in Safari on iOS. Not even using document.createEvent
and document.dispatchEvent
will work. It's part of the browser's security model to only allow deliberate 'taps' from the user to open the form control.
One way to achieve what you want would be to position the select
element for your combo box in the area you want the user to click and style it differently, perhaps so it appears like a button if that's what you want.
精彩评论