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>
게시글 목록
| 번호 | 제목 |
|---|---|
| 16019 | |
| 16015 | |
| 16014 |
jQuery
jQuery.holdReady( hold )
|
| 16013 |
jQuery
jQuery.hasData( element )
1
|
| 16011 | |
| 16010 | |
| 16009 |
jQuery
jQuery.globalEval (code)
|
| 16008 | |
| 16004 | |
| 16003 |
jQuery
jQuery.getJSON()
|
| 16002 |
jQuery
jQuery.get()
|
| 16001 |
jQuery
jQuery.fx.off
|
| 15993 |
jQuery
jQuery.fx.interval
|
| 15992 |
jQuery
jQuery.fn.extend ()
2
현재글
|
| 15991 |
jQuery
jQuery.extend()
|
| 15988 |
jQuery
jQuery.escapeSelector ()
|
| 15987 |
jQuery
jQuery.error (message)
|
| 15986 |
jQuery
jQuery.each()
|
| 15985 |
jQuery
jquery 가상 선택자 확장하기.
|
| 15981 |
jQuery
jQuery.dequeue()
|
| 15980 |
jQuery
jQuery.Deferred()
|
| 15979 |
jQuery
jQuery.data()
|
| 15978 |
jQuery
jQuery.cssNumber
|
| 15977 |
jQuery
jQuery.cssHooks
|
| 15976 | |
| 15975 |
jQuery
jQuery.Callbacks ()
|
| 15974 |
jQuery
jQuery.ajaxTransport ()
|
| 15973 |
jQuery
jQuery.ajaxPrefilter()
1
|
| 15971 |
jQuery
jQuery.ajaxPrefilter()
|
| 15970 |
jQuery
jQuery.ajax()
|
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기