⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 823text5.htm

📁 javascript各种效果的实例及源代码
💻 HTM
字号:
<html>
<head>
<title>文字从小变大</title>
<style type="text/css">
<!--
body {  font-family: "宋体"; font-size: 9pt; margin-top: 0px; margin-left: 0px; margin-right: 0px}
A { COLOR: black; FONT-SIZE: 9pt; FONT-WEIGHT: 400; TEXT-DECORATION: none }
 A:hover { COLOR: red; FONT-SIZE: 9pt; FONT-WEIGHT: 400; TEXT-DECORATION: underline }
a:active     { font: 9pt "宋体"; cursor: hand; color: #FF0033 }

-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor=#fef4d9 text=black onload="init()">
<br>
<center><font color=red face="隶书" size=6>文字从小变大</font></center>
<br>

<style type="text/css">
body
        {
        background-color:#fef4d9; 
        font-family: Arial; 
        font-size:10pt; 
        }


</style>

<script>


        text=new Array('www','njcatv','net','南京有线宽带网')

        var numText=4

        color=new Array('#000000','#2F2F2F','#4F4F4F','#7F7F7F','#408080')

        var numColors=5

        var endSize=70

        var Zspeed=30

        var Cspeed=200

        var font='Arial Black'

        var hide=false

var size=10

var gonum=0

var ie, n;

if (document.all) {

                n=0

                ie=1

                zoomText='document.all.zoom.innerText=text[num]'

                zoomSize='document.all.zoom.style.fontSize=size'

                closeIt=""

                fadeColor="document.all.zoom.style.color=color[num]"

        }

if (document.layers) {

                n=1;ie=0

                zoomText=""

                zoomSize="document.zoom.document.write('<p align=\"center\" style=\"font-family:'+font+'; font-size:'+size+'px; color:'+color[0]+'\">'+text[num]+'</p>')"

                closeIt="document.zoom.document.close()"

                fadeColor="document.zoom.document.write('<p align=\"center\" style=\"font-family:'+font+'; font-size:'+endSize+'px; color:'+color[num]+'\">'+text[numText-1]+'</p>')"

        }


function zoom(num,fn){

        if (size<endSize){

                eval(zoomText)

                eval(zoomSize)

                eval(closeIt)

                size+=5;

                setTimeout("zoom("+num+",'"+fn+"')",Zspeed)

        }else{

                eval(fn);

        }

}


function fadeIt(num){

        if (num<numColors){

                eval(fadeColor)

                eval(closeIt)

                num+=1;

                setTimeout("fadeIt("+num+")",Cspeed)

        }else{

                hideIt()

        }

}


function hideIt(){

        if(hide){

                if(ie)document.all.zoom.style.visibility="hidden"

                if(n)document.layers.zoom.visibility="hidden"

        }

}


function init(){

        if(ie){

                document.all.zoom.style.color=color[0]

                document.all.zoom.style.fontFamily=font

        }

        if(ie || n) go(0)       

}

function go(num){

        gonum+=1

        size=10

        if(num<numText){

                zoom(num,'go('+gonum+')')

        }else{

                fadeIt(0)

        }

}

</script>
<div id="zoom" align="center" style="position:absolute; top:150">
</DIV>



<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>



<center>
<textarea name=source rows=12 cols=45 class=yk9>
脚本说明:
第一步:把如下代码加入<body>区域中
<style type="text/css">
body
        {
        background-color:#FFFFFF; 
        font-family: Arial; 
        font-size:10pt; 
        }


</style>

<script>


        text=new Array('www','njcatv','net','南京有线宽带网')

        var numText=4

        color=new Array('#000000','#2F2F2F','#4F4F4F','#7F7F7F','#408080')

        var numColors=5

        var endSize=70

        var Zspeed=30

        var Cspeed=200

        var font='Arial Black'

        var hide=false

var size=10

var gonum=0

var ie, n;

if (document.all) {

                n=0

                ie=1

                zoomText='document.all.zoom.innerText=text[num]'

                zoomSize='document.all.zoom.style.fontSize=size'

                closeIt=""

                fadeColor="document.all.zoom.style.color=color[num]"

        }

if (document.layers) {

                n=1;ie=0

                zoomText=""

                zoomSize="document.zoom.document.write('<p align=\"center\" style=\"font-family:'+font+'; font-size:'+size+'px; color:'+color[0]+'\">'+text[num]+'</p>')"

                closeIt="document.zoom.document.close()"

                fadeColor="document.zoom.document.write('<p align=\"center\" style=\"font-family:'+font+'; font-size:'+endSize+'px; color:'+color[num]+'\">'+text[numText-1]+'</p>')"

        }


function zoom(num,fn){

        if (size<endSize){

                eval(zoomText)

                eval(zoomSize)

                eval(closeIt)

                size+=5;

                setTimeout("zoom("+num+",'"+fn+"')",Zspeed)

        }else{

                eval(fn);

        }

}


function fadeIt(num){

        if (num<numColors){

                eval(fadeColor)

                eval(closeIt)

                num+=1;

                setTimeout("fadeIt("+num+")",Cspeed)

        }else{

                hideIt()

        }

}


function hideIt(){

        if(hide){

                if(ie)document.all.zoom.style.visibility="hidden"

                if(n)document.layers.zoom.visibility="hidden"

        }

}


function init(){

        if(ie){

                document.all.zoom.style.color=color[0]

                document.all.zoom.style.fontFamily=font

        }

        if(ie || n) go(0)       

}

function go(num){

        gonum+=1

        size=10

        if(num<numText){

                zoom(num,'go('+gonum+')')

        }else{

                fadeIt(0)

        }

}

</script>
<div id="zoom" align="center" style="position:absolute; top:150">
</textarea>


第二步:把如下代码加入<body>区域中
<body bgcolor="#fef4d9" onload="init()">
</textarea>
<SCRIPT LANGUAGE="JavaScript">

<!-- hide

function goHist(a) 

{

   history.go(a);

}

//-->

</script>

<FORM METHOD="post">
<INPUT TYPE="button" VALUE="返回" onClick="goHist(-1)" style="background-color: #8000FF; color: rgb(255,255,255)">
</form>
</center>
<br>
<br>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -