会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
distant-遥远
古人学问无遗力,少壮工夫老始成。 纸上得来终觉浅,绝知此事要躬行
博客园
首页
新随笔
联系
管理
上一页
1
2
3
4
5
6
7
8
9
10
···
15
下一页
2019年11月23日
js里json和eval()
摘要: JSON * - JS中的对象只有JS自己认识,其他的语言都不认识 * - JSON就是一个特殊格式的字符串,这个字符串可以被任意的语言所识别, * 并且可以转换为任意语言中的对象,JSON在开发中主要用来数据的交互 * - JSON * - JavaScript Object Notation J
阅读全文
posted @ 2019-11-23 11:39 distant-遥远
阅读(513)
评论(0)
推荐(0)
2019年11月19日
js--冒泡排序
摘要: <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>if练习3</title> <script type="text/javascript"> /* * 编写程序,由键盘输入三个整数分别存入变量num1、num2、num3, *
阅读全文
posted @ 2019-11-19 16:30 distant-遥远
阅读(100)
评论(0)
推荐(0)
2019年11月15日
js数学公式-曲线运动
摘要: 勾股定理 a*a + b*b =c*c 三角函数 正弦 : sin 余弦 : cos 正切 : tan 余切 : cot 正弦定理 a/sinA = b/sinB =c/sinC = 2r(r为外接圆半径) 余弦定理 cosA = b*b + c*c - a*a / 2bc cosB = c*c +
阅读全文
posted @ 2019-11-15 16:40 distant-遥远
阅读(808)
评论(0)
推荐(0)
事件绑定兼容(事件流的机制;事件委托
摘要: 2.js的兼容性问题 ev||event offsetParent 事件绑定(事件流的机制;事件委托) 鼠标滚轮事件 非火狐:onmousewhell(dom0) ev.whellDelta(滚轮方向) 上:正 下:负 火狐: DOMMouseScroll(dom2) ev.detail(滚轮方向)
阅读全文
posted @ 2019-11-15 15:18 distant-遥远
阅读(215)
评论(0)
推荐(0)
2 获取元素在页面中的位置
摘要: 获取元素在页面中的位置 绝对位置:到body的距离 相对位置:到视口的距离 本身定位为fixed ==> offsetParent:null(不是火狐) offsetTop和offsetLeft也是参照于body的 ==> offsetParent:body(火狐) 本身定位不为fixed 父级没有
阅读全文
posted @ 2019-11-15 13:45 distant-遥远
阅读(220)
评论(0)
推荐(0)
2019年11月14日
Dom关于位置和尺寸的api
摘要: parentNode 直接父级//和offsetParent不同 <!DOCTYPE html> <html id="html"> <head> <meta charset="UTF-8"> <title></title> <style type="text/css"> #inner2{ posit
阅读全文
posted @ 2019-11-14 19:46 distant-遥远
阅读(170)
评论(0)
推荐(0)
2019年11月10日
canvas像素的操作
摘要: ###在canvas中的像素操作 到目前为止,我们尚未深入了解Canvas画布真实像素的原理,事实上, 你可以直接通过ImageData对象操纵像素数据,直接读取或将数据数组写入该对象中 ###得到场景像素数据 getImageData():获得一个包含画布场景像素数据的ImageData对像,它代
阅读全文
posted @ 2019-11-10 16:46 distant-遥远
阅读(504)
评论(0)
推荐(0)
canvas绘制文本
摘要: ##在canvas中绘制文本 canvas 提供了两种方法来渲染文本: fillText(text, x, y) 在指定的(x,y)位置填充指定的文本 strokeText(text, x, y) 在指定的(x,y)位置绘制文本边框 <!DOCTYPE html> <html> <head> <me
阅读全文
posted @ 2019-11-10 11:46 distant-遥远
阅读(669)
评论(0)
推荐(0)
canvas插入图片设置背景,渐变
摘要: ##在canvas中插入图片(需要image对象) 1.canvas操作图片时,必须要等图片加载完才能操作 2.drawImage(image, x, y, width, height) 其中 image 是 image 或者 canvas 对象,x 和 y 是其在目标 canvas 里的起始坐标。
阅读全文
posted @ 2019-11-10 11:28 distant-遥远
阅读(7829)
评论(0)
推荐(0)
2019年11月9日
canvas绘制路径
摘要: 2.画布apicanvas.getContext("2d");canvas.widthcanvas.height 3.上下文api ctx.fillRect(x,y,w,h):填充矩形 ctx.strokeRect(x,ymwmh):带边框的矩形 ctx.clearRect(0,0,oc.width
阅读全文
posted @ 2019-11-09 12:43 distant-遥远
阅读(387)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
9
10
···
15
下一页