a11y-dialog

编程之家收集整理的这个编程导航主要介绍了a11y-dialog编程之家,现在分享给大家,也给大家做个参考。

a11y-dialog 介绍

A11y Dialog一个非常轻便和灵活的可访问模态对话框。它没有依赖关系,一个JavaScript API,DOM API和事件处理。 

特点

无依赖项

利用本机<dialog>元素

overlay叠加点击和关闭对话框ESC

切换aria-*属性

捕捉和恢复焦点

触发事件

DOM和js API快速而微小 

安装

npm install a11y-dialog --save

使用

<!--

Main container related notes:

- It can have a different id than `main`,however you will have to pass it as a second argument to the A11yDialog instance. See further down.

-->

<div id="main">

<!--

Here lives the main content of the page.

-->

</div>

<!--

Dialog container related notes:

- It is not the actual dialog window,just the container with which the script interacts.

- It can have a different id than `my-accessible-dialog`,but it needs an `id`

anyway.

-->

<div id="my-accessible-dialog">

<!--

Overlay related notes:

- It has to have the `tabindex="-1"` attribute.

- It doesn’t have to have the `data-a11y-dialog-hide` attribute,however this is recommended. It hides the dialog when clicking outside of it.

-->

<div tabindex="-1" data-a11y-dialog-hide></div>

<!--

Dialog window content related notes:

- It is the actual visual dialog element.

- It may have the `alertdialog` role to make it behave like a “modal”. See the “Usage as a modal” section of the docs.

- It doesn’t have to be a `<dialog>` element,it can be a `<div>` element with the `dialog` or `alertdialog` role (e.g. `<div role="dialog">`).

- It doesn’t have to have the `aria-labelledby` attribute however this is recommended. It should match the `id` of the dialog title.

-->

<dialog aria-labelledby="dialog-title">

<!--

Closing button related notes:

- It does have to have the `type="button"` attribute.

- It does have to have the `data-a11y-dialog-hide` attribute.

- It does have to have an aria-label attribute if you use an icon as content.

-->

<button type="button" data-a11y-dialog-hide aria-label="Close this dialog window">

×

</button>

<!--

Dialog title related notes:

- It should have a different content than `Dialog Title`.

- It can have a different id than `dialog-title`.

-->

<h1 id="dialog-title">Dialog Title</h1>

<!--

Here lives the main content of the dialog.

-->

</dialog>

</div>

网站地址:#

GitHub:https://github.com/edenspiekermann/a11y-dialog

网站描述:一个非常轻便和灵活的可访问模态对话框

a11y-dialog

官方网站:#

小编说

以上是编程之家为你收集整理的a11y-dialog全部内容。

如果觉得编程之家网站内容还不错,欢迎将编程之家推荐给好友。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


scalable.js,一款可以使任何HTML元素动态缩放适合父元素的js插件
Pica,使用JS进行快速高品质图像缩放
react-dates,React 日期组件
date-fns,轻量级的JavaScript 日期工具库
WOW.js,一款效果炫酷的元素在页面滚动时展示CSS3动画的JS插件
Pikaday,一个 轻量级、无依耐Js日期选择器
ngDialog,一个基于AngularJS的扩展对话框模块
react-swipeable-views,一个 React 轮播组件
lazysizes.js,响应式图像延迟加载JS插件【懒加载】
Flickity,一款自适应手机触屏滑动插件
screenfull.js,浏览器全屏插件
ueditor,由百度web前端研发部开发所见即所得富文本web编辑器
Darkmode.js,一键为网站添加黑暗模式
PhotoClip.js,一款手势驱动的裁图插件
react-native-masonry,用于渲染一个图像masonry~ish布局react-native组件
PixelMatch,一个最小、最简单、最快的js像素级图像比较库
number-flip,一款 js 数字翻转切换插件
vue-core-image-upload,图片剪切和上传的 vue 插件
vue-awesome-swiper,基于swiper、Vue.js 的 Swiper 组件
hashids.js,数字生成类似YouTube的ID的js库