forked from mirror/_s
Merge pull request #461 from jefferyto/patch-2
Removed addEvent support. See #456.
This commit is contained in:
commit
3f1fe1c400
|
@ -3,9 +3,8 @@
|
|||
is_opera = navigator.userAgent.toLowerCase().indexOf( 'opera' ) > -1,
|
||||
is_ie = navigator.userAgent.toLowerCase().indexOf( 'msie' ) > -1;
|
||||
|
||||
if ( ( is_webkit || is_opera || is_ie ) && 'undefined' !== typeof( document.getElementById ) ) {
|
||||
var eventMethod = ( window.addEventListener ) ? 'addEventListener' : 'attachEvent';
|
||||
window[ eventMethod ]( 'hashchange', function() {
|
||||
if ( ( is_webkit || is_opera || is_ie ) && document.getElementById && window.addEventListener ) {
|
||||
window.addEventListener( 'hashchange', function() {
|
||||
var element = document.getElementById( location.hash.substring( 1 ) );
|
||||
|
||||
if ( element ) {
|
||||
|
|
Reference in New Issue