本文目录一览:
- 1、如何设计让网页“双击自动滚屏”?
- 2、让电脑像黑客帝国一样滚绿码
- 3、求"黑客帝国"里电脑屏幕上的"代码"不间断滚动的代码,
- 4、C#如何实现滚屏效果
- 5、如何用C语言制作一个可以在开始屏幕上滚动的字幕?
如何设计让网页“双击自动滚屏”?
将以下代码添加到需要自动滚屏的页面上就可以了
var
currentpos,
timer;
function
initialize
(){
timer
=
setInterval
("
scrollwindow
()",
1);
}
function
sc(){
clearInterval
(timer);
}
function
scrollwindow(){
currentpos
=
document.body.scrollTop;
window.scroll(0,
++currentpos);
if(currentpos
!=
document.body.scrollTop){
sc();
}
}
document.onmousedown
=
sc;
document.ondblclick
=
initialize;
让电脑像黑客帝国一样滚绿码
这种代码确实有,我曾经用过!就是cmd批处理代码,也可以其他语言,如果用其他语言编写没你说那个绿色字幕啥的,不管是什么代码写的都是那种清理垃圾!绿色的滚码也挺酷酷的!
别听别人瞎说,他们没有见识,我七年前就玩过这个cmd清理垃圾批处理。现在清理垃圾用杀毒软件就可以做到!没必要这种特技炫酷的!其实你玩其他也可以的,比如你真正的学一门黑客技术
求"黑客帝国"里电脑屏幕上的"代码"不间断滚动的代码,
把下面复制到记事本,另存为HTML文件。你可以自己DIY一下。
html
head
title类似黑客帝国的01数字流/title
/head
body bgcolor=#000000
script language="JavaScript"
!--
if (document.all){
Cols=6;
Cl=24;//Space's are included so real length is 48!
Cs=10;
Ts=10;
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
/body
/html
C#如何实现滚屏效果
你就用一个label的,完了在里面写上你要显示的字的。添加一个timer。完了你就在那个timer_tick时间里面对LABEL的位置进行操作的。。
Label.left
=
label.left
-
10,这样就可以了。完了,在当它的right
=
窗体的左边沿值的时候,就将其left
=
窗体的右边沿值就可以了。
如何用C语言制作一个可以在开始屏幕上滚动的字幕?
实现滚动字幕:
一、单行滚动,写一个函数,每次调用让全局或静态字符数组向一个方向移位(比如左移,从最右边一个非0字符开始遍历,依次覆盖左边的一个字符,最左边的字符被第二个字符覆盖,最右边一个非0位变移出的那个字符)。记得保留结束符号0。
二、之后循环打印字符数组。每次使用system("cls");清空控制台显示。
三、多行滚动,同理,只不过把字符移动覆盖,改成字符串移动覆盖。(移动方向的后一行覆盖前一行,把移动方向第一行内容赋值给最后一行)。
//ps:由于肉眼观察,移动需要间隔,用Sleep函数,但该函数会让线程停止,如滚屏间隔期间,还希望其它部分正常运行,需要写线程。
下面是参考代码:
#includestdio.h
#include windows.h
void sScreen(char str[],int len,int f);//len:内容长度,不包含结束符号。f=1向左移动。f=0向右移动;
int main()
{
char str[]="I LOVE YOU";
while(1)
{
printf("%s\n",str);
sScreen(str,10,0);
Sleep(1000);
system("cls");
}
return 0;
}
void sScreen(char str[],int len,int f)
{
int i;
char c;
if(f)
{
c=str[0];
for(i=0;ilen-1;i++)
str[i]=str[i+1];
str[len-1]=c;
}
if(!f)
{
c=str[len-1];
for(i=len-1;i0;i--)
str[i]=str[i-1];
str[0]=c;
}
}