2011-01-31 19:33:16 +00:00
|
|
|
/**
|
|
|
|
|
* jQuery tabIndex
|
|
|
|
|
*/
|
|
|
|
|
( function( $ ) {
|
2010-09-04 04:00:09 +00:00
|
|
|
/**
|
2010-09-15 02:03:24 +00:00
|
|
|
* Finds the lowerst tabindex in use within a selection
|
|
|
|
|
*
|
2011-01-10 05:33:03 +00:00
|
|
|
* @return number Lowest tabindex on the page
|
2010-09-15 02:03:24 +00:00
|
|
|
*/
|
2011-01-10 05:33:03 +00:00
|
|
|
$.fn.firstTabIndex = function() {
|
2010-09-15 02:03:24 +00:00
|
|
|
var minTabIndex = 0;
|
2011-01-10 05:33:03 +00:00
|
|
|
$(this).find( '[tabindex]' ).each( function() {
|
|
|
|
|
var tabIndex = parseInt( $(this).attr( 'tabindex' ) );
|
2010-09-15 02:03:24 +00:00
|
|
|
if ( tabIndex > minTabIndex ) {
|
|
|
|
|
minTabIndex = tabIndex;
|
|
|
|
|
}
|
|
|
|
|
} );
|
|
|
|
|
return minTabIndex;
|
|
|
|
|
};
|
2011-01-10 05:33:03 +00:00
|
|
|
|
2010-09-15 02:03:24 +00:00
|
|
|
/**
|
|
|
|
|
* Finds the highest tabindex in use within a selection
|
2010-09-04 04:00:09 +00:00
|
|
|
*
|
2011-01-10 05:33:03 +00:00
|
|
|
* @return number Highest tabindex on the page
|
2010-09-04 04:00:09 +00:00
|
|
|
*/
|
2011-01-10 05:33:03 +00:00
|
|
|
$.fn.lastTabIndex = function() {
|
2010-09-04 04:00:09 +00:00
|
|
|
var maxTabIndex = 0;
|
2011-01-10 05:33:03 +00:00
|
|
|
$(this).find( '[tabindex]' ).each( function() {
|
|
|
|
|
var tabIndex = parseInt( $(this).attr( 'tabindex' ) );
|
2010-09-04 04:00:09 +00:00
|
|
|
if ( tabIndex > maxTabIndex ) {
|
|
|
|
|
maxTabIndex = tabIndex;
|
|
|
|
|
}
|
|
|
|
|
} );
|
|
|
|
|
return maxTabIndex;
|
2011-01-31 19:33:16 +00:00
|
|
|
};
|
|
|
|
|
} )( jQuery );
|