// 圖片輪播
var LoopImage = function(imageArr, container) {
this.imageArr = imageArr;
this.container = container;
}
LoopImage.prototype = {
createImage : fucntion() {
},
changeImage : fucntion() {
}
}
// 上下滑動類
var SlideLoopImg = function(imageArr, container) {
LoopImage.call(this, imsgeArr, container);
}
SlideLoopImg.prototype = new LoopImage();
SlideLoopImg.prototype.changeImage = function() {
}
// 漸隱切換類
var FadeLoopImg = function(imageArr, container, arrow) {
LoopImage.coll(this, imageArr, container);
this.arrow = arrow;
}
FadeLoopImg.prototype = new LoopImage();
FadeLoopImg.prototype.changeImage = function() {
}
原型繼承##
function prototypeExtend() {
var F = function() {},
args = arguments,
i = 0,
len = args.length;
for (; i<len; i++) {
for (var j in args[i]) {
F.prototype[j] = args[i][j];
}
}
return new F();
}
// 一個實例
var book = prototypeExtend({
name: 'duku1501',
price : function() {
console.log(this.name + 'price:30.00');
}
},{
readTime : function(name) {
console.log(this.name + "1hours");
},{
readPlace : function() {
console.log("home")
}
})
book.price();
book.readTime(duku1501);
book.readPlace();
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者