修改 totalSnow 和 dropHeight来改变雪花的数量和初始显示区域的高度。肯定可以优化,但我水平太滥,而且也不太清楚到底哪个方法节约资源,要是经典论坛的小狗和LexRus来了,肯定意见一大堆,:)
//2004-12-30 by guoshuang for snow in xi'an
totalSnow=40; //snow numbers
dropHeight=80;
oMode=5;
imgsrc="images/snowb.gif"
var oNodes;
function initSnow(){
//random config the property of snow image
document.getElementById("oSnow").innerHTML="";
for(i=0;i snowimg=document.createElement("img"); snowimg.src=imgsrc; snowimg.alt=""; snowimg.className="snowPosition"; snowimg.width=parseInt(Math.random()*28); snowimg.height=snowimg.width; snowimg.style.left=parseInt(Math.random()*document.body.clientWidth-28)+"px"; snowimg.style.top=parseInt(Math.random()*dropHeight)+"px"; document.getElementById("oSnow").appendChild(snowimg); } oNodes=document.getElementById("oSnow").childNodes; } function dropSnow(){ if(oNodes.length==0)return; for(j=0;j nowTop=oNodes[j].style.top; nowLeft=oNodes[j].style.left; nowTop=nowTop.substring(0,nowTop.length-2); nowLeft=nowLeft.substring(0,nowLeft.length-2); nowWidth=oNodes[j].clientWidth; oNodes[j].style.top=parseInt(nowTop)+2; //special show for random left right moving leftDistance=parseInt(Math.random()*3) oNodes[j].style.left=parseInt(nowLeft)-leftDistance; if(nowTop%oMode==0){ if(nowWidth<1){ //remove old node,append new one! document.getElementById("oSnow").removeChild(oNodes[j]); //new one snowimg=document.createElement("img"); snowimg.src=imgsrc; snowimg.alt=""; snowimg.className="snowPosition"; snowimg.width=parseInt(Math.random()*28); snowimg.height=snowimg.width; snowimg.style.left=parseInt(Math.random()*document.body.clientWidth-28)+"px"; snowimg.style.top=parseInt(Math.random()*dropHeight)+"px"; document.getElementById("oSnow").appendChild(snowimg); }else{ oNodes[j].style.width=nowWidth-1; oNodes[j].style.height=nowWidth-1; } } } } //init window.onload=function(){initSnow();setInterval(dropSnow,200)} window.onresize=function(){initSnow()} 简化版,只显示,不动,拖动窗口大小,图案变化 //2004-12-30 by guoshuang for snow in xi'an totalSnow=40; //snow numbers dropHeight=80; imgsrc="images/snowb.gif" var oNodes; function initSnow(){ //random config the property of snow image document.getElementById("oSnow").innerHTML=""; for(i=0;i snowimg=document.createElement("img"); snowimg.src=imgsrc; snowimg.alt=""; snowimg.className="snowPosition"; snowimg.width=parseInt(Math.random()*28); snowimg.height=snowimg.width; snowimg.style.left=parseInt(Math.random()*document.body.clientWidth-28)+"px"; snowimg.style.top=parseInt(Math.random()*dropHeight)+"px"; document.getElementById("oSnow").appendChild(snowimg); } oNodes=document.getElementById("oSnow").childNodes; } //init window.onresize=function(){initSnow()}
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
I m using revealTrans filter for layer effect. And I want to execute one function after transition is done.
How do I know that revealTrans is complete?
Here is the function that I m using for layer effect.
function goright()
{
eval(’image’+count).filters[0].Apply();
eval(’image’+count).style.visibility = “visible”;
eval(’image’+count).filters.revealTrans.transition=7;
eval(’image’+count).filters[0].Play();
}
ou can set the time of the transition by putting it in the Play parenthesis
revealTrans.Play(reveal time in seconds)
and then using setTimeout set to the same
setTimeout(”function()”,reveal time in seconds)
revealTrans.Play(2) // 2 seconds
setTimeout(”function()”,2000) // 2 seconds
You are aware that revealTran is IE only?

































应该是不渲染的缘故…
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
不是很理解,有些晕…


if(document.getElementById&&document.getElementsByTagName){
oimg=document.getElementById("example").getElementsByTagName("img")
for(i=0;i alert(i) oimg[i].onmouseover=function(){alert(i)} } }
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
hand : 竖起一只手指的手形光标。就像通常用户将光标移到超链接上时那样。可是 pointer 才是css2 的标准属性,压根就没有hand 这个东西。pointer : (IE6.0) 和 hand 一样。竖起一只手指的手形光标。就像通常用户将光标移到超链接上时那样。
ie 5估计不认识 pointer,所以还要判断 if(document.all)