Dev
搜索

Dev

target.removeTouchEventListenser is not a function
发表于2016-01-06|cocos2d-js
正确写法 target.removeTouchEventListenser;
cc.director.replaceScene is not a function
发表于2016-01-05|cocos2d-js
coocs2d-js 3.x 之后场景切换用的是 cc.director.runScene
cocos2d-js 创建新工程
发表于2016-01-05|cocos2d-js
// 创建一个包含 Cocos2d-x JSB 和 Cocos2d-html5 工程: cocos new -l js // 创建一个仅包含 Cocos2d-html5 的工程: cocos new -l js --no-native // 在指定的目录创建一个指定名字的工程: cocos new projectName -l js -d ./Projects 正常使用: cocos new projectName -l js --no-native -d ./Projects  
js中的this关键字详解
发表于2016-01-04|js
this是Javascript语言的一个关键字。它代表函数运行时,自动生成的一个内部对象,只能在函数内部使用 随着函数使用场合的不同,this的值会发生变化。但是有一个总的原则,那就是this指的是,调用函数的那个对象。 情况一:纯粹的函数调用 这是函数的最通常用法,属于全局性调用,因此this就代表全局对象Global。 function test(){ this.x = 1; alert(this.x); } test(); // 1 为了证明this就是全局对象,我对代码做一些改变: var x = 1; function test(){ alert(this.x); } test(); // 1 运行结果还是1。再变一下: var x = 1; function test(){ this.x = 0; } test(); alert(x); //0 情况二:作为对象方法的调用 函数还可以作为某个对象的方法调用,这时this就指这个上级对象。 function test(){...
JS的构造函数
发表于2016-01-04|js
原文地址:http://www.cnblogs.com/jikey/archive/2011/05/13/2045005.html //构造函数//使自己的对象多次复制,同时实例根据设置的访问等级可以访问其内部的属性和方法//当对象被实例化后,构造函数会立即执行它所包含的任何代码function myObject(msg){//特权属性(公有属性)this.myMsg = msg; //只在被实例化后的实例中可调用this.address = ‘上海’; //私有属性var name = ‘豪情’;var age = 29;var that = this; //私有方法function sayName(){alert(that.name);}//特权方法(公有方法)//能被外部公开访问//这个方法每次实例化都要重新构造而prototy...
PHP获取文件大小
发表于2016-01-04|php
这两天做了个把图片转为base64传到服务器后,想限制图片大小, 可以用strlen测量传回来的字符串长度,基本上即为图片大小 bit 乘以1024即为byte 注意这里使用strlen而不是sizeof sizeof() 函数计算 数组中元素数目 或 对象中的 属性个数。    
js获取当前域名
发表于2015-12-31|js
<script language=”javascript”>//获取域名host = window.location.host;host2=document.domain; //获取页面完整地址url = window.location.href; document.write(“<br>host=”+host)document.write(“<br>host2=”+host2)document.write(“<br>url=”+url)</script>
php gd库 imagettftext
发表于2015-12-30|php
array imagettftext ( resource $image , float $size , float $angle , int $x , int $y , int $color , string $fontfile ,string $text ) image An image resource, returned by one of the image creation functions, such as imagecreatetruecolor(). size The font size. Depending on your version of GD, this should be specified as the pixel size (GD1) or point size (GD2). angle The angle in degrees, with 0 degrees being left-to-right reading text. Higher values represent a counter-clockwise rotation. For e...
微信 drawImage
发表于2015-12-30|js
[pcsh lang=”js” tab_size=”4” message=”” hl_lines=”” provider=”manual”] function getimgbase64(file){ var canvas = document.createElement('canvas'); var ctx = canvas.getContext('2d'); canvas.width = canvaswidth; canvas.height = canvasheight; var x=$('#make-photo .theme').children('.photo').css('left').split('px')[0]; var img = new Image(); function tmpLoad() { x = x > 0 ? x : -x; ctx.drawImage(im...
禁用HTML5 300ms延迟
发表于2015-12-30|js
原文地址:http://amazeui.org/1.x/javascript/fastclick/ FastClick.attach(document.body); 不应用 FastClick 的场景 如果 viewport meta 标签 中设置了 width=device-width, Android 上的 Chrome 32+ 会禁用 300ms 延时;
1…707172…103
avatar
developer
AI相伴的开发者博客
文章
1030
标签
737
分类
36
Follow Me
公告
This is my Blog
最新文章
wsl2中podman总是需要登录解决办法2026-10-10
wsl2中ipv6速度慢2026-10-10
fast-whisper音视频转文字2026-10-02
rn开发中断开手机再连上后连不上metro2026-10-01
zed编辑器ESLint报错2026-10-01
分类
  • apicloud3
  • bootstrap8
  • cmder1
  • cocos2d-js5
  • createjs17
  • day45
  • docker16
  • egret14
标签
png 算法 psd Generator 接口测试 自动 为新开发 mb_ereg_replace 自定义字段面板 end 不准 兼容模式 ssh movieclip json https 内部指针 chrome 管理工具 灵异事件 metro event 菜单 客户端等 rn 发红包 windows 禁止 环境 poppler mysql_fetch_object COS 和数组 性能测试 解密 拓展 stdClass 时间对象问题 pull Promise对象
归档
  • 十月 2026 5
  • 八月 2026 1
  • 六月 2026 2
  • 五月 2026 1
  • 四月 2026 2
  • 三月 2026 3
  • 二月 2026 5
  • 一月 2026 3
网站信息
文章数目 :
1030
最后更新时间 :
© 2025 - 2026 By developer框架 Hexo 8.1.1|主题 Butterfly 5.5.4
搜索
数据加载中