I am using jQuery to manage a keypress on my document and open a new window:
$(document).keypress(function(event){
var keycode = (event.keyCode ? event.keyCode : event.which);
if(keycode == '13') {
// Open a new window
}
});
The problem is I have a jQuery accordion that I want to stay CLOSED until a user explicitly clicks on it. I managed to get the accordion to not open on the 'enter' keypress, but if another window opens in a new tab and becomes active, the accordion opens.
Problem is I have no idea to find out what even is getting fired on the accordion that allows it to open.
Is there a way to nuke all events on an element and then just add back the one that you want (in my case the mouse down or click)? Or to report which events are being handled by that element so that I could just try to unbind that one?