模态对话框是Web上的一种好习惯吗? [英] Are modal dialogs a good practice for the web?

查看:78
本文介绍了模态对话框是Web上的一种好习惯吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

模式窗口/对话框是否被认为是网站的好习惯?使用模态窗口使我担心的一件事是,它非常类似于弹出窗口,它可能会导致用户感到沮丧或导致用户只是因为它具有侵入性而将其关闭.您是否知道有关用户偏好和使用率的任何研究?

Are modal windows/dialogs considered a good practice for websites? One of the things that concerns me about using a modal window is that it is so much like a pop-up window and it could cause user frustration or cause users to simply close it because it's intrusive. Do you know of any studies that talk about user preferences and use rates?

关闭JavaScript时,除了使用模式窗口链接将内容加载到新页面中之外,还有其他可访问性问题吗?您是否喜欢使用模态窗口的网站或Web应用程序?为什么或者为什么不?实施模式窗口的好与坏做法是什么?我知道模态可能最常用于显示图片或画廊,但是还有哪些其他实际用例?您是否在网站上使用它们,是什么导致您做出决定?

Are there any accessibility issues beyond having the a modal window link load the content in a new page when JavaScript is turned off? Do you like sites or web apps that use modal windows? Why or why not? What are good and bad practices for implementing modal windows? I know modals are probably most often used when displaying pictures or galleries, but what are some other practical use cases? Do you use them on your site and what lead you to your decision?

推荐答案

从实践的角度出发-不包括可访问性-模态窗口提供了一种替代方法,与对话框相比,它不像对话框那样令人震惊,并且不如弹出窗口那么令人讨厌.与上述两种方法中的任何一种相比,它们通常对部位具有更强的凝聚力.除了图片或媒体之外,我还使用了模态对话框来实现与对话框相同的目的-让用户提供某种形式的必需输入,或者在让用户再次与网站进行交互之前对其进行确认.

From a practice standpoint - excluding accessibility - modal windows provide an alternative that are less startling as, say, dialog boxes and feel less intrusive than pop-up windows. They usually have a more cohesive feel to the site than either of the two aforementioned method. Aside from pictures or media, I've used modal dialogs to serve the same purpose as dialog boxes - to get the user to give some form of required input, or to acknowledge something before letting them interact with the site again.

从纯粹可访问的角度来看,它们并不是那么好.它们通常需要JavaScript,并且由于针对DOM管理模态的方式,屏幕阅读器无法很好地解释它们.为了解决这个问题,适当地降级总是一个好主意-一个建议是获取模态对话框的内容并将其放置在页面上.每当出现模态对话框 时,将当前页面重定向到模态页面",获取用户的输入,然后返回到其所在的页面.

From a purely accessible standpoint, they aren't so great. They typically require JavaScript, and, because of the way that modals are managed with respect to the DOM, screen readers will not interpret them well. To combat this, it's always a good idea to degrade gracefully - one suggestion is to take the content of the modal dialog and place it on a page. Whenever the modal dialog should appear, have the current page redirect to the 'modal page', get the user's input, and return to the page it was on.

最后,就我的个人观点而言,我不介意模态窗口.我认为,如果使用得当,它们会提供不错的体验-如果引起我的注意,那么我宁愿这样做而不必将我从页面重定向到其他地方,从而表明以丑陋的操作系统为主题对话框或弹出窗口(无论如何,我的浏览器可能会阻止它).总结一下,我想,如果我不得不选择方式,我想选择一个模式对话框.

Finally, as far as my personal opinions are concerned, I don't mind modal windows. I think that, when used correctly, they provide a decent experience - if something has to get my attention, then I'd rather it do so without redirecting me from the page, showing an ugly operating system themed dialog, or a pop-up (which my browser will likely block, anyway). I guess, to sum it up, if I had to choose how I'd like to be interrupted, then I'd choose a modal dialog.

这篇关于模态对话框是Web上的一种好习惯吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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