i think the event listener of keydown should add to the element window.
if you take a globa varriable, it will run.

my solution is:

after the codes, take a varriable like this;

var win = window;
window.addEvent('domready', function(){

            new bounceBox({showOnLoad: true, overlay: true, position:
'center'});

        });


then when you add the linstener,like this:


        win.addEvent('keydown', function(event){
            //console.log('ok');
            if (event.code == '27') {
                    this.displayBounceBox();
                }
            }.bind(this)
        );

Reply via email to