·您的位置: 首页 » 资源教程 » 编程开发 » JavaScript » 61、渐县显播放文字

61、渐县显播放文字

类别: JavaScript教程  评论数:0 总得分:0
====1、将以下代码加入HEML的<HEAD></HEAD>之间

<style type= "text/css">
<!--
#fadeMe01 { position: absolute; visibility: visible; width: 400px }
#fadeMe02 { position: absolute; visibility: visible; width: 400px }
.content { font: 16pt Verdana, Arial, Helvetica; width: 400px; text-align: center }
.content1 { font: 16pt Verdana, Arial, Helvetica; width: 400px; text-align: center }
.small { font: 6pt Verdana, Arial, Helvetica; width: 400px; text-align: center }
b { font-weight: bold }
a { text-decoration : none }
// -->
</style>
<script type="text/javascript" language="javascript">
<!--
/* Begin HIGHLIGHT */
var convert = new Array();
var hexbase = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F");
var value=0;
var rgb;
for (x=0; x<16; x++) {
for (y=0; y<16; y++) {
convert[value] = hexbase[x] + hexbase[y];
value++;
}
}
var timerID = null, timerRunning = false;
function stopClock(){
if(timerRunning)
clearTimeout(timerID)
timerRunning = false
}
var layers = document.layers;
var style = document.all;
var both = layers || style;
if (layers) { layerRef = \'document.layers\'; styleRef = \'\'; }
if (style) { layerRef = \'document.all\'; styleRef = \'.style\'; }
function moveLayer(obj, topx, leftx) {
if (both) {
eval(layerRef + \'["\'+obj+\'"]\' + styleRef + \'.top = topx\');
eval(layerRef + \'["\'+obj+\'"]\' + styleRef + \'.left = leftx\');
}
}
var s1, s2, s3, s2r, s2g, s2b, smallest;
function hexToDec(hex) { var value=0; while (true) { if (convert[value] == hex) break; value++; } return value; }
function changeColor(obj, str, rgb1, speed, counter) {
if (counter < smallest) {
stopClock();
if (layers) with (document[obj]) { document.open(); document.linkColor = rgb1; document.fgColor = rgb1; document.write(str); document.close(); }
if (style) { eval(obj+\'.document.linkColor= rgb1\'); eval(obj+\'.innerHTML= "<font color="+rgb1+">"+str+"</font>"\'); }
s2r+=s1; s2g+=s2; s2b+=s3;
tempR = Math.round(s2r); tempG = Math.round(s2g); tempB = Math.round(s2b);
if (tempR <= 0) tempR = 0; if (tempG <= 0) tempG = 0; if (tempB <= 0) tempB = 0;
if (tempR >= 255) tempR = 255; if (tempG >= 255) tempG = 255; if (tempB >= 255) tempB = 255;
rgb1 = convert[tempR] + convert[tempG] + convert[tempB];
counter++;
timerID = setTimeout(\'changeColor(" \'+obj+\'", "\'+str+\'", "\'+rgb1+\'", \'+speed+\', \'+counter+\')\', speed);
timerRunning = true;
}
}
function fadeText(obj, str, rgb1, rgb2, speed, step) {
var r1, g1, b1, r2, g2, b2;
for (cnt=1; cnt<=2; cnt++) {
eval(\'r\'+cnt+\' = hexToDec(rgb\'+cnt+\'.slice(0,2));\');
eval(\'g\'+cnt+\' = hexToDec(rgb\'+cnt+\'.slice(2,4));\');
eval(\'b\'+cnt+\' = hexToDec(rgb\'+cnt+\'.slice(4,6));\');
}
with (Math) {
s2r = r1; s2g = g1; s2b = b1;
s1 = abs(r1 - r2); s2 = abs(g1 - g2); s3 = abs(b1 - b2);
if (s1 > s2 && s1 > s3) { smallest = s1; } else if (s2 > s1 && s2 > s3) { smallest = s2; } else { smallest = s3; }
s1 = (s1 == 0) ? 0 : s1/smallest; s2 = (s2 == 0) ? 0 : s2/smallest; s3 = (s3 == 0) ? 0 : s3/smallest;
s1*=step; s2*=step; s3*=step;
if (r1 > r2) { s1 = -s1; } if (g1 > g2) { s2 = -s2; } if (b1 > b2) { s3 = -s3; }
smallest= Math.round(smallest/step);
}
changeColor(obj, str, rgb1, speed, 0);
}
/* END HIGHLIGHT */
function getMid() { tvAgent = navigator.userAgent; if (layers) { maxX = innerWidth; maxY = innerHeight; } if (style) { maxX = document.body.clientWidth; maxY = document.body.clientHeight; } if (tvAgent.indexOf("WebTV") != -1) { maxX = 544; maxY = 378; } midX = maxX/2; midY = maxY/2; }
function layout() { getMid(); moveLayer(\'fadeMe01\', midY-50, midX-200);
/* fadeText SYNTAX
*
*fadeText(layerName, message, startFade(RRGGBB), endFade(RRGGBB), speed, step);
*
*/
fadeText("fadeMe01", "<span class=content><b><a href=mailto:qdjacky@163.net>my E-mail</a></b> Dream Workroom</span><div class=small>welcome to my homepage</div>", "000000", "CCCCCC", 10, 2);setTimeout(\'fadeText("fadeMe01", "<span class=content><b>Information</b> Communication</span><div class=small>Dynamic Html Studio</div>", "CCCCCC", "000000", 10, 4)\',8000);
setTimeout(\'fadeText("fadeMe01", "<div class=small></div><span class=content><b>Web Master :</b> James Lee</span>", "000000", "CCCCFF", 10, 2)\',12000);
setTimeout(\'fadeText("fadeMe01", "<div class=small></div><span class=content><b><a href=mailto:beyondbey@163.net?subject=About%20Flash%20Intro>Web Master :</a></b> James Lee</span>", "CCCCFF", "000000", 10, 4)\',20000);
setTimeout(\'moveLayer("fadeMe01", midY-100, midX-200)\',24000);
setTimeout(\'moveLayer("fadeMe02", midY-60, midX-200)\',24000);
setTimeout(\'fadeText("fadeMe01", "<span class=content><b>I will show you something</b></span>", "000000", "CCCCFF", 10, 4)\',26000);
setTimeout(\'fadeText("fadeMe02", "<span class=content>Animation GIF , Photo , and Java</span>", "000000", "9999FF", 10, 4)\',32000);
setTimeout(\'fadeText("fadeMe01", "<span class=content><b>I will show you something</b></span>", "CCCCFF", "FF99FF", 10, 4)\',36000);
setTimeout(\'fadeText("fadeMe02", "<span class=content>Animation GIF , Photo , and Java</span>", "9999FF", "99FF33", 10, 4)\',40000);
setTimeout(\'fadeText("fadeMe02", "<span class=content>Animation GIF , Photo , and Java</span>", "99FF33", "CCCCCC", 10, 4)\',44000);
setTimeout(\'fadeText("fadeMe02", "<span class=content>Animation GIF , Photo , and Java</span>", "CCCCCC", "000000", 10, 4)\',48000);
setTimeout(\'fadeText("fadeMe01", "<span class=content><b>I will show you something</b></div>", "CCCCCC", "000000", 10, 4)\',57500);
setTimeout(\'fadeText("fadeMe01", "<span class=content><b>I will show you something</b></div>", "CCCCCC", "000000", 10, 4)\',57500);
}
// --></script>

====2、将以下代码加入HEML的<BODY></BODY>之间

<body BGCOLOR="#000000" text="#CCCCCC" link="#FFFFFF" vlink="#FFFFFF" onload="layout()">
<p align="right"> </p><p align="right"> </p><p align="right"> </p><p align="right"> </p><p align="right"> </p><p align="right"> </p><p align="right"> </p>
<div id="fadeMe01" style="left: 11px"></div><div id="fadeMe02"></div>
-= 资 源 教 程 =-
文 章 搜 索
关键词:
类型:
范围:
纯粹空间 softpure.com
Copyright © 2006-2008 暖阳制作 版权所有
QQ: 15242663 (拒绝闲聊)  Email: faisun@sina.com
 纯粹空间 - 韩国酷站|酷站欣赏|教程大全|资源下载|免费博客|美女壁纸|设计素材|技术论坛   Valid XHTML 1.0 Transitional
百度搜索 谷歌搜索 Alexa搜索 | 粤ICP备19116064号-1