Dev
搜索

Dev

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()...
addEventListener js 捕获阶段 冒泡阶段
发表于2015-12-29|js
element.addEventListener(event, function, useCapture) 参数值 参数 描述 event 必须。字符串,指定事件名。 注意: 不要使用 “on” 前缀。 例如,使用 “click” ,而不是使用 “onclick”。 提示: 所有 HTML DOM 事件,可以查看我们完整的 HTML DOM Event 对象参考手册。 function 必须。指定要事件触发时执行的函数。 当事件对象会作为第一个参数传入函数。 事件对象的类型取决于特定的事件。例如, “click” 事件属于 MouseEvent(鼠标事件) 对象。 useCapture 可选。布尔值,指定事件是否在捕获或冒泡阶段执行。 可能值: true - 事件句柄在捕获阶段执行 false- false- 默认。事件句柄在冒泡阶段执行   冒泡:即事件由子元素向祖先元素传播的,就像气泡从水底向水面上浮一样 ‘父级’元素先发生则为:捕获型 ‘子级’先发生则为:冒泡型
1…707172…103
avatar
developer
AI相伴的开发者博客
文章
1024
标签
725
分类
35
Follow Me
公告
This is my Blog
最新文章
opencode自定义模型2026-06-18
pdf操作2026-06-04
pdf按章节拆分到文件2026-05-03
svg转png2026-04-09
taro+tailwind开发记录2026-04-07
分类
  • apicloud3
  • bootstrap8
  • cmder1
  • cocos2d-js5
  • createjs17
  • day45
  • docker16
  • egret14
标签
备份 运营网站记录 dd mb_ereg_replace 封禁ip jssdk Anaconda 创建软连接 apache 路由不生效 Shortcode xss htmlspecialchars 中 解密 企业支付返回数据 搭建php开发环境 worker 函数 开启url 微信分享定制注意事项 排序 乌龟 注意点 vue 魔术方法 php Post Formats 报错 sftp 协程 serverless 类型转换 Promise对象 时间戳 discover alter 过大的 但是无效果 opencode
归档
  • 六月 2026 2
  • 五月 2026 1
  • 四月 2026 2
  • 三月 2026 3
  • 二月 2026 5
  • 一月 2026 3
  • 十二月 2025 5
  • 十一月 2025 2
网站信息
文章数目 :
1024
最后更新时间 :
© 2025 - 2026 By developer框架 Hexo 8.1.1|主题 Butterfly 5.5.4
搜索
数据加载中