菜单 学习猿地 - LMONKEY

VIP

开通学习猿地VIP

尊享10项VIP特权 持续新增

知识通关挑战

打卡带练!告别无效练习

接私单赚外块

VIP优先接,累计金额超百万

学习猿地私房课免费学

大厂实战课仅对VIP开放

你的一对一导师

每月可免费咨询大牛30次

领取更多软件工程师实用特权

入驻
470
0

js面向对象插件的做法框架new goBuy('.cakeItem',{ add:'.add', reduce:'.reduce' },[1,0.7,0.6]);

原创
05/13 14:22
阅读数 52660

 


/*弹窗购买蛋糕*/
;(function(){

var $DialogBg=$(".Dialogbg-Select");
var $Dialog=$(".Dialog-Select");
var $close=$(".s-closes");

function goBuy(els,opts,disArr,dis) {
this.$els = $(els);
this.$add = this.$els.find(opts.add);
this.$reduce = this.$els.find(opts.reduce);
this.num=1;
this.max=50;
this.oldPrice =0;
this.totalPrice =0;
this.newPrice =0;
this.disArr = disArr;
this.dis = dis;
this._init();
}

goBuy.prototype = {
strArr:[],
add:function (ele) {

},
reduce:function (ele) {

},
/*价格计算*/
counts:function (ele) {

},
initialize:function (ele) {
/*初始化数据*/
var self = this;

},

showDialog:function () {
$DialogBg.fadeIn();
$Dialog.fadeIn()

发表评论

0/200
470 点赞
0 评论
收藏