【发布时间】:2011-08-31 21:52:27
【问题描述】:
我的应用是使用 HTML、Javascript 和 Jquery Mobile 编写的。
在我的 HTML 页面上,我有一个 <a href>,它调用了一个打开自定义警报框的 Javascript。我还在页面上使用了几个 Jquery Mobile 元素,例如按钮和滑块。这些元素在调用时位于我的警报框顶部。
知道如何让我的警报框在调用时完全聚焦吗?
这是一些代码:
索引.html:
<a href="javascript:Alert()">Click Here</a>
<div id="AlertBox" class="alert" style="display:none" onClick="document.getElementById('AlertBox').style.display='none'">Message Here</div>
Javascript:
function DisplayAlert(id,left,top) {
document.getElementById(id).style.left=left+'px';
document.getElementById(id).style.top=top+'px';
document.getElementById(id).style.display='block';
}
function Alert() {
var something = false;
if(something) {
}
else {
DisplayAlert('AlertBox',100,50);
}
}
【问题讨论】:
标签: javascript android html jquery-mobile