div.className=”div”;
document.getElementById(“snowzone”).appendChild(div);
setTimeout(function(){
document.getElementById(“snowzone”).removeChild(div);
// console.log(window.innerHeight);
},5000);
}
setInterval(function(){
var left = Math.random()*window.innerWidth;
var height = Math.random()*window.innerHeight;
var src = “s”+Math.floor(Math.random()*2+1)+”.png”;//两张图片分别为”s1.png”、”s2.png”
snow(left,height,src);
},500);
})();
</script>
</html>
两张雪花图片:
最终效果: 










