对话框_ jQuerymobile [英] Dialog _ jQuerymobile

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

问题描述

我想基于Ajax结果打开对话框. 如何从.js文件创建/打开对话框?

I want to open the dialog box based on the Ajax result. How to create/open the dialog from the .js file?

任何人都可以帮助我.

先谢谢.

推荐答案

如果您只是链接到这样的文件:

if you just link to a file like this:

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

它还是通过AJAX完成的,并且对于那些对JS的支持较少的人来说,它的性能会很好.

it's done with AJAX anyway and degrades nicely for people with lesser JS support.

您想要的方式:

为您的内容创建一个环绕式div并为其赋予一个data-role=dialog属性,然后在其上调用.dialog();如果对话框不起作用,则调用.page(). 更新: 借助JQMbeta2,他们引入了创建"事件,您必须在事件上触发该事件,而不是使用.page

Create a wrapping div for your content and give it a data-role=dialog attribute, then call .dialog() on it, or .page() if dialog doesn't work. update: With JQMbeta2 they introduces a 'create' event which you have to trigger it on stuff instead of using .page

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

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