jQuery Mobile弹出窗口和对话框 [英] jQuery Mobile Popups and Dialogs

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

问题描述

jQuery mobile 1.2 alpha引入了Popups,而Popups已经具有类似的名为Dialogs的小部件.它们在本质上看起来非常相似.

jQuery mobile 1.2 alpha introduces Popups while it already has a similar widget, called Dialogs. They both seem very similar in nature.

弹出窗口和对话框之间的技术区别是什么?

What are the technical differences between Popups and Dialogs?

使用对话框无法实现的弹出窗口可以执行的操作(首选任何实际用例)?

What Popups can do (any practical usecase as example preferred) that is impossible with Dialogs?

推荐答案

它们是完全不同的野兽.根据我有限的经验,这是我的看法.

They are quite different beast. Here is my opinion based on my limited experience.

对话框

Dialogues

  • 对话框占据了页面,它们包含全屏深色背景,使对话框"看起来已替换页面.

  • Dialogues take over the page, they contain a fullscreen dark background to make the "dialog" appear to have replaced the page.

通过将data-rel="dialog"属性添加到页面锚链接,可以将任何页面显示为对话框.

Any page can be presented as a dialog by adding the data-rel="dialog" attribute to the page anchor link.

像页面一样,您可以通过在链接上添加data-transition属性来在对话框中指定所需的任何页面过渡.

Like pages, you can specify any page transition you want on the dialog by adding the data-transition attribute to the link.

可以链接.

弹出窗口

Popups

  • 显示在当前页面中,可能与通常称为模式或灯箱的功能更相似.

  • Displays within the current page, and are probably more similar to the functionality commonly referred to as modals or lightboxes.

无法链接.

弹出窗口可能更适合于警报,工具提示,小的是/否确定/取消消息,将缩略图弹出窗口放大成较大的图像,小的ajax形式(时事通讯,登录名,发表评论)等.不想让页面超载信息,只想在用户需要或要求时向他们透露某些功能.

Popups are probably more suited for alerts, tooltips, small yes/no ok/cancel messages, making a thumbnail popup into a larger image, small ajax forms(newsletter, login, post a comment) etc. Useful when you don't want to overload the page with information, and only want to reveal certain functionality to users when they need or request it.

另一方面,在需要传达大量信息(条款和条件接受屏幕等)的情况下,或者在您确实想强调警报,菜单,用户的选择,等等.对话有点中断页面的流动,因此应谨慎使用.

Dialogues on the other hand could be used in situations where you need to convey a lot of information (terms and conditions acceptance screen, etc), or when you really want to emphasis an alert, menu, the choice a user has, etc. Dialogues kind of break the flow of a page so should be used more cautiously.

弹出窗口的一个整洁的功能是它们可以用作覆盖面板,可以用来创建从屏幕侧面滑入的菜单,与Facebook iphone应用程序中的菜单不太相似.

One neat feature of the popups is that they can be used as overlay panels, which could be used to create a menu that slides in from the side of the screen, not too dissimilar to the menu in the Facebooks iphone application.

最终,要么可以使用,要么对非错,其中很多都取决于个人喜好以及您希望应用程序如何流动.

At the end of the day, either could be used, and neither is right or wrong, a lot of it comes down to personal preference, and how you want your application to flow.

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

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