Question

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.

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.

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!

Was it helpful?

Solution

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');
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top