1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > js星空效果代码_页面背景

js星空效果代码_页面背景

时间:2021-09-02 20:28:33

相关推荐

js星空效果代码_页面背景

web前端|js教程

js,星空效果

web前端-js教程

yy网页人气协议源码,vscode增加背景图片,ubuntu 打字法,改变tomcat运行目录,网页音乐爬虫,php如何调用java,宜昌本地seo推广多少钱,php 房产网站源码lzw

星空效果

图文博客类网站源码,ubuntu设置引导顺序,反爬虫豆瓣代码,php 守护,seo59186lzw

<!– try{ var winSize = { width:document.documentElement.clientWidth, height:document.documentElement.clientHeight } var MooSky = function(options){ this.options = options; this.stars = new Array(); this.show = function(){ for(var i=0;i<this.options.num;i++){ var newStar = new MooStar({ container : this.options.container }); newStar.fly(); this.stars[i] = newStar; } } } var MooStar = function(options){ this.options = options; if(!!this.options.container){ this.container = document.getElementById(this.options.container); }else{ this.container = document.body; } this.baseSpeed = 10; var o = this; this.speed = Math.round(Math.random()*this.baseSpeed)+1; this.dom = document.createElement(DIV); this.dom.className = star; if(!!this.options.container){ var left = Math.round(Math.random()*this.container.offsetWidth-1); var top = Math.round(Math.random()*this.container.offsetHeight-1); this.dom.style.left = left+px; this.dom.style.top = top+px; this.container.appendChild(this.dom); }else{ this.dom.style.left = Math.random()*winSize.width-1+px; this.dom.style.top = Math.random()*winSize.height-1+px; document.body.appendChild(this.dom); } } MooStar.prototype.fly = function(){ if(this.dom.offsetLeft<0){ if(!!this.options.container){ var left = this.container.offsetWidth-1; var top = Math.round(Math.random()*this.container.offsetHeight)-1; this.dom.style.left = left+px; this.dom.style.top = top+px; }else{ this.dom.style.left = winSize.width-1+px; this.dom.style.top = Math.random()*winSize.height-1+px; } }else{ var left = this.dom.offsetLeft-this.speed; if(left

vc计时器源码,vscode创建安卓虚拟机,ubuntu 待机 断电,tomcat7 不响应,structs 防爬虫,php redis怎么用,江苏如何做seo推广优化lzw

ABCD

[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。