//모든 곳에서 key 다운 시
$(document).keydown(function(e){
var code = e.which? e.which : e.keyCode;
if( code == 112 ){
document.onhelp = function(){ return(false);}
window.onhelp = function(){ return(false); }
alert('test');
}
});
//input, select, textarea 에서 키 다운 시
$(document).on("keydown","input,select,textarea", function(e){
var code = e.which? e.which : e.keyCode;
if( code == 112 ){
document.onhelp = function(){ return(false);}
window.onhelp = function(){ return(false); }
alert('test');
}
});
//jquery.hotkeys.js 플러그인 사용시
$(document).bind('keyup', 'f1', function(){
document.onhelp = function(){ return(false);}
window.onhelp = function(){ return(false); }
alert('test');
});
'JQUERY > 소스코드' 카테고리의 다른 글
jquery의 html(), append(), prepend()를 이용해 html 추가하기 (0) | 2015.11.06 |
---|---|
jQuery keyup, keydown, keypress 차이점, 사용법, 크로스브라우저 사용팁 [펌글입니다] (0) | 2015.11.06 |
jquery 팝업 창 세로 중앙 정렬 (0) | 2015.11.06 |
jquery의 html(), append(), prepend()를 이용해 html 추가하기 (0) | 2015.10.15 |
제이쿼리 팝업 자식창에서 부모창 값 전달 (아이디,함수실행) (0) | 2015.10.13 |
[jQuery] append(), prepend(), after(), before() (0) | 2015.10.13 |
[jQuery] 복습 예제 : append(), prepend() 를 이용한 이미지 순환 갤러리 만들기 (간단) (0) | 2015.10.13 |
20강. jquery - 좌우스크롤,eq,length,scrollLeft.left (0) | 2015.10.13 |