[AngularJS] Accessible Button Events
Often buttons need to be handled by JavaScript, and if done improperly it can lead to accessibility issues. In this lesson you will improve a major news organization's global header with some basic HTML and JavaScript.
Normal you should use native 'button' to make a button instead of use other html element to make a button, then you can access the button thought the keyboard.
If you use a 'div', then what you should do to make it accessible to the user by keyborad, you should add 'role', 'tabindex' & 'aria-label' to it:
<button aria-label="Help">
<i class="icon icon-help"></i>
</button> <div class="button" role="button" tabindex="0" aria-label="Menu">
<i class="icon icon-menu"></i>
</div>
If you use AngularJS,and you want press 'Enter' to get the handle event, you should add 'ng-keydown' for it:
<button aria-label="Help" ng-click="doStuff()">
<i class="icon icon-help"></i>
</button> <div class="button" role="button" tabindex="0" aria-label="Menu" ng-click="doStuff()" ng-keydown="doStuff()">
<i class="icon icon-menu"></i>
</div>
[AngularJS] Accessible Button Events的更多相关文章
- Part 39 AngularJS route change events
In this video we will discuss1. Different events that are triggered when a route change occurs in an ...
- Angularjs学习笔记1_基本技巧
10.AngularJS ng-click <button ng-click="clickCounter = clickCounter + 1">Click Me! ...
- AngularJs MVC 详解
为什么在前端也需要MVC 1.代码规模越来越大,切分职责是大势所趋 2.为了复用 3.为了后期维护方便 MVC的目的是为了模块化和复用 前端实现MVC的困难 1.操作DOM必须等整个页面加载完 2.多 ...
- AngularJS的控制器示例
代码下载:https://files.cnblogs.com/files/xiandedanteng/angularjsCtrl.rar 代码: <!DOCTYPE HTML PUBLIC &q ...
- Best Practices for Speeding Up Your Web Site
The Exceptional Performance team has identified a number of best practices for making web pages fast ...
- [转载]Best Practices for Speeding Up Your Web Site
原文:http://developer.yahoo.com/performance/rules.html 提升网站加载速度的一些优化技巧,大部分在前端层面. 不知道是多久以前写的,看起来有些已经过时了 ...
- 札记:android手势识别,MotionEvent
摘要 本文是手势识别输入事件处理的完整学习记录.内容包括输入事件InputEvent响应方式,触摸事件MotionEvent的概念和使用,触摸事件的动作分类.多点触摸.根据案例和API分析了触摸手势T ...
- [蓝牙] 3、 剖析BLE心率检测工程
位于:<KEIL path> \ARM\Device\Nordic\nrf51822\Board\pca10001\s110\ble_app_hrs Heart Rate Example ...
- 如何将GridViewEX升级到UWP(Universal Windows Platform)平台
引言 上一篇文章中,我们主要讲解了如何在保证GridView控件的用户体验基础上,扩展GridView生成GridViewEx控件,增加动态添加新分组功能等,本文在上文的基础上,介绍如何在Window ...
随机推荐
- SQL RIGHT JOIN 关键字
SQL RIGHT JOIN 关键字 RIGHT JOIN 关键字会右表 (table_name2) 那里返回所有的行,即使在左表 (table_name1) 中没有匹配的行. RIGHT JOIN ...
- Win7下的DragEnter、DragDrop事件不触发的解决方案
Win7与原来的XP和Win2003相比,安全控制方面更严格.比如,当我们以administrator登陆XP或Win2003时,运行所有的程序即是以管理员的身份启动的.但当以administrato ...
- C++ static_cast dynamic_cast reinterpret_cast const_cast转换
static_cast <type-id> ( expression ) 和C风格的类型转换相似,可以转换一个指针到基类,或者派生类.不做Run-time类型检查,这样转换并不总是安全的. ...
- [MySQL-1] mysql error 1101 blob/text column can't have a default value
在MySQL Query Browser上创建一个含有TEXT类型的字段,创建不成功,报错:mysql error 1101 blob/text column can't have a default ...
- VIP网络水军账号
作为一个技术部的组长,主管公司用户相关的项目.今天一名营销同事找我说他想长生3000个水军账号,我首先就想到了以下几个问题: 1.如何实现 2.产生水军对运营项目的影响,主要问题就是一个真实性问题. ...
- [原]《打造未来的Java》视频笔记
[Date]2013-09-28 [Author]wintys (wintys@gmail.com) http://wintys.cnblogs.com [Content]: 1.Java7新特性 1 ...
- Leetcode OJ : Restore IP Addresses backtrack暴搜 C++ solution
class Solution { public: vector<string> ret; string src; int len; unordered_set<string> ...
- Android SDK Manager无法更新的解决办法
Fetching https://dl-ssl.google.com/android/repository/addons_list-1.xmlFailed to fetch URL https://d ...
- linux tar打包
范例一:将整个 /etc 目录下的文件全部打包成为 /tmp/etc.tar[root@linux ~]# tar -cvf /tmp/etc.tar /etc <==仅打包,不压缩![root ...
- Intra Refresh of H264 encoder
https://en.wikipedia.org/wiki/X264 x264 is able to use Periodic Intra Refresh instead of keyframes, ...