Return to Snippet

Revision: 12359
at March 25, 2009 17:13 by terrencewood


Updated Code
/// Depends on jquery and jquery ui


// Method 1, bind to tabsshow event
$('#tabs').tabs().bind('tabsshow', function(ev, ui) {
    $(ui.panel).attr('tabindex','0').focus().removeAttr('tabindex');
});

// Method 2, bind to click event refocusses content in existing tab
$('#tabs').tabs().find(' > ul a').bind('click', function (){
    $($(this).attr('href')).attr('tabindex','0').focus().removeAttr('tabindex');
});

// Method 3, bind to tabshow within options

		$('#tabs').tabs({
		
			fx: { opacity: 'toggle', duration: 'fast' },
			show: function(event, ui) {$(ui.panel).attr('tabindex','0').focus().removeAttr('tabindex')}
			
			});

Revision: 12358
at March 12, 2009 21:31 by terrencewood


Updated Code
/// Depends on jquery and jquery ui


// Method 1, bind to tabsselect event
$('#tabs').tabs().bind('tabsshow', function(ev, ui) {
    $(ui.panel).attr('tabindex','0').focus().removeAttr('tabindex');
});

// Method 2, bind to click event refocusses content in existing tab
$('#tabs').tabs().find(' > ul a').bind('click', function (){
    $($(this).attr('href')).attr('tabindex','0').focus().removeAttr('tabindex');
});

Revision: 12357
at March 11, 2009 23:58 by terrencewood


Initial Code
// Method 1, bind to tabsselect event
$('#tabs').tabs().bind('tabsshow', function(ev, ui) {
    $(ui.panel).attr('tabindex','0').focus().removeAttr('tabindex');
});

// Method 2, bind to click event refocusses content in existing tab
$('#tabs').tabs().find(' > ul a').bind('click', function (){
    $($(this).attr('href')).attr('tabindex','0').focus().removeAttr('tabindex');
});

Initial URL


Initial Description
jquery ui/tabs initiation ensures screenreaders can focus content when selecting tabs. Tested using Jaws 8.

Initial Title
jquery accessible tabs

Initial Tags
javascript, jquery

Initial Language
jQuery