수

.focusin (handler)

· 2017-10-11 (수) 14:02:46 · 2042

.focusin (handler)


설명 : 이벤트 핸들러를 "focusin"이벤트에 바인딩하십시오.



이 방법은 .on( "focusin", handler )첫 번째 두 가지 변형과 .trigger( "focusin" )세 번째 변형에 대한 바로 가기입니다 .


이 focusin이벤트는 요소 나 요소 내부에 포커스가있을 때 요소로 보내집니다. 이는 부모 요소에서 포커스 이벤트 감지를 지원한다는 점에서 포커스 이벤트와 다릅니다 (즉, 이벤트 버블 링을 지원함).


이 이벤트는 focusout 이벤트 와 함께 사용됩니다 .


추가 참고 사항 :


.focusin()방법은 단지 약어 .on( "focusin", handler )일 뿐이 므로 분리는 사용이 가능합니다 .off( "focusin" ).

예:

페이지의 단락 내에 초점이 맞는지 살펴보십시오.


<!doctype html>

<html lang="en">

<head>

  <meta charset="utf-8">

  <title>focusin demo</title>

  <style>

  span {

    display: none;

  }

  </style>

  <script src="https://code.jquery.com/jquery-1.10.2.js"></script>

</head>

<body>

 

<p><input type="text"> <span>focusin fire</span></p>

<p><input type="password"> <span>focusin fire</span></p>

 

<script>

$( "p" ).focusin(function() {

  $( this ).find( "span" ).css( "display", "inline" ).fadeOut( 1000 );

});

</script>

 

</body>

</html>

|
댓글을 작성하시려면 로그인이 필요합니다.

개발자팁

5,403건

개발과 관련된 유용한 정보를 공유하세요. 질문은 QA에서 해주시기 바랍니다.

+
분류 제목 글쓴이 날짜 조회
jQuery 17-10-11 조회 2,472
jQuery 17-10-11 조회 1,943
jQuery 17-10-11 조회 2,043
jQuery 17-09-29 조회 2,269
jQuery 17-09-29 조회 2,503
jQuery 17-09-29 조회 2,052
jQuery 17-09-26 조회 1,974
jQuery 17-09-26 조회 2,063
jQuery
[jQuery]
17-09-26 조회 1,835
jQuery 17-09-22 조회 2,079
jQuery 17-09-22 조회 2,138
jQuery 17-09-22 조회 2,107
jQuery 17-09-21 조회 2,299
jQuery 17-09-21 조회 2,249
jQuery 17-09-21 조회 2,117
jQuery 17-09-19 조회 2,176
jQuery 17-09-19 조회 1,913
jQuery
[jQuery]
17-09-19 조회 1,916
jQuery
[jQuery]
17-09-18 조회 2,082
jQuery 17-09-18 조회 1,995
jQuery 17-09-18 조회 1,695
jQuery 17-09-14 조회 2,108
jQuery 17-09-14 조회 1,804
jQuery 17-09-14 조회 2,042
jQuery 17-09-11 조회 2,433
jQuery 17-09-11 조회 2,471
jQuery 17-09-11 조회 1,985
jQuery 17-09-10 조회 2,051
jQuery 17-09-10 조회 2,486
jQuery
[jQuery]
17-09-10 조회 1,940