Изменение кода скрипта
Народ помогите плс, вот скрип:
/*********************************** *********************************** ********************/ // SnowScript for IE, Mozilla and many more! // © RoterFruchtZwerg 2003 // stumpf und schnell mal von uns ausgeliehen ;) var imgNum = 0; var snowImg = new Array(); snowImg[0] ="<span style=\"color: #AAAAAA; font-size: 8pt;\">*</span>"; snowImg[1] ="<span style=\"color: #AABBCC; font-size: 10pt;\">*</span>"; snowImg[0] ="<img src=\"http://cinema-life.3dn.ru/snow/snowjs.gif\" alt=\"*\"/>"; snowImg[1] ="<img src=\"http://cinema-life.3dn.ru/snow/snowjs2.gif\" alt=\"*\" />"; var no = 15; var dx, xp, yp; var am, stx, sty; var i, doc_width = 800, doc_height = 600; doc_width = window.innerWidth ? window.innerWidth : document.body.clientWidth; doc_height = window.innerHeight ? window.innerHeight : 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) { imgNum = imgNum?0:1; var snowsrc = snowImg[imgNum]; dx[i] = 0; xp[i] = Math.random()*(doc_width-60); yp[i] = Math.random()*doc_height; am[i] = Math.random()*10; stx[i] = 0.02 + Math.random()/10; sty[i] = 0.7 + Math.random(); document.write("<div id=\"dot"+ i +"\" style=\"position: absolute; z-index: "+ i +"; visibility: visible; top: 1px; left: 1px; width:12px;\">"+snowsrc+"</div>"); } function snow() { for (i = 0; i < no; ++ i) { yp[i] += sty[i]; if (yp[i] > doc_height-20) { xp[i] = Math.random()*(doc_width-am[i]-20); yp[i] = 0; stx[i] = 0.02 + Math.random()/10; sty[i] = 0.7 + Math.random()*2; doc_width = window.innerWidth ? window.innerWidth : document.body.clientWidth; doc_height = window.innerHeight ? window.innerHeight : document.body.clientHeight; } dx[i] += stx[i]; document.getElementById("dot"+i).style.top = Math.round(yp[i])+"px"; document.getElementById("dot"+i).style.left = Math.round(xp[i] + am[i]*Math.sin(dx[i]))+"px"; } setTimeout("snow()", 60); } snow(); // SnowScript for IE, Mozilla and many more! // © RoterFruchtZwerg 2003 // stumpf und schnell mal von uns ausgeliehen ;) /*********************************** *********************************** ********************/ Снежнки идут только до середины страницы, что нужно изменить чтобы снежинки шли до конца. |
Goolfen,
хотите честно? убейтись ап стену с снежинками, они только отпугивают посетителей. |
Омг вот этот раритет скоро 10 лет скрипту!
|
Цитата:
|
|
Serg_pnz, а я листочки падающие писал в своё время)))
|
Цитата:
|
Цитата:
|
Цитата:
|
Ну а что надо изменить именно в этом скрипте чтобы снежинки падали до конца страницы?
|
А где они у вас не работают?
1)опера - работает 2)mazila firefox - работает 3)хром - работает(при чем лучше всех, в 2ух предыдущих снежники падают как бы партиями, а тут "бесперебойно") На осле не пробовал P.S. у меня его и нет вроде :/ |
Цитата:
|
Goolfen, попробуйте этот вариант ...
<!DOCTYPE html> <html> <head> <title></title> <script type="text/javascript"> /*********************************** *********************************** ********************/ // SnowScript for IE, Mozilla and many more! // © RoterFruchtZwerg 2003 // stumpf und schnell mal von uns ausgeliehen ;) var imgNum = 0; var snowImg = new Array(); snowImg[0] ="<span style=\"color: #AAAAAA; font-size: 8pt;\">*</span>"; snowImg[1] ="<span style=\"color: #AABBCC; font-size: 10pt;\">*</span>"; snowImg[0] ="<img src=\"http://cinema-life.3dn.ru/snow/snowjs.gif\" alt=\"*\"/>"; snowImg[1] ="<img src=\"http://cinema-life.3dn.ru/snow/snowjs2.gif\" alt=\"*\" />"; var no = 15; var dx, xp, yp; var am, stx, sty; var i, doc_width = 800, doc_height = 600; function getDocumentSize(a) { var d = document, b = d.body, e = d.documentElement, c = "client" + a; a = "scroll" + a; return /CSS/.test(d.compatMode)? Math.max(e[c],e[a]) : Math.max(b[c],b[a]) }; doc_width = getDocumentSize('Width')-12; doc_height = getDocumentSize('Height')-12; dx = new Array(); xp = new Array(); yp = new Array(); am = new Array(); stx = new Array(); sty = new Array(); for (i = 0; i < no; ++ i) { imgNum = imgNum?0:1; var snowsrc = snowImg[imgNum]; dx[i] = 0; xp[i] = Math.random()*(doc_width-60); yp[i] = Math.random()*doc_height; am[i] = Math.random()*10; stx[i] = 0.02 + Math.random()/10; sty[i] = 0.7 + Math.random(); document.write("<div id=\"dot"+ i +"\" style=\"position: absolute; z-index: "+ i +"; visibility: visible; top: 1px; left: 1px; width:12px;\">"+snowsrc+"</div>"); } function snow() { for (i = 0; i < no; ++ i) { yp[i] += sty[i]; if (yp[i] > doc_height-20) { xp[i] = Math.random()*(doc_width-am[i]-20); yp[i] = 0; stx[i] = 0.02 + Math.random()/10; sty[i] = 0.7 + Math.random()*2; doc_width = getDocumentSize('Width'); doc_height = getDocumentSize('Height'); } dx[i] += stx[i]; document.getElementById("dot"+i).style.top = Math.round(yp[i])+"px"; document.getElementById("dot"+i).style.left = Math.round(xp[i] + am[i]*Math.sin(dx[i]))+"px"; } setTimeout("snow()", 60); } window.onload = snow // SnowScript for IE, Mozilla and many more! // © RoterFruchtZwerg 2003 // stumpf und schnell mal von uns ausgeliehen ;) /*********************************** *********************************** ********************/ </script> </head> <body> </body> </html> |
Цитата:
|
Goolfen,
Код неработащей страницы ? сделайте пример. здесь. |
рони, зайдите на сайт http://cinema-life.3dn.ru
|
Goolfen,во всех популярных браузерах снежинки падают до конца страницы в том числе и Mozilla Firefox 8 и 9 ... картинки на сайте особенно лого можно наверное сжать :write: ... быстрее будет грузиться ...
|
Часовой пояс GMT +3, время: 20:12. |