| web | Дата: Понедельник, 2009-01-26, 6:58 PM | Сообщение # 1 |
|
Admin
Группа: Администраторы
Сообщений: 26
Репутация: 0
Статус: Offline
| Скрипт падающего снега: Code <script language="JavaScript1.2"> var snowsrc="snow3.gif" var no = 10;
var ns4up = (document.layers) ? 1 : 0; var ie4up = (document.all) ? 1 : 0; var ns6up = (document.getElementById&&!document.all) ? 1 : 0;
var dx, xp, yp; var am, stx, sty; var i, doc_width = 200, doc_height = 200;
if (ns4up||ns6up) { doc_width = self.innerWidth; doc_height = self.innerHeight; } else if (ie4up) { doc_width = document.body.clientWidth; doc_height = document.body.clientHeight; }
dx = new Array(); xp = new Array(); yp = new Array(); am = new Array(); stx = new Array(); sty = new Array();
for (i = 0; i < no; ++ i) { dx[i] = 0; // set coordinate variables xp[i] = Math.random()*(doc_width-50); // set position variables yp[i] = Math.random()*doc_height; am[i] = Math.random()*20; // set amplitude variables stx[i] = 0.02 + Math.random()/10; // set step variables sty[i] = 0.7 + Math.random(); // set step variables if (ns4up) { // set layers if (i == 0) { document.write("<layer name=\"dot"+ i +"\" left=\"15\" top=\"15\" visibility=\"show\"><img src='"+snowsrc+"' border=\"0\"><\/a><\/layer>"); } else { document.write("<layer name=\"dot"+ i +"\" left=\"15\" top=\"15\" visibility=\"show\"><img src='"+snowsrc+"' border=\"0\"><\/layer>"); } } else if (ie4up||ns6up) { if (i == 0) { document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><img src='"+snowsrc+"' border=\"0\"><\/a><\/div>"); } else { document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><img src='"+snowsrc+"' border=\"0\"><\/div>"); } } }
function snowNS() { // Netscape main animation function for (i = 0; i < no; ++ i) { // iterate for every dot yp[i] += sty[i]; if (yp[i] > doc_height-50) { xp[i] = Math.random()*(doc_width-am[i]-30); yp[i] = 0; stx[i] = 0.02 + Math.random()/10; sty[i] = 0.7 + Math.random(); doc_width = self.innerWidth; doc_height = self.innerHeight; } dx[i] += stx[i]; document.layers["dot"+i].top = yp[i]; document.layers["dot"+i].left = xp[i] + am[i]*Math.sin(dx[i]); } setTimeout("snowNS()", 10); }
function snowIE_NS6() { // IE and NS6 main animation function for (i = 0; i < no; ++ i) { // iterate for every dot yp[i] += sty[i]; if (yp[i] > doc_height-50) { xp[i] = Math.random()*(doc_width-am[i]-30); yp[i] = 0; stx[i] = 0.02 + Math.random()/10; sty[i] = 0.7 + Math.random(); doc_width = ns6up?window.innerWidth : document.body.clientWidth; doc_height = ns6up?window.innerHeight : document.body.clientHeight; } dx[i] += stx[i]; if (ie4up){ document.all["dot"+i].style.pixelTop = yp[i]; document.all["dot"+i].style.pixelLeft = xp[i] + am[i]*Math.sin(dx[i]); } else if (ns6up){ document.getElementById("dot"+i).style.top=yp[i]; document.getElementById("dot"+i).style.left=xp[i] + am[i]*Math.sin(dx[i]); } } setTimeout("snowIE_NS6()", 10); }
if (ns4up) { snowNS(); } else if (ie4up||ns6up) { snowIE_NS6(); }
</script>
http://www.web1.info
|
| |
|
|
| web | Дата: Понедельник, 2009-01-26, 7:18 PM | Сообщение # 2 |
|
Admin
Группа: Администраторы
Сообщений: 26
Репутация: 0
Статус: Offline
| скрипт салюта Code <strong><script language="JavaScript"> ns=(document.layers)?1:0; amount=20; if (ns){ for (i=0; i < amount; i++) document.write("<LAYER NAME='nsstars"+i+"' LEFT=0 TOP=0 BGCOLOR='#FFFFF0' CLIP='0,0,1,1'></LAYER>"); } else{ document.write("<div id='ieCov' style='position:absolute;top:0px;left:0px'>"); document.write("<div style='position:relative'>"); for (i=0; i < amount; i++) document.write("<div id='iestars' style='position:absolute;top:0px;left:0px;width:1;height:1;background:#ffffff;font-size:1'></div>"); document.write("</div></div>"); } Clrs=new Array('ff0000','00ff00','ffffff','ff00ff','ffa500','ffff00','00ff00','ffffff','ff00ff') sClrs=new Array('ffa500','00ff00','FFAAFF','fff000','fffffF') Xpos=300; Ypos=150; initialStarColor='00ff00'; step=5; currStep=0; explosionSize=150; function Fireworks(){ var WinHeight=(document.layers)?window.innerHeight-100:window.document.body.clientHeight-100; var WinWidth=(document.layers)?window.innerWidth-100:window.document.body.clientWidth-100; var Yscroll=(document.layers)?window.pageYOffset:document.body.scrollTop; for (i=0; i < amount; i++){ var layer=(document.layers)?document.layers["nsstars"+i]:iestars[i].style; var randCol=Math.round(Math.random()*8); var randSz=Math.round(Math.random()*2); layer.top = Ypos + explosionSize*Math.sin((currStep+i*5)/3)*Math.sin(currStep/100) layer.left= Xpos + explosionSize*Math.cos((currStep+i*5)/3)*Math.sin(currStep/100) if (currStep < 110){ if (ns){layer.bgColor=initialStarColor;layer.clip.width=1;layer.clip.height=1} else{layer.background=initialStarColor;layer.width=1;layer.height=1;layer.fontSize=1} } else{ if (ns){layer.bgColor=Clrs[randCol];layer.clip.width=randSz;layer.clip.height=randSz} else{layer.background=Clrs[randCol];layer.width=randSz;layer.height=randSz;layer.fontSize=randSz} } } if (currStep > 220) { currStep=0; Ypos = 50+Math.round(Math.random()*WinHeight)+Yscroll; Xpos = 50+Math.round(Math.random()*WinWidth); for (i=0; i < sClrs.length; i++) { var newIcol=Math.round(Math.random()*i); } initialStarColor=sClrs[newIcol]; explosionSize=Math.round(80*Math.random()+100); } currStep+=step; setTimeout("Fireworks()",20); } Fireworks(); // --> </script></strong>
http://www.web1.info
|
| |
|
|
| wodonagrev | Дата: Четверг, 2009-05-14, 3:41 Am | Сообщение # 3 |
|
Рядовой
Группа: Пользователи
Сообщений: 1
Репутация: 0
Статус: Offline
| Наконец-то я дождался ответа)))
|
| |
|
|
| MarioSergio | Дата: Четверг, 2009-05-14, 5:10 Am | Сообщение # 4 |
|
Рядовой
Группа: Пользователи
Сообщений: 2
Репутация: 0
Статус: Offline
| сутками никто не отвечает
|
| |
|
|
| Solomochka | Дата: Пятница, 2009-06-12, 6:17 Am | Сообщение # 5 |
|
Рядовой
Группа: Пользователи
Сообщений: 2
Репутация: 0
Статус: Offline
| Можно мне тоже объяснить?
|
| |
|
|
| kondicion | Дата: Четверг, 2009-06-18, 6:11 PM | Сообщение # 6 |
|
Рядовой
Группа: Пользователи
Сообщений: 1
Репутация: 0
Статус: Offline
| Спасибо. Буду следить за розвитеем темы...
|
| |
|
|