Dev
搜索

Dev

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 延时;
absolute 定位居中代码
发表于2015-12-29|html
有时候 margin: 0 auto 无法居中 使用如下代码 其中宽度margin-left是宽度width除以二,就是先把左边界放到中间,然后移动到中间位置 left: 50%;margin-left: -190px;
HTML5 canvas drawImage() 方法
发表于2015-12-29|js
var context = c.getContext("2d"); JavaScript 语法 1 在画布上定位图像: context.drawImage(img,x,y); JavaScript 语法 2 在画布上定位图像,并规定图像的宽度和高度: context.drawImage(img,x,y,width,height); JavaScript 语法 3 剪切图像,并在画布上定位被剪切的部分: context.drawImage(img,sx,sy,swidth,sheight,x,y,width,height);
HTML DOM getContext() 方法
发表于2015-12-29|html
getContext() 方法返回一个用于在画布上绘图的环境。 语法 Canvas.getContext(contextID) 参数 参数 contextID 指定了您想要在画布上绘制的类型。当前唯一的合法值是 "2d",它指定了二维绘图,并且导致这个方法返回一个环境对象,该对象导出一个二维绘图 API。 提示:在未来,如果 <canvas> 标签扩展到支持 3D 绘图,getContext() 方法可能允许传递一个 "3d" 字符串参数。
HTML5中类jQuery选择器querySelector的使用
发表于2015-12-29|jq
原文地址http://www.cnblogs.com/Wayou/p/html5_web_api_queryselector.html HTML5向Web API新引入了document.querySelector以及document.querySelectorAll两个方法用来更方便地从DOM选取元素 用法 两个方法使用差不多的语法,都是接收一个字符串参数,这个参数需要是合法的CSS选择语法。 element = document.querySelector('selectors'); elementList = document.querySelectorAll('selectors'); 其中参数selectors 可以包含多个CSS选择器,用逗号隔开。 element = document.querySelector('selector1,selector2,...'); elementList = document.querySelectorAll('selector1,selector2,...'); 使用这两个方法无法查找带伪类状态的元素,比如querySe...
JS prototype 原型
发表于2015-12-29|js
1 原型法设计模式 在.Net中可以使用clone()来实现原型法 原型法的主要思想是,现在有1个类A,我想要创建一个类B,这个类是以A为原型的,并且能进行扩展。我们称B的原型为A。   2 javascript的方法可以分为三类: a 类方法 b 对象方法 c 原型方法 例子: function People(name) { this.name=name; //对象方法 this.Introduce=function(){ alert("My name is "+this.name); } } //类方法 People.Run=function(){ alert("I can run"); } //原型方法 People.prototype.IntroduceChinese=function(){ alert("我的名字是"+this.name); } //测试 var p1=new People(“Windking”); p1.Introduce(); People.Run(); p1.IntroduceChinese()...
1…707172…103
avatar
developer
AI相伴的开发者博客
文章
1025
标签
727
分类
35
Follow Me
公告
This is my Blog
最新文章
python开发环境多版本管理2026-08-18
opencode自定义模型2026-06-18
pdf操作2026-06-04
pdf按章节拆分到文件2026-05-03
svg转png2026-04-09
分类
  • apicloud3
  • bootstrap8
  • cmder1
  • cocos2d-js5
  • createjs17
  • day45
  • docker16
  • egret14
标签
注意要点 th 配置 判断一个 git rc.local 对象 常见问题 问题 引用传递 require_once() centos 区别 animate动画 hset命令 trim 每隔一段时间 要点 pgsql 图片 golang swoft goaccess getx 显示 微信开发 设计模式 Filter 高度可自定义 开放平台 发红包 to grep 测试代码 require() call 控制器 ioc array_column 时间复杂度
归档
  • 八月 2026 1
  • 六月 2026 2
  • 五月 2026 1
  • 四月 2026 2
  • 三月 2026 3
  • 二月 2026 5
  • 一月 2026 3
  • 十二月 2025 5
网站信息
文章数目 :
1025
最后更新时间 :
© 2025 - 2026 By developer框架 Hexo 8.1.1|主题 Butterfly 5.5.4
搜索
数据加载中