http://expert.csdn.net/Expert/topic/1590/1590214.xml?temp=.8429376
回答者可在此领取更多分。致谢!
回答者可在此领取更多分。致谢!
解决方案 »
- document.body.clientWidth document.body.offsetWidth 和 document.body.scrollHeight
- onscroll事件
- DIV+CSS网站对SEO的影响
- 在编辑器中插入你上传的图片?
- option选择问题
- 求助:如何判断当前页面窗口关闭动作
- jstree里的数据怎么保存到数据库
- (求教高手)关闭弹出窗口时提交
- 有谁告诉我在js中document.form.elements.---和window.form.element--有何不同吗?
- 求助,如何实现javascript的打印控制??
- 关于从ACCESS到SQL2000转换中的问题,在线等!真正解决者送500分!
- 如何一次点击就打开或关闭所有的<tr>部分?有样例,请帮助一下!谢谢!
就是这样的代码:脚本说明:
第一步:把如下代码加入<body>区域中
<STYLE>
DIV {width: 609; font-size: 40pt; font-family: Tahoma;font-weight: bold;}
</STYLE>
<SCRIPT LANGUAGE="JavaScript">
var count=0; var thePhase=0; var aniOn=0;
var theStrength=0;var maxCount=40;var maxStrength=100;var theCount=0;
var colorList=new Array("red", "blue", "green");
var oDiv=null;
var oQueue=new Array();
function doStart(obj)
{
oDiv=obj;
oQueue.push("Welcome to jzzy");
oQueue.push("Please stay here");
oQueue.push("I love you");
if(obj==null)return;
if(!oQueue.length)return;
oDiv.innerHTML=oQueue.shift();
var ctrlRng=document.body.createControlRange()
ctrlRng.add(oDiv)
ctrlRng.select();
ctrlRng.execCommand("SelectAll")
theCount=0;
doFilt();
}function getStrength(pos)
{
var ret=0
if(pos<maxCount)
{
ret=maxStrength*pos*pos/(maxCount*maxCount);
}
else if(pos==maxCount)
{
strNext=oQueue.shift()
oDiv.innerHTML=strNext;
rndNum=Math.floor(Math.random() * 3)
oDiv.style.filter+="glow(color=" + colorList[rndNum] + ", strength=5)"
ret=maxStrength;
}
else if(pos<2*maxCount)
{
pos=2*maxCount-pos;
ret=maxStrength*pos*pos/(maxCount*maxCount);
}
else
ret=0;
ret=Math.ceil(ret)
return ret;
}function anitext(){
thePhase=(thePhase + 10)
oDiv.filters[0].phase=thePhase
theStrength=getStrength(++theCount);
window.status=theStrength
if(theStrength==0)theCount=0; if(oQueue.length>0 || theStrength>0)
{
oDiv.filters[0].strength=theStrength;
oTO=window.setTimeout("anitext()",0200,"JavaScript")
}
}function doFilt(){
oDiv.style.filter="wave(add=0, freq=3, lightstrength=50, phase=0, strength=2, enabled=1); "
rndNum=Math.floor(Math.random() * 3)
oDiv.style.filter+="glow(color=" + colorList[rndNum] + ", strength=5)"
anitext()
}function removeFilt(){
window.clearTimeout(oTO)
oDiv.style.filter=" "
}function arrPush(item)
{
this[this.length]=item;
}function arrShift()
{
var item=this[0];
var nLen=this.length;
for(var i=0;i<nLen-1;i++)
this[i]=this[i+1];
this.length--;
return item;
}Array.prototype.push=arrPush;
Array.prototype.shift=arrShift;</SCRIPT>
<DIV ID="MyDiv" align="center">
</DIV>第二步:把<body>中的内容改为:
<body onload="doStart(MyDiv)">
//刷新间隔时间为3秒
var limit="0:03";
if (document.images){
var parselimit=limit.split(":");
parselimit=parselimit[0]*60+parselimit[1]*1;
}
function beginrefresh(){
if (!document.images)
return;
if (parselimit==1) {
doStart(MyDiv);
}else{
parselimit-=1;
setTimeout("beginrefresh()",1000);
}
}
this.window.onload=beginrefresh
</SCRIPT>
function anitext(){
thePhase=(thePhase + 10)
oDiv.filters[0].phase=thePhase
theStrength=getStrength(++theCount);
window.status=theStrength
if(theStrength==0)theCount=0; if(oQueue.length>0 || theStrength>0)
{
oDiv.filters[0].strength=theStrength;
}
else
{theStrength=0
//看到了吗?这里!一定要在写一次!
oQueue.push("Welcome to jzzy");
oQueue.push("Please stay here");
oQueue.push("I love you");}
oTO=window.setTimeout("anitext()",0200,"JavaScript")
}
oQueue.push("Welcome to jzzy");
oQueue.push("Please stay here");
oQueue.push("I love you");
是否会不断占用内存?这有点象C里不断动态分配内存。
另外请到http://expert.csdn.net/Expert/topic/1590/1590214.xml?temp=.8429376
签名领取一些分,不过是java版。