首页
关于
留言
友链
直播
更多
视频
壁纸
Search
1
乐橙CMS影视管理系统最全版本
20,575 阅读
2
新浪图片链接修复教程集合
13,004 阅读
3
乐橙CMS影视管理系统4.0.18版本
11,838 阅读
4
反调试代码调试死机代码禁止F12代码
6,982 阅读
5
爬虫UA大全
6,308 阅读
语言
PHP
Java
Go
JavaScript
CSS
Vue
资源教程
网络杂谈
技术文章
影视交流
软件工具
Mac
Search
标签搜索
PHP
LINUX
微信
MYSQL
P2P
JS
乐橙cms
支付
破解
公众号
typecho
xshell
扫一扫
监控
微信支付
支付宝
JetBrains
redis
VPN
MacBook
子沫'S
累计撰写
103
篇文章
累计收到
368
条评论
首页
栏目
语言
PHP
Java
Go
JavaScript
CSS
Vue
资源教程
网络杂谈
技术文章
影视交流
软件工具
Mac
页面
关于
留言
友链
直播
视频
壁纸
搜索到
2
篇与
JS
的结果
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日
959 阅读
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日
1,057 阅读
0 评论
0 点赞