cocos2d-x JS 复选按钮checkBox的单选与多选
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的单选与多选的更多相关文章
- js实现表单checkbox的单选,全选
全选&单选 //<input type="checkbox" name="" class="quan" value=" ...
- [原创]纯JS实现网页中多选复选框checkbox和单选radio的美化效果
图片素材: 最终效果图: <html><title> 纯JS实现网页中多选复选框checkbox和单选radio的美化效果</title><head>& ...
- 复选框(checkbox)、单选框(radiobox)的使用
复选框(checkbox).单选框(radiobox)的使用 复选框: HTML: // 复选框 <input type="checkbox" name="chec ...
- JQuery 多选按钮checkbox
JQuery 多选按钮checkbox 在需要全选和选择部分的时候我们就需要多选在这里主要介绍了具体的实现 JQuery $(function () { //全选或全不选 $("#allbo ...
- 多选按钮CheckBox
main.xml: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmln ...
- jquery实现checkbox的单选和全选
一.思路 全选:判断“全选”checkbox的状态,如果选中则把tbody下所有的checkbox选中,反之 单选:主要是判断有没有全选,如果不是选中状态就把全选的checkbox状态设置为false ...
- js控制复选框checkbox 只能单选
我们在页面经常会用到单选框,来提供单值选在字段,但是有一个问题就是:一旦选择了就不能去除(即--只要选择了就不能再以空值提交了). 所以为了解决这个问题,用复选框限制单选是一个不错的选择 <sc ...
- 转发!HTML 复选框 checkbox 的 JavaScript 的全选和全反选
checkbox 或者按钮实现 form 内的 checkbox 全选或者反选,代码很简单,全部代码如下: <html> <head> <meta http-equiv= ...
- html 复选框(checkbox)和单选框(radio)与文字水平垂直居中对齐
对 input与label同时设置CSS input,label{ vertical-align:middle; }
随机推荐
- CSS中隐藏内容的3种方法
CSS中隐藏内容的3种方法 一般有:隐藏文本/图片.隐藏链接.隐藏超出范围的内容.隐藏弹出层.隐藏滚动条.清除错位和浮动等. 1.使用display:none来隐藏所有内容 display:none可 ...
- 【魔改】莫队算法+组合数公式 杭电多校赛4 Problem B. Harvest of Apples
http://acm.hdu.edu.cn/showproblem.php?pid=6333 莫队算法是一个离线区间分块瞎搞算法,只要满足:1.离线 2.可以O(1)从区间(L,R)更新到(L±1, ...
- NodeJS websocket qr based on location
https://juejin.im/post/5a5728436fb9a01c982c7d93 http://www.cnblogs.com/panhe-xue/p/5902108.html---br ...
- hadoop 学习笔记
参考资料:<Hadoop 权威指南> 1 map处理完后,hadoop框架会将结果安装键进行排序,然后将排好的结果传给reduce 2 需要低延迟的应用不适合HDFS,对于低延迟应用HBa ...
- 洛谷P4358密钥破解 [CQOI2016] 数论
正解:数论 解题报告: 先,放个传送门QwQ 这题难点可能在理解题意,,, 所以我先放个题意QAQ 大概就是说,给定一个整数N,可以被拆成两个质数的成绩p*q,然后给出了一个数e,求d满足e*d=1( ...
- 关于话题模型(topic model)的一些思考
最近在分析知乎的‘问题’文本所属的话题,用python提取,实现了LSTM和LDA模型在这个方面的应用,但是效果不是很理想,一个是这些文本属于短文本,另外用来分析的文本本身包含多个领域的问题,并且数量 ...
- Why does the memory usage increase when I redeploy a web application?
That is because your web application has a memory leak. A common issue are "PermGen" memor ...
- lsof 命令
[root@localhost ~]# lsof COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME init root cwd DIR , / in ...
- left join 太神奇了
概念: 把left join左边的表的记录全部找出来.系统会先用表A和表B做个笛卡儿积,然后以表A为基表,去掉笛卡儿积中表A部分为NULL的记录.最后形成你的结果. 进行左连接时,就有涉及到主表.辅表 ...
- finecms如何控制调用子栏目的数量
finecms如何控制调用子栏目的数量?比如只要调用栏目id为23下的3个子栏目要怎么写?我们把num=3放后面不能实现,放在return前面就可以了,原来是顺序的问题,return只能放最后 {li ...