2007-10-02

用tabIndex轻松实现网页导航

来源: 本站收集整理 作者:佚名 评论 0 条
 
</div>
<hr size="3" />
<div id="addressSection" tabIndex="5" style="background:gold; padding: 15px;">
Address: <input id="idaddress" size="50" name="address" tabIndex="6" maxlength="50" onkeyup="checkLen(this,this.value)" /><br />
City: <input id="idcity" size="50" name="city" tabIndex="7" maxlength="50" onkeyup="checkLen(this,this.value)" /><br />
State: <input id="idlstate" size="50" name="state" tabIndex="8" maxlength="50" onkeyup="checkLen(this,this.value)" /><br />
Country: <input id="idcountry" size="50" name="country" tabIndex="9" maxlength="50" onkeyup="checkLen(this,this.value)" /><br />
</div>
<hr size="3" />
<div id="addressSection" tabindex=10 style="background:lightblue; padding: 15px;">
Home: <input id="idhome" size="50" name="homenumber" tabIndex="11" maxlength="16" onkeyup="checkLen(this,this.value)" /><br />
Work: <input id="idwork" size="50" name="worknumber" tabIndex="12" maxlength="16"
onkeyup="checkLen(this,this.value)" /><br />
Mobile: <input id="idlcell" size="50" name="cellnumber" tabIndex="13" maxlength="16" onkeyup="checkLen(this,this.value)" /><br />
</div>
<hr size="3" />
<div id="buttonsSection" tabindex=14 style="background:green;">
<input type="button" name="submitButton" tabIndex="-1" id="idSubmitButton" value="Submit" onfocus="document.write('submit form');" />
<input type="button" name="cancelButton" tabIndex="-1" id="idCancelButton" value="Cancel" />
</div></form></body></html>

提高访问能力

为元素指定tabIndex可帮助经常使用键盘的用户更为方便地接触网络界面;非标准用户,如PDA、移动电话以及残疾人使用的屏幕阅读器也从中受益。任何扩充应用软件功能的事件都是有益的。

小事一桩

你可能要花许多时间来设计网络窗体,使其具有视觉吸引力,并能被后端服务器组件正确处理。但是,你可能忽略了要用非标准技术或浏览器对其进行测试。典型的例子就是放弃鼠标,而依靠键盘来导航窗体。HTML标准包含tabIndex特性,它答应你控制通过[Tab]键访问的项目。


共3页: 上一页 [1] [2] 3 下一页
(本文仅表明作者个人观点,不代表本站及其管理员立场.) 推荐 收藏 投稿 打印 返回 关闭
上一篇:构建自己的HTML工具  
下一篇:网络开发工具包实用工具介绍
    评论加载中…
 推荐文章
     

网站首页  -  网站地图 -   站长论坛  -  网站投稿  -    -  网站管理
Copyright © 2008 芜湖站长站 All Rights Reserved 皖ICP备07500611号