1/** 2 * Skip link focus fix 3 * 4 * @package llorix-one-lite 5 */ 6 7( function() { 8 var is_webkit = navigator.userAgent.toLowerCase().indexOf( 'webkit' ) > -1, 9 is_opera = navigator.userAgent.toLowerCase().indexOf( 'opera' ) > -1, 10 is_ie = navigator.userAgent.toLowerCase().indexOf( 'msie' ) > -1; 11 12 if ( ( is_webkit || is_opera || is_ie ) && document.getElementById && window.addEventListener ) { 13 window.addEventListener( 14 'hashchange', function() { 15 var id = location.hash.substring( 1 ), 16 element; 17 18 if ( ! ( /^[A-z0-9_-]+$/.test( id ) ) ) { 19 return; 20 } 21 22 element = document.getElementById( id ); 23 24 if ( element ) { 25 if ( ! ( /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) ) { 26 element.tabIndex = -1; 27 } 28 29 element.focus(); 30 } 31 }, false 32 ); 33 } 34})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.