-2

I try to animate header in IE8 but i see error "Invalid procedure call or argument"

function init() {
    window.addEventListener( 'scroll', function( event ) {
        if( !didScroll ) {
            didScroll = true;
            setTimeout( scrollPage, 250 );
        }
    }, false );
}

I wound similar solution here ( addEventListener not working in IE8 ) but i can't modify my source....

Community
  • 1
  • 1

1 Answers1

1

So that you have an answer you can accept, summarizing the comments:

  • If you can modify your JavaScript code (despite what it says in the question), you can use the techniques in the answers to the question you linked to hook the event.

  • If you can modify your HTML but not your JavaScript, you can add a script prior to your existing one that adds a polyfill to IE to make addEventListener available. elclanrs pointed to this one.

  • If you can't do either of those things, there's nothing you can do.

Community
  • 1
  • 1
T.J. Crowder
  • 1,031,962
  • 187
  • 1,923
  • 1,875