.focusin (handler)

· 8년 전 · 1562

.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>

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

개발자팁

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

+
분류 제목 글쓴이 날짜 조회
jQuery 8년 전 조회 1,444
jQuery
[jQuery]
8년 전 조회 1,860
jQuery 8년 전 조회 5,450
기타 8년 전 조회 3,188
jQuery
[jQuery]
8년 전 조회 1,567
jQuery 8년 전 조회 1,739
jQuery 8년 전 조회 1,839
PHP 8년 전 조회 5,164
node.js 8년 전 조회 4,165
jQuery 8년 전 조회 2,237
jQuery 8년 전 조회 1,679
jQuery 8년 전 조회 1,230
jQuery 8년 전 조회 1,952
jQuery 8년 전 조회 1,451
jQuery 8년 전 조회 1,563
jQuery 8년 전 조회 1,789
jQuery 8년 전 조회 2,022
jQuery 8년 전 조회 1,558
jQuery 8년 전 조회 1,491
jQuery 8년 전 조회 1,585
jQuery
[jQuery]
8년 전 조회 1,469
jQuery 8년 전 조회 1,599
jQuery 8년 전 조회 1,646
jQuery 8년 전 조회 1,663
jQuery 8년 전 조회 1,848
jQuery 8년 전 조회 1,778
jQuery 8년 전 조회 1,641
jQuery 8년 전 조회 1,713
jQuery 8년 전 조회 1,510
jQuery
[jQuery]
8년 전 조회 1,472
🐛 버그신고