frontpage特效代码-s利用这些代码可生成你想要的动画

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

位置: <body>与</body>之间插入代码
一、在网页源代码中加入下面的代码,则该窗口将在20秒钟之后自动关闭!这与跳出式小窗口配合使用是再好不过啦!代码中“i=20”表示关闭的延迟时间为20秒,可任意修改。

<script language="javascript">
<!--
function clock(){i=i-1
document.title="本窗口将在"+i+"秒后自动关闭!";
if(i>0)setTimeout("clock();",1000);
else self.close();}
var i=20
clock();
//-->
</script>
二、让文字跟心脏一样跳动,扑咚、扑咚……
<style>
<!--
#glowtext{
filter:glow(color=ff0000,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="2">你的心是不是跟这一样跳?</font></span>
三、跟随鼠标的漂亮星星
<SCRIPT language=JavaScript>
<!--
if (document.all){
//To add more stars simply add more colours in below array!!
colours=new Array('ff0000','00ff00','3366ff','ff00ff','ffa500','ff ffff','fff000')
//Alter nothing below!!
amount=colours.length;
YgetDelay=0,XgetDelay=0,Ydelay=0,Xdelay=0,step=0.2,currStep=0,my=0, mx=0;
document.write('<div id="ie" style="position:absolute;top:0;left:0; "><div style="position:relative">');
for (i=0; i < amount; i++)
document.write('<div id="iestars" style="position:absolute;top:0px; left:0px;height:50px;width:50px;font-family:Courier New;font-size:5px; color:'+colours[i]+';padding-top:20px;text-align:center">.</div>');
document.write('</div></div>');
ini=1;
gstep=1;
function iMouse(){
my=event.y;mx=event.x;
}
document.onmousemove=iMouse
function dim(){
ini-=gstep;
dt=setTimeout('dim()',10);
if (ini < 2){
clearTimeout(dt);
glow();
}
}
function glow(){
ini+=gstep;
gt=setTimeout('glow()',10);
if (ini > 14){
clearTimeout(gt);
dim();
}
}
function stars(){
ie.style.top=document.body.scrollTop; for (i=0; i < amount; i++)
{
var layer=iestars[i].style;
layer.filter='glow(color='+colours[i]+', strength='+ini+')';
layer.top= Ydelay+100*Math.sin((5*Math.sin((currStep-15.99)/10))+ i*70)*Math.sin((currStep)/10)*Math.cos((currStep+i*25)/10);
layer.left=Xdelay+180*Math.cos((5*Math.sin((currStep-15.99)/10))+ i*70)*Math.sin((currStep)/10)*Math.cos((currStep+i*25)/10);
}
currStep+=step;
}
function delay(){
Ydelay = YgetDelay+=(my-YgetDelay)*1/20;
Xdelay = XgetDelay+=(mx-XgetDelay)*1/20;
stars();
setTimeout('delay()',10);
}
delay();
glow();
}
//-->
</SCRIPT>
四、让屏幕抖动一阵
<input onclick="www_helpor_net(2)" type="button" value="地震啦!!!">
<script language="JavaScript">
<!--
function surfto(form) {
var myindex=form.select1.selectedIndex
if (form.select1.options[myindex].value != null) {
parent.main.location.href=form.select1.options[myindex].value; }
}
// -->
</script>
<script language="JavaScript1.2">
<!--
function www_helpor_net(n) {
if (window.top.moveBy) {
for (i = 10; i > 0; i--) {
for (j = n; j > 0; j--) {
window.top.moveBy(0,i);
window.top.moveBy(i,0);
window.top.moveBy(0,-i);
window.top.moveBy(-i,0);
}
}
}
alert(" 没吓坏吧!!! ");
}
// -->
</script>
五、特殊效果的按钮
<style type="text/css">
<!--
.over {color:yellow; background: navy}
.down {color:yellow; background: navy; font-style: italic}
-->
</style>
<input
type="Button" value="按钮也疯狂" name="Button"
onMouseOver="this.className='over';"
onMouseOut="this.className='';this.value='按钮也疯狂'"
onMouseDown="this.className='down';"
onMouseUp="this.className='over';"
onClick="this.value='我真的好喜欢你!'">
六、文本自动向上循环滚动,鼠标放到上面还会暂时停下来。

<table border="1" bordercolor="#000000" bgcolor="#6699ff" cellpadd ing="5" cellspacing="0">
<tr>
<td>
<script language=javascript>
document.write ("<marquee scrollamount='1' scrolldelay='30' direct ion= 'UP' width='200' id='helpor_net' height='150' onmouseover='helpo r_net.stop()' onmouseout='helpor_net.start()' Author:redriver; For mo re,visit:>")
document.write ("<h2><p align='center'><font color='#ffffff' face= '黑体'>偶然</font></h2>")
document.write ("<p align='right'><a href='#' target='_blank'><fon t color='#ffffff'>徐志摩</font></a> ")
document.write ("<p><font color='#ffffff'> ")
document.write ("<br>我是天空里的一片云,")
document.write ("<br>偶尔投影在你的波心—— ")
document.write ("<br>你不必讶异, ")
document.write ("<br>更无须欢喜—— ")
document.write ("<br>在转瞬间消灭了踪影。

")
document.write ("<br>")
document.write ("<br>你我相逢在黑暗的海上,")
document.write ("<br>你有你的,我有我的,方向;")
document.write ("<br>你记得也好, ")
document.write ("<br>最好你忘掉, ")
document.write ("<br>在这交会时互放的光亮! ")
document.write ("</font>")
document.write ("</marquee> ")
</script> </td>
</tr>
</table>。

相关文档
最新文档