这个效果应该是你需要的
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://wenwen.soso.com/z/UrlAlertPage.e?sp=Shttp%3A%2F%2Fwww.w3.org%2FTR%2Fxhtml1%2FDTD%2Fxhtml1-transitional.dtd%22%3E
<html xmlns=" http://wenwen.soso.com/z/UrlAlertPage.e?sp=Shttp%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%3E
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
body {
background-color: #000000;
}
-->
</style></head>
<body>
<script language="javascript">
var str="请在这里放置需要旋转的文字内容,文字旋转,文字旋转";
var s="";
var a=new Array("#6699CC","#FFFF00","#CC0000","#FF80C0","#8080FF","#FFCC00","#CC0000","#66FF00");
var j=0;
for (var i=0;i<str.length;i++){
if (str.charAt(i)=="*"){j=j+1}
s=s+'<DIV id=Circle'+i+' style="COLOR: '+a[j]+'; FONT: bold 11pt arial; POSITION: absolute;visibility:hidden;"><P><FONT size=4>'+str.charAt(i)+'</FONT></P></DIV>'
if (str.charAt(i)=="*"){j=j+1}
}
document.write(s);
var Pos=new Array();
var Radius = 160; //半径
var Pi = Math.PI;
var Inc = Pi/180;
function showfont(){
Pos[0] = 0;
for(i=1;i<str.length;i++) Pos[i] = eval(parseFloat(Pos[i-1] + ((2*Pi)/str.length)));
cycle();
}
function cycle(){
for(i=0;i<Pos.length;i++)
{
Pos[i] = Pos[i] + Inc;
var pp="document.all."+"Circle"+i+".style";
eval(pp).left = Radius*Math.cos(Pos[i]) + document.documentElement.offsetWidth/2-10;
eval(pp).top = Radius*Math.sin(Pos[i]) + document.documentElement.offsetHeight/2-10;
eval(pp).visibility="visible";
}
setTimeout("cycle()",10)
}
showfont();
</script>
</body>
</html>
<MARQUEE direction=up onmouseout=start(); onmouseover=stop(); scrollAmount=1 scrollDelay=15 width=160 height="100px">插入你要输入的文字</MARQUEE>
<marquee direction=left>从右向左移!</marquee><p>
<marquee direction=right>从左向右移!</marquee><p>
<marquee behavior=scroll>一圈一圈绕着走!</marquee><p>
<marquee behavior=slide>只走一次就歇了!</marquee><p>
<marquee behavior=alternate>来回走!</marquee><p>
<marquee loop=3 width=50% behavior=scroll>只走 3 趟</marquee><p>
<marquee loop=3 width=50% behavior=slide>只走 3 趟!</marquee><p>
<marquee loop=3 width=50% behavior=alternate>只走 3 趟!</marquee><p>
<marquee scrollamount=20>走得好快哟!</marquee>
文字滚动代码 (从右向左滚动)
<marquee width="157" height="21">要滚动的文字</marquee>
文字滚动代码 (从下往上滚动)
<marquee bgcolor=#ffffff class=p4 direction=up height=60 scrollamount=1 scrolldelay=50 style="COLOR: #000000; class: " width=157 text-align: left? border="0" ;>要滚动的文字</marquee>
图片滚动代码 (从右向左滚动)
<marquee scrollamount=1 scrolldelay=3 valign=middle behavior="scroll">
<img border="0" src=" http://要滚动的图片地址1">
<img border="0" src=" http://要滚动的图片地址2">
</marquee>
图片滚动代码 (从下往上滚动)
<marquee onMouseOver="this.stop()" onMouseOut="this.start()" align=center direction=up scrollamount=1 scrolldelay=3 valign=middle behavior="scroll">
<img border="0" src=" http://要滚动的图片地址1">
<img border="0" src=" http://要滚动的图片地址2">
</marquee>
输入几个文字,以一个原点转圈有法不
那是特效,你可以上网搜搜,之前我没有做过类似的,
用HTML的Marquee了,目前多数浏览器已经支持这个元素了!!
<marquee align="…"
behavior="…"
bgcolor="…"
direction="…"
height="…"
width="…"
hspace="…"
vspace="…"
loop="…"
scrollamount="…"
scrolldelay="…"
>…</marquee>
align: 对齐方式 LEFT,CENTER,RIGHT,TOP,BOTTOM (不用多说了)
behavior: 用于设定滚动的方式,主要由三种方式:
behavior="scroll": 表示由一端滚动到另一端;
behavior="slide": 表示由一端快速滑动到另一端,且不再重复;
behavior="alternate" : 默认值——表示在两端之间来回滚动。
direction: left(默认值) 左; right 右;up 上;down 下;
bgcolor: 背景颜色
height: 高度
weight: 宽度
Hspace/vspace: 分别用于设定滚动字幕的左右边框和上下边框的宽度。作用大概和css中的margin差不多
scrollamount: 用于设定每个连续滚动文本后面的间隔,该间隔用像素表示,以上是官方说法,其实就是滚动的速度,值不能太大,要不从视觉角度来说,是没反应的.值越大速度越快,反之越慢。
scrolldelay: 延迟时间
loop: 这个属性大家也很熟悉,循环次数;loop=-1的时候一直重复循环(默认值)
还有两个事件,
this.start() 与this.stop() 停止与开始。
基本使用:
<marquee onmouseover="this.stop();" onmouseout="this.start();">移动文字!</marquee>
向上移动:
<marquee direction=up>向上移动</marquee>
来回移动:
<marquee direction=left behavior=alternate>我来回走!</marquee>
只走一次:
<marquee direction=left behavior=slide>我只走一次!</marquee>
只走三次:
<marquee loop=3>我只走三次哦</marquee>
快速移动:
<marquee scrollamount=25>看,我走多快!</marquee>
走走停停:
<marquee scrolldelay=1000>我走一走,停一停</marquee>
设置背景:
<marquee bgcolor=blue>有底色!</marquee>
宽度与高度:
<marquee width=200 height=200 bgcolor=pink direction=down>这个面积不够我移动!</marquee>
你还可以设置其它的一些参数来看看效果!
下面还有牛人做的嵌套的:
<table>
<tr>
<td bgcolor=#cc3300 width=468>
<marquee direction="down" behavior="alternate" scrollamount=1 height="60">
<marquee direction="right" behavior="alternate" scrollamount=4 width="468">
我被墙撞回@_@!
</marquee>
</marquee>
</td>
</tr>
</table>
还有:
<table bgcolor="#EFEFEF">
<tr><td width="1" valign="top" >
<marquee direction="down" behavior="alternate" scrollamount=1 height="60">
<marquee direction="right" scrollamount=4 behavior="alternate" width="468">
≮『 屏幕上的代码 』≯
</marquee>
</marquee>
</td>
<td width="468">
<marquee direction="up" behavior="alternate" scrollamount=1 height="60">
<marquee direction="left" scrollamount=4 behavior="alternate" width="468">
体验编写代码的乐趣 Ξ 研究更深入的技术
</marquee>
</marquee>
</td></tr></table>
只是这种嵌套用法有很多争议,并不实用。
联系客服