첨부 된 keydown 이벤트가있는 프레임이 여러 개 있습니다. 키를 누르면이 이벤트가 발생한 프레임을 찾아야합니다.이벤트의 상위 프레임 찾기
나는 그렇게하려고 :
function initHotKeys(invokedFrameDocument) {
$(invokedFrameDocument).keydown(
function(e) {
$(e.target).closest(frame);
});
}
initHotKeys(window.frames['frame1'].document);
initHotKeys(window.frames['frame2'].document);
initHotKeys(window.frames['frame3'].document);
을하지만 변경
미안하지만 내 코드를 붙여 넣을 때 오타가 발생했습니다. 나는 $ (e.target)을 사용하려고 노력했지만 작동하지 않습니다. –
@AlexanderPavlov 관련 코드를 모두 게시 할 수 있습니까? – Felix
정확한 코드를 게시 할 수는 없지만 내가하는 일의 개념을 보여 주려고했습니다. –