/* 더 많이 포함된 경우 jQuery 실행 방지*/
if(typeof window.jQuery == "정의되지 않음") {
/*
* jQuery 1.0.2 - New Wave Javascript
*
* Copyright(c) 2006 John Resig(jquery.com)
* MIT(MIT-LICENSE.txt)
* 및 GPL(GPL-LICENSE.txt)에 따른 이중 라이선스 ) 라이센스.
*
* $Date: 2006-10-09 20:23:18 -0400 (2006년 10월 9일 월요일) $
* $Rev: 413 $
*/
// 전역 정의되지 않은 변수
window.undefine = window.undefine;
jQuery = 함수(a,c) {
// 문서에 대한 바로가기($(document).each()가 바보같기 때문에)
if ( a && 유형의 a =='함수 " && jQuery.fn.ready )
return jQuery(document).ready(a);
//선택 항목이 제공되었는지 확인하세요.
a = a || jQuery.context || 문서;
//jQuery 객체가 선택기로 전달되는 시점을 확인하세요.
if ( a.jquery )
return jQuery( jQuery.merge( a, [] ) );
//jQuery 객체가 컨텍스트에서 전달되는 시점을 확인하세요
if ( c && c.jquery )
return jQuery( c ).find(a);
//컨텍스트가 전역인 경우 새 개체를 반환합니다.
if( window===this )
새 jQuery(a,c)를 반환합니다.
// HTML 문자열 처리
var m = /^[^)[^>]*$/.exec(a);
if ( m ) a = jQuery.clean( [ m[1] ] );
//배열이
에서 전달되는 시점을 확인하세요.
this.get( a.constructor == Array || a.length && !a.nodeType && a[0] != 정의되지 않음 && a[ 0].nodeType ?
// DOM 요소의 배열이라고 가정합니다.
jQuery.merge( a, [] ) :
// 일치하는 요소를 찾아 위도에 저장합니다. 어
jQuery.find( a, c ) );
// 추가 기능이 제공되었는지 확인하세요.
var fn = arguments[ arguments.length - 1 ];
//그렇다면 컨텍스트 내에서 실행하세요.
if ( fn && typeof fn == "function" )
this.each(fn);
};
// 덮어쓰기의 경우 $ 위에 매핑
if ( typeof $ != "undefine" )
jQuery._$ = $;
// jQuery 네임스페이스를 '$' 하나에 매핑합니다.
var $ = jQuery;
jQuery.fn = jQuery.prototype = {
jquery: "1.0.2",
size: function() {
return this.length; },
get: function( num ) {
//배열(요소의)이
에서 전달되는 시점을 확인하세요. if ( num && num.constructor == 배열) {
// 교묘한 해킹 방법을 사용하여 jQuery 개체
// 배열과 같은 모양과 느낌
this.length = 0;
[].push.apply( this, num );
이것을 반환하세요.
} else
반환 번호 == 정의되지 않음 ?
// '깨끗한' 배열 반환
jQuery.merge( this, [] ) :
// 객체
이[숫자];
},
각각: function( fn, args ) {
return jQuery.each( this, fn, args );
},
색인: function( obj ) {
var pos = -1;
this.each(function(i){
if ( this == obj ) pos = i;
});
반품 pos;
},
attr: function( key, value, type ) {
// 스타일 값을 설정하고 있는지 확인하세요.
return key.constructor != String || 값 != 정의되지 않음 ?
this.each(function(){
// 스타일의 해시를 설정하고 있는지 확인하세요
if ( 값 == 정의되지 않음 ) // 모든 스타일을 설정합니다
( var prop in )
jQuery.attr(
유형을 입력하세요. prop, key[prop]
)
// 단일 키/값 스타일 설정
else
jQuery.attr(
유형 ? this.style:
키, 값
)
}) :
// 스타일 값에 액세스하는 경우를 찾으세요
jQuery[ type || "attr" ]( this[0], 키 );
},
css: function( key, value ) {
return this.attr( key, value, "curCSS" );
},
텍스트: 함수(e) {
e = e || 이것;
var t = "";
for ( var j = 0; j var r = e[j].childNodes;
for ( var i = 0; i if ( r[i].nodeType != 8 )
t = r[i].nodeType != 1 ?
r[i].nodeValue : jQuery.fn.text([ r[i] ]);
}
반품 t;
},
wrap: function() {
// 타겟을 둘러싸는 요소
var a = jQuery.clean(arguments);
// 일치하는 각 요소를 개별적으로 래핑
return this.each(function(){
// 래핑에 사용하는 구조를 복제합니다
var b = a[ 0].cloneNode(true);
//래핑할 요소 앞에 삽입하세요.
this.parentNode.insertBefore( b, this ) // 가장 깊은 지점 찾기 래핑 구조
while( b.firstChild )
b = b.firstChild;
// 일치하는 요소를 래핑 구조 내로 이동
b.appendChild( this ); 🎜> }); },
append : function () {
return this.dommanip (arguments, true, 1, function (a) { this.appendChild (a); } );
},
앞에 추가: function() {
return this.domManip(arguments, true, -1, function(a){
this.insertBefore( a, this.firstChild ) ;
});
},
전: function() {
return this.domManip(arguments, false, 1, function(a){
this.parentNode.insertBefore( a, this );
});
},
이후: function() {
return this.domManip(arguments, false, -1, function(a){
this.parentNode.insertBefore( a, this. nextSibling )
});
},
end: function() {
return this.get( this.stack.pop() );
},
find: function(t) {
return this.pushStack( jQuery.map( this, function(a){
return jQuery.find(t,a);
}), 인수 );
},
clone: function(deep) {
return this.pushStack( jQuery.map( this, function(a){
return a.cloneNode( deep != undefine ? deep : true );
}), 인수 );
},
필터: function(t) {
return this.pushStack(
t.constructor == 배열 &&
jQuery.map(this,function(a){ 에 대한 (var i = 0; i if ( jQuery.filter(t[i],[a]).r.length )
return a; }) | |
t.constructor == 부울 &&
( t ? this.get() : [] ) ||
t 유형 == "함수" &&
jQuery. grep( this, t ) ||
jQuery.filter(t,this).r, 인수 );
},
not: function(t) {
return this.pushStack( t.constructor == String ?
jQuery.filter(t,this,false).r :
jQuery.grep(this,function(a){ return a != t; }), 인수 );
},
추가: function(t) {
return this.pushStack( jQuery.merge( this, t.constructor == String ?
jQuery.find(t) : t .constructor == 배열 ? t : [t] ), 인수 );
},
is: function(expr) {
return expr ? jQuery.filter(expr,this).r.length > 0: 거짓;
},
domManip: function(args, table, dir, fn){
var clone = this.size() > 1;
var a = jQuery.clean(args);
return this.each(function(){
var obj = this;
if ( table && this.nodeName.toUpperCase() == "TABLE" && a[0] .nodeName.toUpperCase() != "THEAD" ) {
var tbody = this.getElementsByTagName("tbody");
if ( !tbody.length ) {
obj = document.createElement ("tbody");
this.appendChild( obj );
} else
obj =
}
for ( var i =( dir i != ( dir fn.apply( obj, [ clone ? a[i].cloneNode(true) : a[i] ] );
}
});
},
pushStack: function(a,args) {
var fn = args && args[args.length-1];
var fn2 = args && args[args.length-2];
if ( fn && fn.constructor != 함수 ) fn = null;
if ( fn2 && fn2.constructor != 함수 ) fn2 = null;
if ( !fn ) {
if ( !this.stack ) this.stack = [];
this.stack.push( this.get() );
this.get( a );
} else {
var old = this.get();
this.get( a );
if ( fn2 && a.length || !fn2 )
this.each( fn2 || fn ).get( old );
else
this.get( old ).each( fn );
}
이것을 반환하세요.
}
};
jQuery.extend = jQuery.fn.extend = function(obj,prop) {
if ( !prop ) { prop = obj; obj==이것; }
for ( var i in prop ) obj[i] = prop[i];
obj를 반환합니다.
};
jQuery.extend({
init: function(){
jQuery.initDone = true;
jQuery.each( jQuery.macros.axis, function(i,n ){
jQuery.fn[ i ] = function(a) {
var ret = jQuery.map(this,n);
if ( a && a.constructor == String )
ret = jQuery.filter(a,ret).r
return this.pushStack( ret, arguments ) };);
jQuery.each( jQuery.macros.to, function(i,n){
jQuery.fn[ i ] = function(){
var a
이것을 반환하세요 .each(function(){
for ( var j = 0; j
});
});
jQuery.each( jQuery.macros.each, function(i,n){
jQuery.fn[ i ] = function() {
return this.each( n, 인수 );
};
});
jQuery.each( jQuery.macros.filter, function(i,n){
jQuery.fn[ n ] = function(num,fn) {
return this.filter( ": " n "(" num ")", fn );
};
});
jQuery.each( jQuery.macros.attr, function(i,n){
n = n || i;
jQuery.fn[ i ] = function(h) {
return h == 정의되지 않음 ?
this.length ? this[0][n] : null :
this.attr( n, h ); });
});
jQuery.each( jQuery.macros.css, function(i,n){
jQuery.fn[ n ] = function(h) {
반환 h == 정의되지 않음 ?
( this.length ? jQuery.css( this[0], n ) : null ) :
this.css( n, h )
});
},
각각: 함수( obj, fn, args ) {
if ( obj.length == 정의되지 않음 )
for( var i in obj ) fn.apply( obj[i], args || [i, obj[i]] );
else
for ( var i = 0; i
obj 반환;
},
className: {
추가: function(o,c){
if (jQuery.className.has(o,c)) return;
o.className = ( o.className ? " " : "" ) c;
},
제거: function(o,c){
if( !c ) {
o.className = "";
} else {
var classes = o.className.split(" ");
for(var i=0; i
classes.splice (i, 1);
휴식;
}
}
o.className = classes.join(' ');
}
},
함수(e,a) {
if ( e.className != 정의되지 않음 e = e. 클래스명;
new RegExp("(^|\s)" a "(\s|$)").test(e);
}
},
swap: function(e,o,f) {
for ( var i in o ) {
e.style["old" i] = e.style [나];
e.style[i] = o[i];
}
f.apply( e, [] );
for ( var i in o )
e.style[i] = e.style["old" i];
},
css: function(e,p) {
if ( p == "높이"|| p == "너비" ) {
var old = {}, o높이, o너비, d = ["상단","하단","오른쪽","왼쪽"];
for ( var i in d ) {
old["padding" d[i]] = 0;
old["테두리" d[i] "너비"] = 0;
}
jQuery.swap( e, old, function() {
if (jQuery.css(e,"display") != "none") { o높이 = e .offsetHeight;
oWidth = e.offsetWidth;
} else {
e = jQuery(e.cloneNode(true)).cs s({
가시성: "숨김", 위치: "절대" , 표시: "차단", 오른쪽: "0", 왼쪽: "0"
}).appendTo(e.parentNode)[0];
var parPos = jQuery.css(e.parentNode ,"위치");
if ( parPos == "" || parPos == "정적")
e.parentNode.style.position =
o높이 = e.
oWidth = e.clientWidth;
if ( parPos == "" || parPos == "정적")
e.parentNode.style.position = "정적"
e.parentNode.removeChild(e)
}
});
return p == "높이" ? o높이: o너비;
}
return jQuery.curCSS( e, p );
},
curCSS: function(elem, prop, force) {
var ret;
if (prop == 'opacity' && jQuery.browser.msie)
return jQuery.attr(elem.style, 'opacity');
if (!force && elem.style[prop]) {
ret = elem.style[prop];
} else if (elem.currentStyle) {
var newProp = prop.replace(/-(w)/g,function(m,c){return c.toUpperCase(); });
ret = elem.currentStyle[prop] || elem.currentStyle[newProp];
} else if (document.defaultView && document.defaultView.getCompulatedStyle) {
prop = prop.replace(/([A-Z])/g,"-$1").toLowerCase( );
var cur = document.defaultView.getCompulatedStyle(elem, null);
if ( cur )
ret = cur.getPropertyValue(prop);
else if ( prop == '표시' )
ret = '없음';
else
jQuery.swap(elem, { display: 'block' }, function() {
ret = document.defaultView.getCompulatedStyle(this,null).getPropertyValue( 소품)
} );
}
반품 ret;
},
clean: function(a) {
var r = [];
for ( var i = 0; i if ( a[i].constructor == String ) {
// 공백 제거 그렇지 않으면 indexOf 원함' 일하지 않아 예상대로
a[i] = jQuery.trim(a[i]);
var table = "";
if ( !a[i].indexOf(" table = "thead";
a[i] = "" a[i] "";
} else if ( !a[i].indexOf("
a[i] = "" a[i] "";
} else if ( !a[i].indexOf("
a[i] = "
}
var div = document.createElement("div");
div.innerHTML = a[i];
if ( 테이블 ) {
div = div.firstChild;
if ( table != "thead" ) div = div.firstChild;
if ( table == "td" ) div = div.firstChild; [ j] );
} else if ( a[i].jquery || a[i].length && !a[i].nodeType )
for( var k = 0; k r.push( a[i][k] );
else if ( a[i] !== null )
r.push( a[i].nodeType ? a[i] : document.createTextNode(a[i].toString()) );
}
return r;
},
expr: {
"": "m[2]== '*'||a.nodeName.toUpperCase()==m[2].toUpperCase()",
"#": "a.getAttribute('id')&&a.getAttribute('id')==m[2]",
": {
// 위치 확인
lt: " i
n번째: "m[3]-0==i",
eq: "m [3]-0==i",
첫 번째: "i==0",
마지막: "i==r.length-1",
짝수: "i%2==0 ",
odd: "i%2",
// 하위 확인
"n번째-자식": "jQuery.sibling(a,m[3]).cur",
"첫 번째 자식": "jQuery.sibling(a,0).cur",
"마지막 자식": "jQuery.sibling(a,0).last",
"외동 자식" : "jQuery.sibling(a).length==1",
// 상위 확인
부모: "a.childNodes.length",
비어 있음: "!a.childNodes.length ",
//텍스트 확인
다음 포함: "(a.innerText||a.innerHTML).indexOf(m[3])>=0",
// 가시성
visible: "a.type!='hidden'&&jQuery.css(a,'display')!='none'&&jQuery.css(a,'visibility')!='hidden'",
숨겨진: "a.type=='hidden'||jQuery.css(a,'display')=='none'||jQuery.css(a,'visibility')=='hidden'",
// 양식 속성
활성화됨: "!a.disabled",
비활성화됨: "a.disabled",
선택됨: "a.checked",
선택됨: "a.선택됨 || jQuery.attr(a, '선택됨')",
// 양식 요소
텍스트: "a.type=='text'",
라디오: "a.type==' radio'",
체크박스: "a.type=='checkbox'",
파일: "a.type=='file'",
비밀번호: "a.type=='password' ",
제출: "a.type=='submit'",
이미지: "a.type=='image'",
재설정: "a.type=='reset'",
버튼: "a.type=='button'",
입력: "a.nodeName.toLowerCase().match(/input|select|textarea|button/)"
},
".": "jQuery.className.has(a,m[2])",
"@": {
"=": "z==m[4]",
"!=": "z!=m[4]",
"^=": "z && !z.indexOf(m[4])",
"$=": "z && z.substr(z.length - m[4].length,m[4].length)==m[4]",
"*=": "z && z.indexOf(m[4] )>=0",
"": "z"
},
"[": "jQuery.find(m[2],a).length"
},
토큰: [
"\.\.|/\.\.", "a.parentNode",
">|/", "jQuery.sibling(a.firstChild)",
"\ ", "jQuery.sibling(a).next",
"~", function(a){
var r = [];
var s = jQuery.sibling(a);
if ( s.n > 0 )
for( var i = s.n; i r.push( s[i] ) ;
r을 반환합니다.
}
],
찾기: function( t, context ) {
// 컨텍스트가 DOM 요소인지 확인하세요.
if ( context && context.nodeType == 정의되지 않음 )
컨텍스트 = null;
// 올바른 컨텍스트 설정(아무것도 제공되지 않은 경우)
컨텍스트 = 컨텍스트 || jQuery.context || 문서;
if ( t.constructor != String ) return [t];
if ( !t.indexOf("//") ) {
context = context.documentElement;
t = t.substr(2,t.length);
} else if ( !t.indexOf("/") ) {
context = context.documentElement;
t = t.substr(1,t.length);
// FIX 루트 요소가 옳다고 가정하세요. t.길이)
}
var ret = [컨텍스트];
var 완료 = [];
var last = null;
while ( t.length > 0 && last != t ) {
var r = [];
마지막 = t;
t = jQuery.trim(t).replace( /^///i, "" );
var foundToken = false;
for ( var i = 0; i
var re = new RegExp("^(" jQuery.token[i] ")");
var m = re.exec(t);
if ( m ) {
r = ret = jQuery.map( ret, jQuery.token[i 1] );
t = jQuery.trim( t.replace( re, "" ) );
foundToken = true;
}
}
if ( !foundToken ) {
if ( !t.indexOf(",") || !t.indexOf ("|") ) {
if ( ret[0] == 컨텍스트 ) ret.shift();
완료 = jQuery.merge( done, ret );
r = ret = [컨텍스트];
t = " " t.substr(1,t.length);
} else {
var re2 = /^([#.]?)([a-z0-9\*_-]*)/i;
var m = re2.exec(t);
if ( m[1] == "#" ) {
// 음, 이 기능이 모든 문서에서 작동하도록 해야 합니다. var oid = document.getElementById(m[2]);
r = ret = oid ? [oid] : [];
t = t.replace( re2, "" );
} else {
if ( !m[2] || m[1] == "." ) m[2] = "*";
for ( var i = 0; i r = jQuery.merge( r, m[2] == "*" ? .getAll(ret[i]) :
ret[i].getElementsByTagName(m[2])
);
}
}
}
if ( var val = jQuery.filter(t,r);
ret = r = val.r;
t = jQuery.trim(val.t);
}
}
if ( ret && ret[0] == context ) ret.shift();
완료 = jQuery.merge( done, ret );
반품 완료;
},
getAll: function(o,r) {
r = r || [];
var s = o.childNodes;
for ( var i = 0; i if ( s[i].nodeType == 1 ) {
r.push( s[i] );
jQuery.getAll( s[i], r );
}
return r;
},
attr: function(elem, name, value){
var fix = {
"for": "htmlFor",
"class": "className" ,
"float": "cssFloat",
innerHTML: "innerHTML",
className: "className",

实现方法:1、用“$("img").delay(毫秒数).fadeOut()”语句,delay()设置延迟秒数;2、用“setTimeout(function(){ $("img").hide(); },毫秒值);”语句,通过定时器来延迟。

区别:1、axios是一个异步请求框架,用于封装底层的XMLHttpRequest,而jquery是一个JavaScript库,只是顺便封装了dom操作;2、axios是基于承诺对象的,可以用承诺对象中的方法,而jquery不基于承诺对象。

修改方法:1、用css()设置新样式,语法“$(元素).css("min-height","新值")”;2、用attr(),通过设置style属性来添加新样式,语法“$(元素).attr("style","min-height:新值")”。

增加元素的方法:1、用append(),语法“$("body").append(新元素)”,可向body内部的末尾处增加元素;2、用prepend(),语法“$("body").prepend(新元素)”,可向body内部的开始处增加元素。

删除方法:1、用empty(),语法“$("div").empty();”,可删除所有子节点和内容;2、用children()和remove(),语法“$("div").children().remove();”,只删除子元素,不删除内容。

在jquery中,apply()方法用于改变this指向,使用另一个对象替换当前对象,是应用某一对象的一个方法,语法为“apply(thisobj,[argarray])”;参数argarray表示的是以数组的形式进行传递。

on()方法有4个参数:1、第一个参数不可省略,规定要从被选元素添加的一个或多个事件或命名空间;2、第二个参数可省略,规定元素的事件处理程序;3、第三个参数可省略,规定传递到函数的额外数据;4、第四个参数可省略,规定当事件发生时运行的函数。

去掉方法:1、用“$(selector).removeAttr("readonly")”语句删除readonly属性;2、用“$(selector).attr("readonly",false)”将readonly属性的值设置为false。


핫 AI 도구

Undresser.AI Undress
사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover
사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool
무료로 이미지를 벗다

Clothoff.io
AI 옷 제거제

AI Hentai Generator
AI Hentai를 무료로 생성하십시오.

인기 기사

뜨거운 도구

안전한 시험 브라우저
안전한 시험 브라우저는 온라인 시험을 안전하게 치르기 위한 보안 브라우저 환경입니다. 이 소프트웨어는 모든 컴퓨터를 안전한 워크스테이션으로 바꿔줍니다. 이는 모든 유틸리티에 대한 액세스를 제어하고 학생들이 승인되지 않은 리소스를 사용하는 것을 방지합니다.

SublimeText3 Linux 새 버전
SublimeText3 Linux 최신 버전

SublimeText3 중국어 버전
중국어 버전, 사용하기 매우 쉽습니다.

메모장++7.3.1
사용하기 쉬운 무료 코드 편집기

SublimeText3 Mac 버전
신 수준의 코드 편집 소프트웨어(SublimeText3)
