文字快速弹出并切换显示效果

4个月前 (05-10 15:04)阅读回复0
大陆
大陆
  • 管理员
  • 发消息
  • 注册排名1
  • 经验值5294
  • 级别管理员
  • 主题1058
  • 回复2
楼主

js实现整段文字逐个弹出显示,弹出过程快速切换显示,可根据您自己网站的需求来自定义文字或修改切换速度即可。

<a href="https://www.wuming.ren">武鸣人</a>,各种信息资源免费发布,分享励志语录经典短句,减肥健身常识,各种js特效代码。网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)<hr>
<!--欢迎来到武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢,分享互联网流行的励志语录经典短句,减肥健身健康小常识及打卡记录,收集各种js特效代码。-->
<script type="text/javascript" src="https://www.wuming.ren/ad/tc.js"></script>
<script type="text/javascript" src="https://www.wuming.ren/ad/a.js"></script>
<script>
<!--
newAuto = new Array();
newAuto[0]=" 武鸣人,www.wuming.ren。各种信息免费发布,资源共享合作共赢! "
newAuto[1]="欢迎来到武鸣人,各种信息资源平台,各种信息免费发布,资源共享合作共赢。本站域名<a href=\"https://www.wuming.ren\">www.wuming.ren</a>"
topOffset="50";
leftOffset="10";
Width="750";
Align="left";
fontSize="2";
fontFace="Verdana";
fontColor="black";
typingSpeed=1;
pause=2000;
// Do NOT edit below this line.
if (document.getElementById)
document.write('<DIV ID="animText" STYLE="position:absolute;width:'+Width+'px;top:'+topOffset+';left:'+leftOffset+';" ALIGN="'+Align+'"></DIV>')
else
document.write('<LAYER NAME="animText" WIDTH="'+Width+'" TOP="'+topOffset+'" LEFT="'+leftOffset+'"></LAYER>')
aat1=-1;
aat2=0;
aat3=0;
t3=""
function autoanimText(number, which) {
text=newAuto[number]
thenum=number
if (which=="begin") {
if (aat1<text.length) {
aat1++;
t1=text.substring(aat1, aat1+1)
if (t1=="<") {
aat3+=1
t2=text.indexOf(">",aat3);
t3=text.substring(aat1,t2+1)
if (t3.length==4) {t3=""}
aat3=t2+1
aat1=aat3}
begin='<DIV ALIGN="'+Align+'"><FONT SIZE="'+fontSize+'" FACE="'+fontFace+'" COLOR="'+fontColor+'">'
text2=text.substring(0, aat1+1);
if (t3>"") {
t5=t3.indexOf(' ',0)
t4=t3.substring(1,t5)
text2+="</"+t4+">"}
if (document.getElementById) {
document.getElementById("animText").innerHTML=begin+text2+'</FONT></DIV>'}
if (document.layers) {
document.layers["animText"].document.write(begin+text2+'</FONT></DIV>');
document.layers["animText"].document.close();}
autoanimateText = setTimeout('autoanimText(thenum, "begin")', typingSpeed);}
else {aat1=-1;aat3=-1;clearInterval(autoanimateText);setTimeout('autoanimText(thenum, "end")', pause);}}
else if (which=="end") {
if (aat1<text.length) {
aat1++;
t1=text.substring(aat1, aat1+1)
if (t1=="<") {
aat3+=1
t2=text.indexOf(">",aat3);
t3=text.substring(aat1,t2+1)
if (t3.length==4) {t3=""}
aat3=t2+1
aat1=aat3}
begin='<DIV ALIGN="'+Align+'"><FONT SIZE="'+fontSize+'" FACE="'+fontFace+'" COLOR="'+fontColor+'"><SPAN STYLE="position:relative;visibility:hidden">'
text2=text.substring(0, aat1)
text3=text.substring(aat1, text.length);
if (t3>"") {
t5=t3.indexOf(' ',0)
t4=t3.substring(1,t5)
text2+="</"+t4+">"}
if (document.getElementById) {
document.getElementById("animText").innerHTML=begin+text2+'</SPAN>'+t3+text3+'</FONT></DIV>'}
if (document.layers) {
document.layers["animText"].document.write(begin+text2+'</SPAN>'+t3+text3+'</FONT></DIV>');
document.layers["animText"].document.close();}
autoanimateText = setTimeout('autoanimText(thenum, "end")', (typingSpeed/2));
}//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
else {aat1=-1;aat3=0;aat2++;clearInterval(autoanimateText);setTimeout('autoanimText((aat2)%newAuto.length, "begin")', 50);}}}
function startAAT3() {
if (document.getElementById) {
document.getElementById("animText").innerHTML='<SPAN STYLE="position:relative;visibility:hidden">'+newAuto[0]+'</SPAN>'}
if (document.layers) {
document.layers["animText"].document
.write('<SPAN STYLE="position:relative;visibility:hidden">'+newAuto[0]+'</SPAN>');
document.layers["animText"].document.close();}
autoanimText(0,'begin')}
window.onload=startAAT3
//-->
</script>


0
0
收藏0

本文来自武鸣人网站,转载请注明出处

本文地址:https://www.wuming.ren/a/950.html

回帖

文字快速弹出并切换显示效果 期待您的回复!

取消
载入表情清单……
载入颜色清单……
插入网络图片

取消确定

图片上传中
编辑器信息
提示信息