首页
关于
留言
友链
电台
壁纸
我的足迹
推荐
知易而行MCP
Search
1
乐橙CMS影视管理系统最全版本
109,277 阅读
2
VIP视频解析破解电影解析模拟破解影视解析
77,795 阅读
3
乐橙CMS影视管理系统4.0.18版本
16,934 阅读
4
新浪图片链接修复教程集合
15,125 阅读
5
反调试代码调试死机代码禁止F12代码
12,093 阅读
语言
PHP
Java
Go
JavaScript
CSS
Vue
资源教程
网络杂谈
技术文章
影视交流
软件工具
Mac
知易而行
登录
Search
标签搜索
PHP
AI
LINUX
微信
MYSQL
OpenClaw
ESP32S3
小智AI
P2P
JS
破解
乐橙cms
支付
uniapp
人工智能
技术趋势
智能玩具
公众号
typecho
xshell
子沐~
累计撰写
121
篇文章
累计收到
372
条评论
首页
栏目
语言
PHP
Java
Go
JavaScript
CSS
Vue
资源教程
网络杂谈
技术文章
影视交流
软件工具
Mac
知易而行
页面
关于
留言
友链
电台
壁纸
我的足迹
推荐
知易而行MCP
搜索到
2
篇与
的结果
2019-04-02
js控制底层滚动
//设置底层禁止滚动(true:禁止滚动;false:打开滚动) function stopBodyScroll (isFixed) { var bodyEl = document.body; if (isFixed) { scrollTop = $(window).scrollTop(); bodyEl.style.position = 'fixed'; bodyEl.style.width = '100%'; } else { bodyEl.style.position = ''; document.body.scrollTop = scrollTop; } }
2019年04月02日
1,977 阅读
1 评论
0 点赞
2019-03-31
页面鼠标点击之处出现美丽小心心
山也不说了直接上代码 (function(window,document,undefined){ var hearts = []; window.requestAnimationFrame = (function(){ return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (callback){ setTimeout(callback,1000/60); } })(); init(); function init(){ css(".heart{width: 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);}.heart:after,.heart:before{content: '';width: inherit;height: inherit;background: inherit;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;position: absolute;}.heart:after{top: -5px;}.heart:before{left: -5px;}"); attachEvent(); gameloop(); } function gameloop(){ for(var i=0;i<hearts.length;i++){ if(hearts[i].alpha <=0){ document.body.removeChild(hearts[i].el); hearts.splice(i,1); continue; } hearts[i].y--; hearts[i].scale += 0.004; hearts[i].alpha -= 0.013; hearts[i].el.style.cssText = "left:"+hearts[i].x+"px;top:"+hearts[i].y+"px;opacity:"+hearts[i].alpha+";transform:scale("+hearts[i].scale+","+hearts[i].scale+") rotate(45deg);background:"+hearts[i].color; } requestAnimationFrame(gameloop); } function attachEvent(){ var old = typeof window.onclick==="function" && window.onclick; window.onclick = function(event){ old && old(); createHeart(event); } } function createHeart(event){ var d = document.createElement("div"); d.className = "heart"; hearts.push({ el : d, x : event.clientX - 5, y : event.clientY - 5, scale : 1, alpha : 1, color : randomColor() }); document.body.appendChild(d); } function css(css){ var style = document.createElement("style"); style.type="text/css"; try{ style.appendChild(document.createTextNode(css)); }catch(ex){ style.styleSheet.cssText = css; } document.getElementsByTagName('head')[0].appendChild(style); } function randomColor(){ return "rgb("+(~~(Math.random()*255))+","+(~~(Math.random()*255))+","+(~~(Math.random()*255))+")"; } })(window,document);
2019年03月31日
2,233 阅读
0 评论
0 点赞