船长 发表于 2009-03-02 11:22 | 分类:javascript | 阅读数:451 次
标题飘动效果,标题从左侧飞出来,类似于marquee的效果,运行代码查看吧
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title> New Document </title> </head> <body> <script> //set style for NS4 to '' if (document.layers) var ns4def='' </script> <h2 id="flyin" style="position:relative;left:-800px;font-style:italic" style=&{ns4def};>Welcome to our Homepage!</h2> <script language="JavaScript1.2"> if (document.getElementById||document.all) var crossheader=document.getElementById? document.getElementById("flyin").style : document.all.flyin.style function animatein(){ if (parseInt(crossheader.left)<0) crossheader.left=parseInt(crossheader.left)+20+"px" else{ crossheader.left=0 crossheader.fontStyle="normal" clearInterval(start) } } if (document.getElementById||document.all) start=setInterval("animatein()",50) </script> </body> </html>
提示:你可以先修改部分代码再运行。
您的网名: * 必填
电子邮件: * 绝不会泄露
个人主页:
评论内容:
(Ctrl+Enter快捷回复)
web集结号致力于