设为首页收藏本站
 找回密码
 注册

用新浪微博连接

一步搞定

QQ登录

只需一步,快速开始

搜索
查看: 123|回复: 0

tabs 组件的源码问题 [复制链接]

Rank: 1

发表于 2012-2-2 12:59:36 |显示全部楼层
tabs组件源码片段:

_tabify: function( init ) {
                var self = this,
                        o = this.options,
                        fragmentId = /^#.+/; // Safari 2 reports '#' for an empty hash

                this.list = this.element.find( "ol,ul" ).eq( 0 );
                this.lis = $( " > li:has(a[href])", this.list );
                this.anchors = this.lis.map(function() {
                        return $( "a", this )[ 0 ];
                });
                this.panels = $( [] );

疑惑在 panels初始化为什么要用  $([]);而不直接使用 []呢

var a= $([]); 返回的对象的确也是一个空数组,即 length为0,
但是 a里边还包含了  $ 所有的 属性, 为什么要这么搞呢!那些属性没有用的啊
您需要登录后才可以回帖 登录 | 注册

Archiver|jQuery爱好者   

GMT+8, 2012-5-23 09:03

Powered by jQfans!

© 2010-2011 jQfans Inc.

回顶部