Cocosd2d-js 实现模态对话框
使用模态对话框主要是吞噬点击事件,让点击不会透传导底部,新建窗口都继承自模态对话框,也可以创建子类便于实现打开和关闭的动画效果
/*** Created by shake on 16/4/7.*/
"use strict";var ModalDialogLayer = cc.Layer.extend({m_touchListener:null,ctor:function(){this._super();var touchListener = {event: cc.EventListener.TOUCH_ONE_BY_ONE,swallowTouches: true,onTouchBegan: this.onTouchBegan};cc.eventManager.addListener(touchListener, this);this.m_touchListener = touchListener;},isTouchInside: function (owner, touch) {if(!owner || !owner.getParent()){return false;}var touchLocation = touch.getLocation();touchLocation = owner.getParent().convertToNodeSpace(touchLocation);return cc.rectContainsPoint(owner.getBoundingBox(), touchLocation);},onTouchBegan: function (touch, event) {var target = event.getCurrentTarget();// if(!target.isVisible() || (!this.isTouchInside(target,touch))){if(!target.isVisible() ){return false;}return true;},
});module.exports = ModalDialogLayer;
Cocosd2d-js 实现模态对话框相关推荐
- antd vue关闭模态对话框_如何在Bootstrap项目中用Vue.js替代jQuery
Bootstrap是 Web 开发最受欢迎的框架之一,没有比它开发响应式网站项目效率最高了. 随着Vue.js的逐渐流行,更多人们用它来控制页面元素,实现强大互动功能.而jQuery出现了一些技术落后 ...
- 原生js——四种对话框
js一共提供了四种对话弹框,即alert().confirm().prompt().showModalDialog().具体使用方法如下: 1.alert() alert()向用户显示一条消息并等待用 ...
- 使用javascript打开模态对话框
1. 标准的方法 <script type="text/javascript"> function openWin(src, width, height, show ...
- 手机网页里的模态对话框
今日帮朋友写了一个手机网页里用的模态对话框,防止自己日后忘记,所以mark一下.原理很简单,当弹出了模态对话框的时候,就是touchmove事件进行监听,如果是对话框的touchmove事件,就允许拖 ...
- showModalDialog模态对话框 的使用及一般问题的解决
showModalDialog模态对话框 的使用及一般问题的解决 1,使用 showModalDialog(sURL [, oArguments] [,sFeatures]) 参数 : sURL : ...
- jQuery查找标签--选择器,筛选器,模态对话框, 左侧菜单栏
查找标签 选择器: 基本选择器(同css) id选择器 $("#id")标签选择器 $('tagName')class选择器 $(".className")配合 ...
- Bootstrap3 静态模态对话框
模态对话框 JavaScript内置了 3 种对话框:alert().prompt().confirm().alert() 只是一个简单的提示对话框,prompt() 可以接受用户输入的信息,conf ...
- Bootstrap 模态对话框
模态对话框 JavaScript内置了 3 种对话框:alert().prompt().confirm().alert() 只是一个简单的提示对话框,prompt() 可以接受用户输入的信息,conf ...
- showModalDialog模态对话框的使用以及浏览器兼容
ModalDialog 是什么? showModalDialog 是js window对象的一个方法, 和window.open一样都是打开一个新的页面. 区别是: showModalDialog打开 ...
- js“弹出对话框”和“弹出窗口”详解
JS中showModalDialog 详细使用 基本介绍: showModalDialog() (IE 4+ 支持) showModelessD ...
最新文章
- matlab length_《Matlab - Robotics System Toolbox》学习笔记(2)
- PHP文件上传主要代码讲解
- UVa 11059 - Maximum Product
- [转载]2000/XP下删除隐藏旧网卡方法
- python发展前景怎么样-python发展前景怎么样
- C# 如何生成一个时间戳
- AlphaGo:人工智能与深度学习
- 剑指Offer - 面试题57 - II. 和为s的连续正数序列(滑动窗口)
- CodeForces 1065E. Side Transmutations 计数
- SAS之COMPBL、DEQUOTE函数
- BSCI—7:OSPF的路由汇总
- JavaScript 学习计划
- python class是什么_python中什么是类
- XML文件的操作--上
- git 设置单个文件上传大小
- Blender图解教程:用权重传递(Transfer Weights)快速给动画角色穿衣服
- 查询服务器外网IP和根据域名查询外网IP
- python手机触屏代码_使用python实现触摸?
- python 股票交易接口 github_GitHub - gusihao/vnpy: 基于python的开源交易平台开发框架...
- SQL——行转列,列转行