JQuery手机弹出/对话框? [英] JQuery-mobile pop up/ dialog box?

查看:244
本文介绍了JQuery手机弹出/对话框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用jquery手机框架构建手机应用程序。我想要一个简单的对话框/弹出窗口,所以当你点击一个问号的图片时,弹出/对话框会出现一个简单的信息。
我尝试过 http://jquerymobile.com/test的不同方法/docs/pages/dialog-alt.html 等等。我不能得到他们的工作。所以如果你知道如何做一个简单的弹出窗口或一个简单的对话框,请给我一个例子。

解决方案

如果你想在jquery手机中打开一个对话框,你必须使用一个属性 data-rel =dialog,而href必须指向你对话框所在的URL: p>

 < a href =http://jquerymobile.com/test/docs/pages/dialog-alt.html role =buttondata-rel =dialog>打开对话框< / a> 

这是一个小提琴,以便您可以看到它如何工作。

希望它有帮助。



更新: p>

似乎jQuery Mobile对话框和某些设备有问题。
在GitHub信息库中打开一个问题

我发现这个插件似乎工作得很好。 p>

I am building an app for mobiles, using jquery mobile framework. I want to be able to make a simple dialog box/pop up, so that when you click on a picture of a "question mark" the pop up/ dialog box would appear with a simple message. I have tried different approaches from http://jquerymobile.com/test/docs/pages/dialog-alt.html to so many others. I couldnt get non of them to work. So If you know how to make a simple pop up or a simple dialog box could you please give me an example!

解决方案

If you want to open a dialog in jquery mobile you have to use an attribute data-rel="dialog" and the href must point to a URL where your dialog lives:

<a href="http://jquerymobile.com/test/docs/pages/dialog-alt.html" data-role="button" data-rel="dialog">Open dialog</a>

Here's a fiddle so you can see how it works.
Hope it helps.

UPDATE:

It seems there's a problem with jQuery Mobile dialog and some devices. There's an issue open in the GitHub repository.
I've found this plugin which seems to work really well.

这篇关于JQuery手机弹出/对话框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆