Home > Web Front-end > JS Tutorial > body text

jQuery学习笔记之jQuery原型属性和方法_jquery

WBOY
Release: 2016-05-16 16:45:24
Original
1221 people have browsed it

复制代码 代码如下:

jQuery.fn = jQuery.prototype = {
     constructor: jQuery,
     init: function( selector, context, rootjQuery ) { },
    selector: "",       
    jquery: "1.7.2",       
    length: 0,       
    size: function() {},
    toArray: function() {},       
    get: function( num ) {},      
    pushStack: function( elems, name, selector ) {},      
    each: function( callback, args ) {},
    ready: function( fn ) { },
    eq: function( i ) {},
    first: function() {},
    last: function() { },
    slice: function() {},
    map: function( callback ) { },
    end: function() { },      
    push: push,
    sort: [].sort,
    splice: [].splice
        };

以上就是该版本的jQuery的原型上的部分属性和方法.
selector:用于记录init参数的selector.但不一定是相等的.
$("div").selector;//"div"
$("div").find(p).selecctor;//"div p";
这个属性一般用于调试.
jquery:jQuery的版本号.
length:元素的个数.
size():等效于length,length的内存开销更小.
剩下的成员在后面的章节中介绍.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!