Sha256: c99b9b0e6f18e2095f1552d926fbb566e5cd18b3867672d84689ca97a69b9479

Contents?: true

Size: 727 Bytes

Versions: 3

Compression:

Stored size: 727 Bytes

Contents

/**
 * Makes "skip to content" link work correctly in IE9, Chrome, and Opera
 * for better accessibility.
 *
 * @link http://www.nczonline.net/blog/2013/01/15/fixing-skip-to-content-links/
 */

( function() {
	var ua = navigator.userAgent.toLowerCase();

	if ( ( ua.indexOf( 'webkit' ) > -1 || ua.indexOf( 'opera' ) > -1 || ua.indexOf( 'msie' ) > -1 ) &&
		document.getElementById && window.addEventListener ) {

		window.addEventListener( 'hashchange', function() {
			var element = document.getElementById( location.hash.substring( 1 ) );

			if ( element ) {
				if ( ! /^(?:a|select|input|button|textarea)$/i.test( element.nodeName ) ) {
					element.tabIndex = -1;
				}

				element.focus();
			}
		}, false );
	}
} )();

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
boot-cli-1.0.0 lib/templates/wordpress/wp-content/themes/twentyfifteen/js/skip-link-focus-fix.js
boot-cli-0.3.1 lib/templates/wordpress/wp-content/themes/twentyfifteen/js/skip-link-focus-fix.js
boot-cli-0.3.0 lib/templates/wordpress/wp-content/themes/twentyfifteen/js/skip-link-focus-fix.js