网页里文字上下滚动的源代码
分类: 代码专题 | 修改 | 删除 | 转自 月下泛舟 | 被1人转藏 | 2009-10-14 16:30:18
1 网页里文字上下滚动的源代码:(direction=up向上)(direction=down向下)(direction =left向左) 注意:下面width=450是更改文字在网页里面滚动的宽度,scrolldelay=80是更改文字运行的速度, 如果想改变文字运行方向, aligh:是设置字幕是否居中, left是居左、center是居中、right是居右 top是居上、bottom是居下, bgcolor是设置被景颜色, <img scr="某个图片的链接,只要把这断代码手面换成图片,就可以实行图片滚动了, 请按照上面的要求更改下面的代码, <marquee direction=up TrueSpeed scrollAmount=1 scrollDelay=80 height=300 width=450 border="0"> <br>有太多往事就别喝下太少酒精 <br>太珍惜生命就别随便掏心 </marquee> 1-1 <DIV> <TABLE borderColor=#000000 cellSpacing=0 cellPadding=5 bgColor=#6699ff border=1> <TBODY> <TR> <TD> <MARQUEE scrollAmount=1 scrollDelay=10 direction=up width=180 height=100> <P align=center><FONT face=黑体 color=#ffffff>你所要输入的主题</FONT></P> <P><FONT color=#ffffff> 你所要输入的主题 你所要输入的正文内容 </FONT></P></MARQUEE></TD></TR></TBODY></TABLE></DIV> 注: =换行代码 borderColor=边框颜色代码 bgColor=背景颜色代码 scrollAmount=滚动速度scrollDelay=设置字幕内容 滚动时停顿的时间(如果要让滚动看起来流畅,数值应该尽量小) direction=方向(上下左右依次 是"up","down","left","right") width=滚动界面的宽 height=滚动界面的高 FONT color=文字颜色 cellPadding=文字缩进宽度 上面的数值可以根据自己的需要更改。 2 如何使文字变成超联接,也就是点击一下,就进入了你想连接的别人网站 把下面的代码插入网格内, 例如,我想联接网易代码如下 <A href="http://www.163.com/" target=_blank><FONT size=2>网易</FONT></A> 3 被景不动的效果 这段程序放在<body ****>正文中 例如,先在修改内插入被景图片,然后再从代码中找出来,把下面的代码加入里面就好了, 找出来的结果如下:<BODY background="图片路径"> 完成以后的结果如下:<BODY这里必需有空格style="BACKGROUND-ATTACHMENT: fixed" back ground="图片路径"> 4 不许用鼠标右键的效果,把下面代码插入<head></head>之间 <script> function click() { if (event.button==2) { alert(\'你想看什麽?\') } } document.onmousedown=click </script> 5 不停变色的文字 <script language=javascript> <!-- function initArray() { this.length = initArray.arguments.length; for (var i = 0; i < this.length; i++) { this = initArray.arguments; } } var ctext = "看看我,我会变色"; var speed = 1000; var x = 0; var color = new initArray( "red", "blue", "green", "black", "yellow", "pink"); if (navigator.appVersion.indexOf("MSIE") != -1) { document.write(\'<div id="c"><center>\'+ctext+\'</center></div>\'); } function chcolor() { if (navigator.appVersion.indexOf("MSIE") != -1) { document.all.c.style.color = color[x]; } (x < color.length-1) ? x++ : x = 0; } setInterval("chcolor()",1000); --> </script> 6 心跳的文字 <style> <!-- #glowtext{ filter:glow(color=0A9DF5,strength=2); width:100%; } --> </style> <script language="JavaScript1.2"> function glowit(which){ if (document.all.glowtext[which].filters[0].strength==2) document.all.glowtext[which].filters[0].strength=1 else document.all.glowtext[which].filters[0].strength=2 } function glowit2(which){ if (document.all.glowtext.filters[0].strength==2) document.all.glowtext.filters[0].strength=1 else document.all.glowtext.filters[0].strength=2 } function startglowing(){ if (document.all.glowtext&&glowtext.length){ for (i=0;i<glowtext.length;i++) eval(\'setInterval("glowit(\'+i+\')",150)\') } else if (glowtext) setInterval("glowit2(0)",150) } if (document.all) window.onload=startglowing </script> <span id="glowtext"><font color="F5D20A" " face="宋体" size="3">心跳的感觉——数 字人!</font></span> 7 以下代码,可以使网页的背景向下滚动 <script language=VBScript> dim c,numgc c=-100000 numgc=document.body.sourceIndex sub SF c=c+1 Document.all(numgc).style.BackgroundPosition= "0 " & c id=SetTimeOut("SF",16,"VBScript") end sub SF </script> 8 鼠标经过时,文字就变色 <font face="arial" size=3 onmouseout="this.style.color = \'black\';">Welcome in Webdesigner</font> 9 如果想把以上滚动的文字变为超链接,也就是点击一下,就可以进入另一个网站, 方法是:“在上面文字前面加入<a href=http://www.cctv.com>代码,后面加入</a> 就可以了,但上面要链接的网址自行更改。 10 如果想在滚动的时候,鼠标放在文字上面,字就停止,方法是:在文字前面加入 <a onmouseover=stop() onmouseout=start()>文字的后面</a>
|