我弹出一个表单,它无法立即在 iPad 上专注于输入。还有一个问题是表单按钮的主题在按下后从e变成了b,而且再也变不回来了!
<div data-role="page" id="addrPage">
<div id="popupLogin" data-theme="e" class="ui-corner-all"
style="z-index: 2;position:fixed;display: none;left:10%;top:15%;width: 250px;height: 150px;background-color:#0">
<form id="OKForm" >
<input type="text" id="formEdit" value="" placeholder="Input" data-theme="e" autofocus="autofocus"/>
<button type="submit" id="btnOK" data-theme="e">
OK
</button>
</form>
</div>
<a data-role="button" id="tbProp">show</a>
</div><!-- /page -->
<script>
$('#tbProp').bind( "click", function(event, ui) {
$('#popupLogin').show();
setTimeout(function(){
$("#formEdit").focus();
},0);
});
$('#OKForm').submit(function() {
$("#popupLogin").hide();
$("btnOK").removeClass("ui-btn-up-b ui-btn-hover-b").addClass("ui-btn-up-e ui-btn-hover-e");
return false;
});
</script>
演示:http: //jsfiddle.net/gclsoft/JZgWT/1/