I need to turn off jQuery Mobile\'s styling of drop downs. Ultimately I\'d like the device itself (iPhone, Android, Blackberry, etc.) to determin
Although this question is considered answered already, I'd like to add some more lines, since the answer didn't work "out-of-the-box" for me, and this might save some time for others.
In my case, I'm disabling the native dropdowns for a smartphone application when it runs into Android (since it has some ugly issues when opening native dropdowns, reported already in another thread). The "magic spell" that solved the problem to me is just the following lines:
$(document).bind('mobileinit',function(){
if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {
$("select").attr("data-native-menu","true");
} else {
$("select").attr("data-native-menu","false");
$.mobile.selectmenu.prototype.options.nativeMenu = false;
}
});
These lines are in a customization script loaded just after jQuery and just before jQuery-Mobile. It's important to keep the order, otherwise the controls are already initialized and it has no effect!
I hope this advice can save some time to someone!