- 博客(8)
- 收藏
- 关注
原创 简单的轮播效果(js)
var oldpage = 0; var nowpage = 0; var hometimer; libtns[0].classList.add("curclick"); function homeWheel(){ for(var i =0;i<libtns.length;i++){//手动切换 libtns[i].index = i;...
2020-03-18 11:45:42
88
原创 气泡效果(canvas)
}body{background:blue;}canvas{position: absolute;left: 0;right: 0;top: 0;bottom: 0;margin:auto;background: white;}<body id="body"><canvas id="cv" width="800" height="800"&g...
2020-03-16 13:38:20
266
原创 简单的泡沫效果
body{background:blue;}canvas{position: absolute;left: 0;right: 0;top: 0;bottom: 0;margin:auto;background: white;}<body id="body"><canvas id="cv" width="1000" height="1000">...
2020-03-16 13:24:22
207
原创 简单的曲线运动
#wrap{position:absolute;width:10px;height:10px;left:0px;top:300px;background:red;}.box{ position:absolute; width:2px; height:2px; background:black;}<div id="wrap"></div>...
2020-03-16 12:51:26
201
原创 clientWidth clientHeight 与offsetWidth offsetHeight
xx.clientWidth clientHeight:表示一个xx盒子的content和padding的宽高;xx.offsetWidth offsetHeight:表示一个xx盒子的content和padding和border的宽高;
2020-03-16 11:16:56
104
原创 mac底部导航效果
css:}#wrap img{width:64px;}#wrap{position: absolute;bottom:0;left:0;width:100%;text-align:center;}html:<div id="wrap"> <img src="images/1.png"/> <img src="images/2.png"...
2020-03-16 11:10:17
294
原创 滚轮事件兼容火狐浏览器
var wrap = document.querySelector("#wrap"); if(wrap.addEventListener){ wrap.addEventListener("DOMMouseScroll",fn); } wrap.onmousewheel=fn; function fn(ev){ ev = ev||event; v...
2020-03-16 10:55:17
349
原创 parentNode和offsetParent的区别
parentNode:直接父级offsetParent:类似于css的包含块(根据本身定位及父级定位来确认offsetParent的目标元素)offsetParent的作用: offsetLeft 和 offsetTop 是参照于offsetParent 的内边距边界的dom里面所有元素都有offsetLeft 和 offsetTopoffsetParent兼容性: ...
2020-03-16 10:47:16
741
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人