JQuery-mobile pop up/ dialog box?

微笑、不失礼 提交于 2019-12-10 12:03:12

问题


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!


回答1:


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.



来源:https://stackoverflow.com/questions/6938815/jquery-mobile-pop-up-dialog-box

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!