如何在jQuery UI的滑块Handle上更改tabindex? [英] How can you change the tabindex on a jQuery UI's slider Handle?

查看:75
本文介绍了如何在jQuery UI的滑块Handle上更改tabindex?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个滑块,我需要将tabindex更改为-1。我知道这是一个巨大的不可以,但开发的网站对于使用屏幕阅读器等的人来说已经没用了。

I have a slider that I need to change the tabindex to -1 on. I know this is a huge 'no no' but the site that is developed is already useless to anyone using a screen reader etc.

问题是我有一个链接单击时打开一个颜色框。在该颜色框内部是一个在尾部滑块上分成幻灯片的形式。我所有的表单元素都设置为-1选项卡索引,但其中一个表单问题有一个Jquery UI滑块元素,允许该人设置其高度。

The issue is I have a link that when clicked opens a color box. Inside that color box is a form separated into 'slides' on a coda slider. The forms elements I have all set to a -1 tab index but one of the form questions has a Jquery UI slider element to allow the person set their height.

元素本身是一个带有类的锚标签:ui-slider-handle但它是在页面加载后创建的,所以我不能只做简单的jQuery。我尝试使用.live函数,但它想要一个eventtype。我不希望它基于除了创建之外的事件。除非您认为Keydown可以工作,因为主要目标是阻止用户按Tab键并移动滑块,表单包含在其中,而不使用下一个和上一个的滑块导航。

The element itself is an anchor tag with the class: "ui-slider-handle" but it's created after the page load so I can't just do simple jQuery. I tried using the .live function but it wants an eventtype. I don't want it to be based on an event other than just when it's created. Unless you think Keydown would work as the main objective is to stop users from pressing tab and moving the slider the form is contained within without using the slider's navigation of next and previous.

我理解这是令人困惑的,为什么有人会像这样设置一个网站,但它是在我进入图片之前。任何帮助将不胜感激!提前致谢!

I understand this is confusing as to why someone would set a site up like this but it was before I entered the picture. Any help would be greatly appreciated! Thanks in advance!

推荐答案

你说它是在页面加载后创建的。什么引擎正在创建元素?您应该能够执行Javascript代码,或者至少在元素创建后立即调用Javascript函数,在此期间您可以将属性添加到该类的所有元素:

You say it's "created after page load." What engine is creating the element? You should be able to execute Javascript code, or at least call a Javascript function immediately after the element creation, during which you could add the attribute to all elements with that class:

$('.ui-slider-handle').attr('tabindex', '-1');

这篇关于如何在jQuery UI的滑块Handle上更改tabindex?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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