var HZ_createRoom = jx.BaseView.extend({//红中麻将
ctor : function() {
this._super(); this.addLayout(res.HZ_createRoom_json, true); this.addClickListenerByName("imgX_0", this.hide.bind(this));//关闭按钮
this.addClickListenerByName("btn_OK", this.onBtnOK.bind(this));//确认按钮
//this.enableBtnTitleStroke(this.getComponentByName("btn_OK"));//确认文本颜色 this.addClickListenerByName("HZ_btn", this.HZ_btn.bind(this));//红中麻将
this.addClickListenerByName("JX_btn", this.JX_btn.bind(this));//江西麻将 this.HZ_blue = this.getComponentByName("HZ_blue");
this.HZ_yellow = this.getComponentByName("HZ_yellow");
this.JX_blue = this.getComponentByName("JX_blue");
this.JX_yellow = this.getComponentByName("JX_yellow"); //this.roundNum=1;
this.topType=1; //this.roundNum1 = this.getComponentByName("roundNum1");//房卡 this.topType1 = this.getComponentByName("topType1");
this.topType2 = this.getComponentByName("topType2"); this.addClickListenerByName("topTypeSet1", this.topTypeSet.bind(this,1));
this.addClickListenerByName("topTypeSet2", this.topTypeSet.bind(this,2)); this.refreshAll();
},
topTypeSet : function(value) {
this.topType=value;
this.refreshAll();
},
refreshAll : function() {
/*
this.roundNum1.setSelected(this.roundNum==1);
this.roundNum2.setSelected(this.roundNum==2); console.log( this.roundNum1); this.cardMod1.setSelected(this.cardMod==1); this.cancelWind1.setSelected(this.cancelWind);
this.catchKong1.setSelected(this.catchKong); this.ghostType2.setSelected(this.ghostType==2);
this.ghostType3.setSelected(this.ghostType==3); this.horseType1.setSelected(this.horseType==1);
this.horseType2.setSelected(this.horseType==2);
this.horseType3.setSelected(this.horseType==3);
this.horseType4.setSelected(this.horseType==4);
this.horseType5.setSelected(this.horseType==5);
*/
this.topType1.setSelected(this.topType==1);
this.topType2.setSelected(this.topType==2);
},
HZ_btn:function()
{ this.JX_blue.setVisible(true);
this.HZ_yellow.setVisible(true);
jx.utils.playEffect(sound.button_mp3);
if(this.jx_createRoom)
{
this.jx_createRoom.hide();
}
},
JX_btn:function()
{
this.HZ_yellow.setVisible(false);
this.JX_blue.setVisible(false);
jx.utils.playEffect(sound.button_mp3); this.jx_createRoom = new JX_createRoom();
//jx_createRoom.show();
this.addChild(this.jx_createRoom); },
onBtnOK: function()
{ var cb = this.cb;
this.hide(); // var result=""+this.roundNum+","+this.cardMod;
// if (this.seaMoon){
// result=result+",1";
// }else{
// result=result+",0";
// }
// if (this.cancelWind){
// result=result+",1";
// }else{
// result=result+",0";
// }
// if (this.catchKong){
// result=result+",1";
// }else{
// result=result+",0";
// }
// result=result+","+this.ghostType+","+this.horseType+","+this.topType;
// //console.log(result)
cb(true, result);
}, setCallback : function(cb)
{
this.cb = cb;
} });
HZ_createRoom.show = function(cb)
{
var dlg = new HZ_createRoom();
dlg.setCallback(cb);
dlg.show();
};

cocos2d-x JS 复选按钮checkBox的单选与多选的更多相关文章

  1. js实现表单checkbox的单选,全选

    全选&单选 //<input type="checkbox" name="" class="quan" value=" ...

  2. [原创]纯JS实现网页中多选复选框checkbox和单选radio的美化效果

    图片素材: 最终效果图: <html><title> 纯JS实现网页中多选复选框checkbox和单选radio的美化效果</title><head>& ...

  3. 复选框(checkbox)、单选框(radiobox)的使用

    复选框(checkbox).单选框(radiobox)的使用 复选框: HTML: // 复选框 <input type="checkbox" name="chec ...

  4. JQuery 多选按钮checkbox

    JQuery 多选按钮checkbox 在需要全选和选择部分的时候我们就需要多选在这里主要介绍了具体的实现 JQuery $(function () { //全选或全不选 $("#allbo ...

  5. 多选按钮CheckBox

    main.xml: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmln ...

  6. jquery实现checkbox的单选和全选

    一.思路 全选:判断“全选”checkbox的状态,如果选中则把tbody下所有的checkbox选中,反之 单选:主要是判断有没有全选,如果不是选中状态就把全选的checkbox状态设置为false ...

  7. js控制复选框checkbox 只能单选

    我们在页面经常会用到单选框,来提供单值选在字段,但是有一个问题就是:一旦选择了就不能去除(即--只要选择了就不能再以空值提交了). 所以为了解决这个问题,用复选框限制单选是一个不错的选择 <sc ...

  8. 转发!HTML 复选框 checkbox 的 JavaScript 的全选和全反选

    checkbox 或者按钮实现 form 内的 checkbox 全选或者反选,代码很简单,全部代码如下: <html> <head> <meta http-equiv= ...

  9. html 复选框(checkbox)和单选框(radio)与文字水平垂直居中对齐

    对 input与label同时设置CSS input,label{ vertical-align:middle; }

随机推荐

  1. 错误:22 http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu bionic Release 404 Not Found [IP: 91.189.95.83 80]

    https://blog.csdn.net/chenbetter1996/article/details/80255552 到仓库地址找到哦该文件 删除两个文件就可以了

  2. *** FATAL ERROR L250: CODE SIZE LIMIT IN RESTRICTED VERSION EXCEEDED

    *** FATAL ERROR L250: CODE SIZE LIMIT IN RESTRICTED VERSION EXCEEDED 在软件已经执行破解仍然出现,是因为工程是破解前建立的,要先执行 ...

  3. Vue 超快速学习

    Vue 超快速学习 基础知识: 1.vue的生命周期: beforeCreate/created. beforeMount/mounted. beforeUpdate/updated. beforeD ...

  4. python数据结构之图论

    本篇学习笔记内容为图的各项性质.图的表示方法.图ADT的python实现 图(Graph) 是数据结构和算法学中最强大的框架之一(或许没有之一).图几乎可以用来表现所有类型的结构或系统,从交通网络到通 ...

  5. linux 音频编程

    http://blog.csdn.net/sea918/article/details/7249216   1.音频开发模型: OSS(open sound system)  linux/unix 平 ...

  6. expect远程登录服务器并执行命令

    #!/usr/bin/expectset timeout 120            #设置执行超时时间,任何输入120秒后退出set password "password"  ...

  7. 如果是多个 c 代码的源码文件,编译方法如下: $ gcc test1.c test2.c -o main.out $ ./main.out test1.c 与 test2.c 是两个源代码文件。

    如果是多个 c 代码的源码文件,编译方法如下: $ gcc test1.c test2.c -o main.out $ ./main.out test1.c 与 test2.c 是两个源代码文件.

  8. hyperledger-fabric/qemu/kvm/virtual-manager -------vagrant-virtual-box

    天我也遇到了这个问题,原因是你的 vagrant 版本跟你的 virtualbox 版本不匹配,解决的方法是,更换 virtualbox 的版本.我的 vagrant 版本是 1.8.4 ,virtu ...

  9. SQLAlchemy中时间格式化及将时间戳转成对应时间的方法-mysql

    https://blog.csdn.net/guoqianqian5812/article/details/80175866 方法很简答,都是借助于mysql数据库提供的函数将时间格式化方法 func ...

  10. python之类中如何判断是函数还是方法

    通常我们认为在类中的函数为方法,类外面声明def为函数,这种说法有点片面 方法1: class Work(object): def show(self): print("执行show方法&q ...