问题
I have an issue with a select box on a website that is being browsed by iPad. The select box is within a jquery dialog that is being hidden/shown with jQuery. The dialog that contains the select box is hidden when the user first hits the page. There is a trigger that the user can click to open the dialog containing the select box, but as soon as the dialog is shown iPad automatically opens up it's native select box UI instead of waiting until the user touches it. Any ideas? Here is the site and an image of the layout. http://patriotvanlines.com.
I would add the code for this but I'm thinking it's most likely a bug of some sorts iPad has with jQuery.
回答1:
ihave not worked that closely with the IOS myself but I am wondering if this little hack would help it. you add an attribute on the select disabled="disabled"
and remove the attribute using jquery when your image is clicked on.
回答2:
You can see that even in a typical browser the first dropdown list has focus. This must be why the select list pops up on the iPad. You can test this by clicking the link and then pressing the down arrow. The select list changes.
Try a simple $('#state1').blur()
in the popup callback to remove focus.
Oh, and here is another idea. If the popup automatically gives focus to the first input on open then you may be able to include a hidden input to take the focus for you.
来源:https://stackoverflow.com/questions/7248945/ipad-opens-html-select-elements-automatically