Hi,

I have a thickbox which is working perfectly apart from when you press
the escape key on win xp running FF3.

Nothing happens. I looked at the code and saw this (keycode 27 is
escape on IE):

document.onkeydown = function(e){
        if (e == null) { // ie
                keycode = event.keyCode;
        } else { // mozilla
                keycode = e.which;
        }
        if(keycode == 27){ // close
                tb_remove();
        } else if(keycode == 190){ // display previous image
                if(!(TB_NextHTML == "")){
                        document.onkeydown = "";
                        goNext();
                }
        } else if(keycode == 188){ // display next image
                if(!(TB_PrevHTML == "")){
                        document.onkeydown = "";
                        goPrev();
                }
        }
};

I think the problem may be on this line:

keycode = e.which;

Should this be:

keycode = e.DOM_VK_ESCAPE;

Has anyone else seen this problem, have a fix?

Cheers,

Dave

Reply via email to