You have to use a named function so you can reference that specific handler when calling .unbind()
, like this:
function keyUpFunc(e) {
if (e.keyCode == 27) { functionZzy(); }
}
$(document).keyup(keyUpFunc);
Then later when unbinding:
$(document).unbind("keyup", keyUpFunc);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…