关于使用 Tabindex 和 javascript/jquery 进行“制表符”操作的建议更轻松
我正在制作一个大型且复杂的应用程序,我需要设置选项卡索引来帮助用户浏览页面。这是一个私人应用程序,因此我对使用 javascript (jquery) 没有任何限制。
我目前有这些问题。
1) 如何使用 javascript (jquery) 强制浏览器在页面加载后立即将光标移动到特定文本框中?我注意到浏览器通常不会自动将光标放在第一个制表符索引输入中。我想要一种万无一失的方法,无论如何都会迫使它到达那里。
2)一些激活ui enanchement的字段(即jquery ui datepicker)存在选项卡问题(例如必须按两次选项卡才能离开它),有什么方法可以避免这种情况吗?
3)如何用jquery读取和设置tabindex?我有一些字段根据用户操作隐藏/显示,如果它们被隐藏,它们应该能够将其 tabindex“给予”其他字段,这是一个问题,浏览器在页面加载后是否仍然考虑 tabindex?
非常感谢你
I'm making a large and complex application and I need to set tabindexes to help user navigate through the pages. This is a private application so I don't have restriction about (ab)using javascript (jquery).
I currently have these questions.
1) How do you force with javascript (jquery) the browser to move the cursor inside a specific textbox as soon as a page has loaded? I noticed that often browsers don't automatically put the cursor inside the first tabindexed input. I want a surefire way that forces it there no matter what.
2) Some fields that activate ui enanchement (namely jquery ui datepicker) have problems with tabbing (like having to push tab two time to go away from it), is there any way to avoid this?
3) How do you read and set tabindex with jquery? I have some fields that get hidden/shown based on user action and they should be able to "give" their tabindex to other fields if they get hidden, is this a problem, does the browser still consider a tabindex after the page has loaded?
Thank you very muchh
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
$('#firstBox').focus();
请在此处查看更多示例:如何自动设置焦点.. .$('#firstBox').focus();
See more examples here: How do you automatically set the focus...