.focusin (handler)
.focusin (handler)
설명 : 이벤트 처리기를 "focusout"JavaScript 이벤트에 바인딩합니다.
이 메소드는 인수가 전달 된 경우 .on( "focusout", handler )와 .trigger( "focusout" )인수가 전달되지 않은 경우 의 바로 가기입니다 .
focusout이벤트는 그것을, 또는 그것의 내부에 어떤 요소가 포커스를 잃을 요소로 전송됩니다. 이는 자손 요소에 대한 초점 손실 감지 (즉, 이벤트 버블 링을 지원함)를 지원한다는 점에서 blur 이벤트와 구별됩니다 .
이 이벤트는 focusin 이벤트 와 함께 사용됩니다 .
추가 참고 사항 :
.focusout()방법은 단지 약어 .on( "focusout", handler )일 뿐이 므로 분리는 사용이 가능합니다 .off( "focusout" ).
예:
단락 내부에서 발생하는 포커스 손실을 관찰하고 focusout카운트와 카운트 의 차이를 확인하십시오 blur. ( blur이벤트는 거품이 없으므로 카운트가 변경되지 않습니다.)
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>focusout demo</title>
<style>
.inputs {
float: left;
margin-right: 1em;
}
.inputs p {
margin-top: 0;
}
</style>
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>
<div class="inputs">
<p>
<input type="text"><br>
<input type="text">
</p>
<p>
<input type="password">
</p>
</div>
<div id="focus-count">focusout fire</div>
<div id="blur-count">blur fire</div>
<script>
var focus = 0,
blur = 0;
$( "p" )
.focusout(function() {
focus++;
$( "#focus-count" ).text( "focusout fired: " + focus + "x" );
})
.blur(function() {
blur++;
$( "#blur-count" ).text( "blur fired: " + blur + "x" );
});
</script>
</body>
</html>
게시판 목록
개발자팁
질문은 QA에서 해주시기 바랍니다.
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 5276 | 2년 전 | 1336 | |||
| 5275 | 2년 전 | 1406 | |||
| 5274 | 기타 | 2년 전 | 825 | ||
| 5273 | JavaScript |
swallow
|
2년 전 | 1056 | |
| 5272 | node.js |
swallow
|
2년 전 | 750 | |
| 5271 | JavaScript |
swallow
|
2년 전 | 1503 | |
| 5270 | PHP |
swallow
|
2년 전 | 851 | |
| 5269 | node.js |
swallow
|
2년 전 | 688 | |
| 5268 | node.js |
swallow
|
2년 전 | 1217 | |
| 5267 | PHP |
swallow
|
2년 전 | 1600 | |
| 5266 | MySQL |
swallow
|
2년 전 | 1096 | |
| 5265 | PHP |
swallow
|
2년 전 | 2037 | |
| 5264 | JavaScript |
swallow
|
2년 전 | 862 | |
| 5263 | 기타 |
swallow
|
2년 전 | 2985 | |
| 5262 | 기타 |
swallow
|
2년 전 | 671 | |
| 5261 | node.js |
swallow
|
2년 전 | 1066 | |
| 5260 | JavaScript |
swallow
|
2년 전 | 1514 | |
| 5259 | node.js |
swallow
|
2년 전 | 737 | |
| 5258 | node.js |
swallow
|
2년 전 | 1750 | |
| 5257 | node.js |
swallow
|
2년 전 | 1303 | |
| 5256 | PHP |
swallow
|
2년 전 | 1942 | |
| 5255 | node.js |
swallow
|
2년 전 | 692 | |
| 5254 | PHP |
swallow
|
2년 전 | 3019 | |
| 5253 | node.js |
swallow
|
2년 전 | 683 | |
| 5252 | 정규표현식 |
swallow
|
2년 전 | 625 | |
| 5251 | node.js |
swallow
|
2년 전 | 884 | |
| 5250 | PHP |
swallow
|
2년 전 | 1117 | |
| 5249 | node.js |
swallow
|
2년 전 | 1066 | |
| 5248 | PHP |
swallow
|
2년 전 | 1413 | |
| 5247 | node.js |
swallow
|
2년 전 | 1022 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기