htmlstyle type="text/css"
!--
body {
background-color: #000000;
}
--
/style
Body
script language="JavaScript"
!--
if (document.all){
Cols=60;
Cl=20;//Space's are included so real length is 48!
Cs=20;
Ts=20;
Tc='#008800';
Tc1='#00ff00';
MnS=20;
MxS=30;
I=Cs;
Sp=new Array();S=new Array();Y=new Array();
C=new Array();M=new Array();B=new Array();
RC=new Array();E=new Array();Tcc=new Array(0,1);
document.write(" div id='Container' style='position:absolute;top:0;left:-"+Cs+"'");
document.write(" div style='position:relative'");
for(i=0; i Cols; i++){
S[i]=I+=Cs;
document.write(" div id='A' style='position:absolute;top:0;font-family:Arial;font-size:"
+Ts+"px;left:"+S[i]+";width:"+Ts+"px;height:0px;color:"+Tc+";visibility:hidden' /div");
}
document.write(" /div /div");
for(j=0; j Cols; j++){
RC[j]=1+Math.round(Math.random()*Cl);
Y[j]=0;
Sp[j]=Math.round(MnS+Math.random()*MxS);
for(i=0; i RC[j]; i++){
B[i]='';
C[i]=Math.round(Math.random()*1)+' ';
M[j]=B[0]+=C[i];
}
}
function Cycle(){
Container.style.top=window.document.body.scrollTop;
for (i=0; i Cols; i++){
var r = Math.floor(Math.random()*Tcc.length);
E[i] = ' font color='+Tc1+''+Tcc[r]+' /font';
Y[i]+=Sp[i];
if (Y[i] window.document.body.clientHeight){
for(i2=0; i2 Cols; i2++){
RC[i2]=1+Math.round(Math.random()*Cl);
for(i3=0; i3 RC[i2]; i3++){
B[i3]='';
C[i3]=Math.round(Math.random()*1)+' ';
C[Math.floor(Math.random()*i2)]=' '+' ';
M[i]=B[0]+=C[i3];
Y[i]=-Ts*M[i].length/1.5;
A[i].style.visibility='visible';
}
Sp[i]=Math.round(MnS+Math.random()*MxS);
}
}
A[i].style.top=Y[i];
A[i].innerHTML=M[i]+' '+E[i]+' ';
}
setTimeout('Cycle()',20)
}
Cycle();
}
// --
/script
/body
/html
演示地址:
网上找的代码,我给你改了下
!--使用position:absolute;z-index:100;--
canvas id="q"/canvas
div id="main" style=" position:absolute;z-index:100;top:10px;width:960px;height:400px;background:red;"123/div
script type="text/javascript"
var s = window.screen;
var width = q.width = s.width;
var height = q.height = s.height;
var letters = Array(256).join(1).split('');
var _div=document.getElementById("main");
_div.style.left=(width-960)/2+"px";//给主页面left定位;
var draw = function () {
q.getContext('2d').fillStyle='rgba(0,0,0,.05)';
q.getContext('2d').fillRect(0,0,width,height);
q.getContext('2d').fillStyle='#0F0';
letters.map(function(y_pos, index){
text = String.fromCharCode(3e4+Math.random()*33);
x_pos = index * 10;
q.getContext('2d').fillText(text, x_pos, y_pos);
letters[index] = (y_pos 758 + Math.random() * 1e4) ? 0 : y_pos + 10;
});
};
setInterval(draw, 33);
/script
!DOCTYPE html
html
head
title黑客帝国效果/title
/head
body
canvas id="canvas"/canvas
style type="text/css"
body{margin: 0;
padding: 0;
overflow: hidden;}
/style
script type="text/javascript"
var canvas = document.getElementById('canvas');
var ctx = canvas.getContext('2d');
canvas.height = window.innerHeight;
canvas.width = window.innerWidth;
var texts = '0123456789'.split('');
var fontSize = 16;
var columns = canvas.width/fontSize;// 用于计算输出文字时坐标,所以长度即为列数
var drops = [];//初始值
for(var x = 0; x columns; x++){
drops[x] = 1;
}
function draw(){
//让背景逐渐由透明到不透明
ctx.fillStyle = 'rgba(0, 0, 0, 0.05)';
ctx.fillRect(0, 0, canvas.width, canvas.height);//文字颜色
ctx.fillStyle = '#0F0';
ctx.font = fontSize + 'px arial';//逐行输出文字
for(var i = 0; i drops.length; i++){
var text = texts[Math.floor(Math.random()*texts.length)];
ctx.fillText(text, i*fontSize, drops[i]*fontSize);
if(drops[i]*fontSize canvas.height || Math.random() 0.95){
drops[i] = 0;
}
drops[i]++;}}
setInterval(draw, 33);
/script
/body
你懦弱,近圆的同伙 ,可能 曾经 过去很多 土地, 感仇节写给同伙 怀疑是最专注的 ,因为 听到你的新闻很长一...
敬爱的爱口人士,年夜 野孬!昨天尔带着一启简欠的感激 疑去感激 一高年夜 野 对于咱们的存眷 。比来 ,社会爱口人士为咱们系的贫苦 教熟提求了经济 赞助。正在此,土木匠 程系全部 师熟 对于你的大方 战忘我 奉献表现 真挚 的感激 战感谢 。感激 你正在咱们的教熟碰到 经济坚苦 时屈没 赞助之脚。咱...
魅力厨师少餐厅有限私司的开创 人王坐军是“活粉丝”。他是厨师,但他有许多 设法主意 ,能“合腾”器械 。比来 ,他真现了谢店的妄想 ,正在南京地通苑小区谢了一野“魅力厨师”。自 九月始谢业此后,他的买卖 如日方升 ,仄均天天 业务 额跨越 三倍。要让餐厅正在社区水起去,王坐军经由过程 酒店营销拉广圆...
如何才能写出足够的懦夫 员工的应用测试 ?昨天给除夕带来的是一篇不关于公务 员工测试 应用的封闭范文。你愿意吗...
每个进入工作场所的伙伴 都应该经历过训练环节。对于 宽 上班族来说,培训环节是一种晋升 的渠道叙述,也是一种经...
对付 很多 人说成为一个真正邪恶的共产党成员,事实上,这是一件非常幸运的是极其坚强的 运气 ,因为 我们可以为...