forked from huanhuan1989/javascript-jQuery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
extend
43 lines (35 loc) · 926 Bytes
/
extend
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
function silder(infor){
//第1种调用方法
var defaults = {
imgBox : function(){return new Getimg();}
}
var option = $.extend(defaults, infor);
function Getimg(){
this.imgList = $('.box');
}
option.imgBox().imgList;
//第2种调用方法
var op = $.extend({
picBox:new GetImg()
},infor);
function GetImg(){
this.cir = $('.box');
}
op.picBox.cir;
//调用方法
function GetSize(){
this.w = $('.'+option.picBox,_thisAll).width();
this.h = $('.'+option.picBox,_thisAll).height();
return this;
}
var s = GetSize;
s.w
//调用方法
function getSiz(){
var w = $('.'+option.picBox,_thisAll).width();
var h = $('.'+option.picBox,_thisAll).height();
return { w: w, h: h}
}
var size = getSiz();
size.w
}