jQuery.fn.extend ()
jQuery.fn.extend ()
설명 : 객체의 내용을 jQuery 프로토 타입에 병합하여 새로운 jQuery 인스턴스 메소드를 제공합니다.
이 jQuery.fn.extend()메소드는 jQuery prototype ( $.fn) 객체를 확장 하여 jQuery()함수에 연결될 수있는 새로운 메소드를 제공한다 .
예:
두 개의 메소드를 jQuery prototype ( $.fn) 객체에 추가 한 다음 그 중 하나를 사용하십시오.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery.fn.extend demo</title>
<style>
label {
display: block;
margin: .5em;
}
</style>
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>
<label><input type="checkbox" name="foo"> Foo</label>
<label><input type="checkbox" name="bar"> Bar</label>
<script>
jQuery.fn.extend({
check: function() {
return this.each(function() {
this.checked = true;
});
},
uncheck: function() {
return this.each(function() {
this.checked = false;
});
}
});
// Use the newly created .check() method
$( "input[type='checkbox']" ).check();
</script>
</body>
</html>
댓글 2개
게시글 목록
| 번호 | 제목 |
|---|---|
| 15854 |
jQuery
deferred.catch( failFilter )
|
| 15853 | |
| 15852 |
jQuery
.dblclick (handler)
|
| 15851 |
jQuery
제이쿼리 .data()
|
| 15849 |
jQuery
.css (propertyName)
|
| 15848 |
jQuery
.contextmenu( handler )
|
| 15847 |
jQuery
.contents()
|
| 15843 | |
| 15842 | |
| 15841 |
jQuery
.closest (selector)
|
| 15840 | |
| 15839 |
jQuery
제이쿼리 .click( handler )
|
| 15838 | |
| 15837 |
jQuery
제이쿼리 jQuery( ".class" )
|
| 15836 |
jQuery
제이쿼리 .children ([selector])
|
| 15835 |
jQuery
제이쿼리 jQuery ( ": checkbox")
|
| 15834 |
jQuery
제이쿼리 .change( handler )
|
| 15833 | |
| 15832 |
jQuery
제이쿼리 callbacks.locked ()
|
| 15831 |
jQuery
제이쿼리 callbacks.lock()
|
| 15830 | |
| 15829 | |
| 15828 |
jQuery
제이쿼리 callbacks.fired()
|
| 15826 | |
| 15825 | |
| 15824 |
jQuery
제이쿼리 callbacks.empty()
|
| 15823 |
PHP
rsa 암호화 클래스
|
| 15822 |
jQuery
제이쿼리 callbacks.disable ()
|
| 15821 | |
| 15820 |
jQuery
제이쿼리 .blur( handler )
|
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기