【问题标题】:Android - Jquery Mobile - Buttons show through Alert BoxAndroid - Jquery Mobile - 通过警报框显示按钮
【发布时间】: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


    【解决方案1】:

    1) 没有 jQuery Mobile - 你在上面开始的,这里有一个类似的讨论:

    jQuery: How can i create a simple overlay?

    2) 你也可以像这样使用 jQuery Mobile 来完成对话框:

    <a href="content.html" data-rel="dialog">Open dialog</a> 
    

    文档: http://jquerymobile.com/demos/1.0b2/#/demos/1.0b2/docs/pages/page-dialogs.html

    【讨论】:

    • 覆盖是要走的路。谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-07-15
    • 1970-01-01
    • 2013-05-25
    • 1970-01-01
    • 1970-01-01
    • 2020-04-12
    • 1970-01-01
    相关资源
    最近更新 更多