![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
js
ffp-xuan
这个作者很懒,什么都没留下…
展开
-
htmt5中文本居中在chrome中发现一个问题
在火狐下和chrome测试下发现 当设置文字居中显示的时候 如果在 chrome下 设置textBaseline=‘top’的情况下 再进行居中 文本位置会偏下 在火狐下确是正常的 为了使文本在chrome下居中显示 我们只能用textBaseline=‘bottom’ 再在Y轴居中的情况下 oGc.fillText(str,(oC.width-w)/2,(oC.height-h)/2+h); ...原创 2018-09-14 22:03:33 · 259 阅读 · 0 评论 -
HTML5 拖拽外部图片 对图片进行马赛克处理
由于getImageData方法存在跨域问题 要在服务器环境下运行 var oC=document.getElementById('c1'); var oGc=oC.getContext('2d'); var str1='请拖放此区域'; var str2='可以释放'; var h=40; oGc.textBaseline='bottom'; o...原创 2018-09-14 22:17:08 · 610 阅读 · 0 评论