Вы вошли как Гость Группа "Гости"Приветствую Вас Гость RSS  
Главная


Форма входа
E-mail:
Пароль:

[Новые сообщения · Участники · Правила форума · Поиск · RSS ]
  • Страница 5 из 5
  • «
  • 1
  • 2
  • 3
  • 4
  • 5
Модератор форума: GDS  
Весенний Форум. Общение на любые темы » Мастерская » Web-дизайн » Как сделать чтоб на сайте падали снежинки (Как сделать чтоб на сайте падали снежинки)
Как сделать чтоб на сайте падали снежинки
MilagrosДата: Среда, 12.11.2008, 18:33 | Сообщение # 41
Новичок
Группа: Пользователи
Сообщений: 10
Репутация: 1
Подарки: 0
Статус: Оффлайн
Quote (Sandalla)
Ягун попробуй это.

ооо, спасибочкиииии!!! у меня работает, правда только в опере, ну ниче страшного )) если надоест -можно сидеть в мозилле, если захочется - залезть в оперу.



Зарабатывайте вместе с UcoZ!
Отличная партнерская программа!
babymamaДата: Среда, 10.12.2008, 03:59 | Сообщение # 42
Новичок
Группа: Пользователи
Сообщений: 2
Репутация: 1
Подарки: 0
Статус: Оффлайн
Вот еще один рабочий скрит Снежинки падают до конца страницы.Я поставила этот скрипт вверху страницы,сразу после слов
Code
<HTML><head><title>$FORUM_TITLE$</title>

Code
<script language="JavaScript1.2">
       grphcs=new Array(2)
Image0=new Image();
Image0.src=grphcs[0]="http://babymama.com.ua/sneg1.gif";
Image1=new Image();
Image1.src=grphcs[1]="http://babymama.com.ua/sneg1.gif";
       Amount=25;
Ypos=new Array();
Xpos=new Array();
Speed=new Array();
Step=new Array();
Cstep=new Array();
ns=(document.layers)?1:0;
ns6=(document.getElementById&&!document.all)?1:0;
       if (ns){
for (i = 0; i < Amount; i++){
var P=Math.floor(Math.random()*grphcs.length);
rndPic=grphcs[P];
document.write("<LAYER NAME='sn"+i+"' LEFT=0 TOP=0><img
src="+rndPic+"></LAYER>");
}
}
else{
document.write('<div style="position:absolute;top:0px;left:0px"><div
style="position:relative">');
for (i = 0; i < Amount; i++){
var P=Math.floor(Math.random()*grphcs.length);
rndPic=grphcs[P];//osw
document.write('<img id="si'+i+'" src="'+rndPic+'"
style="position:absolute;top:0px;left:0px">');
}
document.write('</div></div>');
}
WinHeight=(ns||ns6)?window.innerHeight:window.document.body.clientHeight;
WinWidth=(ns||ns6)?window.innerWidth-70:window.document.body.clientWidth;//fantasyflash.ru
for (i=0; i < Amount; i++){
       Ypos[i] = Math.round(Math.random()*WinHeight);
       Xpos[i] = Math.round(Math.random()*WinWidth);
       Speed[i]= Math.random()*5+3;
       Cstep[i]=0;
       Step[i]=Math.random()*0.1+0.05;
}
function fall(){
var
WinHeight=(ns||ns6)?window.innerHeight:window.document.body.clientHeight;
var
WinWidth=(ns||ns6)?window.innerWidth-70:window.document.body.clientWidth;
var hscrll=(ns||ns6)?window.pageYOffset:document.body.scrollTop;
var wscrll=(ns||ns6)?window.pageXOffset:document.body.scrollLeft;
for (i=0; i < Amount; i++){
sy = Speed[i]*Math.sin(90*Math.PI/180);
sx = Speed[i]*Math.cos(Cstep[i]);
Ypos[i]+=sy;
Xpos[i]+=sx;
if (Ypos[i] > WinHeight){
Ypos[i]=-60;
Xpos[i]=Math.round(Math.random()*WinWidth);
Speed[i]=Math.random()*5+3;
}
if (ns){
document.layers['sn'+i].left=Xpos[i];
document.layers['sn'+i].top=Ypos[i]+hscrll;
}
else if (ns6){
document.getElementById("si"+i).style.left=Math.min(WinWidth,Xpos[i]);
document.getElementById("si"+i).style.top=Ypos[i]+hscrll;
}
else{
eval("document.all.si"+i).style.left=Xpos[i];
eval("document.all.si"+i).style.top=Ypos[i]+hscrll;
}
Cstep[i]+=Step[i];
}
setTimeout('fall()',20);
}
       window.onload=fall
//-->
</script>
  
Mystery-for-youДата: Четверг, 11.12.2008, 15:29 | Сообщение # 43
Наблюдатель
Группа: Пользователи
Сообщений: 29
Репутация: 11
Подарки: 0
Статус: Оффлайн
Нашла скрипт

Code
<marquee behavior=scroll direction=down scrollamount=1 scrolldelay=23 height=691 style='position:absolute; left:63%; top:144px; width:24; height:691px;'><img src=http://dl2.glitter-graphics.net/pub/142/142872s1q7g5c3vh.gif border=0></marquee>
<marquee behavior=scroll direction=down scrollamount=1 scrolldelay=11 height=667 style='position:absolute; left:19%; top:183px; width:24; height:667px;'><img src=http://dl2.glitter-graphics.net/pub/142/142872s1q7g5c3vh.gif border=0></marquee>
<marquee behavior=scroll direction=down scrollamount=3 scrolldelay=36 height=528 style='position:absolute; left:36%; top:49px; width:24; height:528px;'><img src=http://dl2.glitter-graphics.net/pub/142/142872s1q7g5c3vh.gif border=0></marquee>
<marquee behavior=scroll direction=down scrollamount=2 scrolldelay=15 height=615 style='position:absolute; left:92%; top:83px; width:24; height:615px;'><img src=http://dl2.glitter-graphics.net/pub/142/142872s1q7g5c3vh.gif border=0></marquee>
<marquee behavior=scroll direction=down scrollamount=3 scrolldelay=14 height=524 style='position:absolute; left:21%; top:146px; width:24; height:524px;'><img src=http://dl2.glitter-graphics.net/pub/142/142872s1q7g5c3vh.gif border=0></marquee>
<marquee behavior=scroll direction=down scrollamount=2 scrolldelay=48 height=569 style='position:absolute; left:58%; top:185px; width:24; height:569px;'><img src=http://dl2.glitter-graphics.net/pub/142/142872s1q7g5c3vh.gif border=0></marquee>
<marquee behavior=scroll direction=down scrollamount=6 scrolldelay=39 height=568 style='position:absolute; left:76%; top:5px; width:24; height:568px;'><img src=http://dl2.glitter-graphics.net/pub/142/142872s1q7g5c3vh.gif border=0></marquee>
<marquee behavior=scroll direction=down scrollamount=2 scrolldelay=7 height=643 style='position:absolute; left:63%; top:103px; width:24; height:643px;'><img src=http://dl2.glitter-graphics.net/pub/142/142872s1q7g5c3vh.gif border=0></marquee>
<marquee behavior=scroll direction=down scrollamount=3 scrolldelay=30 height=507 style='position:absolute; left:71%; top:86px; width:24; height:507px;'><img src=http://dl2.glitter-graphics.net/pub/142/142872s1q7g5c3vh.gif border=0></marquee>
<marquee behavior=scroll direction=down scrollamount=3 scrolldelay=19 height=693 style='position:absolute; left:39%; top:118px; width:24; height:693px;'><img src=http://dl2.glitter-graphics.net/pub/142/142872s1q7g5c3vh.gif border=0></marquee>
<marquee behavior=scroll direction=down scrollamount=5 scrolldelay=19 height=652 style='position:absolute; left:23%; top:74px; width:24; height:652px;'><img src=http://dl2.glitter-graphics.net/pub/142/142872s1q7g5c3vh.gif border=0></marquee>
<marquee behavior=scroll direction=down scrollamount=1 scrolldelay=10 height=672 style='position:absolute; left:61%; top:159px; width:24; height:672px;'><img src=http://dl2.glitter-graphics.net/pub/142/142872s1q7g5c3vh.gif border=0></marquee>
<marquee behavior=scroll direction=down scrollamount=5 scrolldelay=19 height=536 style='position:absolute; left:34%; top:77px; width:24; height:536px;'><img src=http://dl2.glitter-graphics.net/pub/142/142872s1q7g5c3vh.gif border=0></marquee>
<marquee behavior=scroll direction=down scrollamount=6 scrolldelay=18 height=556 style='position:absolute; left:21%; top:126px; width:24; height:556px;'><img src=http://dl2.glitter-graphics.net/pub/142/142872s1q7g5c3vh.gif border=0></marquee>
<marquee behavior=scroll direction=down scrollamount=5 scrolldelay=11 height=555 style='position:absolute; left:46%; top:34px; width:24; height:555px;'><img src=http://dl2.glitter-graphics.net/pub/142/142872s1q7g5c3vh.gif border=0></marquee>
<marquee behavior=scroll direction=down scrollamount=3 scrolldelay=28 height=526 style='position:absolute; left:78%; top:128px; width:24; height:526px;'><img src=http://dl2.glitter-graphics.net/pub/142/142872s1q7g5c3vh.gif border=0></marquee>
<marquee behavior=scroll direction=down scrollamount=4 scrolldelay=45 height=564 style='position:absolute; left:19%; top:25px; width:24; height:564px;'><img src=http://dl2.glitter-graphics.net/pub/142/142872s1q7g5c3vh.gif border=0></marquee>
<marquee behavior=scroll direction=down scrollamount=3 scrolldelay=24 height=538 style='position:absolute; left:61%; top:148px; width:24; height:538px;'><img src=http://dl2.glitter-graphics.net/pub/142/142872s1q7g5c3vh.gif border=0></marquee>
<marquee behavior=scroll direction=down scrollamount=3 scrolldelay=37 height=634 style='position:absolute; left:72%; top:107px; width:24; height:634px;'><img src=http://dl2.glitter-graphics.net/pub/142/142872s1q7g5c3vh.gif border=0></marquee>
<marquee behavior=scroll direction=down scrollamount=5 scrolldelay=10 height=641 style='position:absolute; left:59%; top:27px; width:24; height:641px;'><img src=http://dl2.glitter-graphics.net/pub/142/142872s1q7g5c3vh.gif border=0></marquee>


ЯгунДата: Четверг, 11.12.2008, 16:16 | Сообщение # 44
Свой человек
Группа: Пользователи
Сообщений: 287
Репутация: 35
Подарки: 5
Статус: Оффлайн
Не проверял другие скрипты, которые здесь написаны, но этот 100% работает.
Вставляешь в боди сайта:
Code
<script language="JavaScript1.2">   
        grphcs=new Array(2)   
Image0=new Image();   
Image0.src=grphcs[0]="http://fantasyflash.ru/script/web/image/sneg1.gif";   
Image1=new Image();   
Image1.src=grphcs[1]="http://fantasyflash.ru/script/web/image/sneg1.gif";   
        Amount=25;        
Ypos=new Array();   
Xpos=new Array();   
Speed=new Array();   
Step=new Array();   
Cstep=new Array();   
ns=(document.layers)?1:0;   
ns6=(document.getElementById&&!document.all)?1:0;   
        if (ns){   
for (i = 0; i < Amount; i++){   
var P=Math.floor(Math.random()*grphcs.length);   
rndPic=grphcs[P];   
document.write("<LAYER NAME='sn"+i+"' LEFT=0 TOP=0><img src="+rndPic+"></LAYER>");   
}   
}   
else{   
document.write('<div style="position:absolute;top:0px;left:0px"><div style="position:relative">');   
for (i = 0; i < Amount; i++){   
var P=Math.floor(Math.random()*grphcs.length);   
rndPic=grphcs[P];//osw   
document.write('<img id="si'+i+'" src="'+rndPic+'" style="position:absolute;top:0px;left:0px">');   
}   
document.write('</div></div>');   
}   
WinHeight=(ns||ns6)?window.innerHeight:window.document.body.clientHeight;   
WinWidth=(ns||ns6)?window.innerWidth-70:window.document.body.clientWidth;//fantasyflash.ru   
for (i=0; i < Amount; i++){        
        Ypos[i] = Math.round(Math.random()*WinHeight);   
        Xpos[i] = Math.round(Math.random()*WinWidth);   
        Speed[i]= Math.random()*5+3;   
        Cstep[i]=0;   
        Step[i]=Math.random()*0.1+0.05;   
}   
function fall(){   
var WinHeight=(ns||ns6)?window.innerHeight:window.document.body.clientHeight;   
var WinWidth=(ns||ns6)?window.innerWidth-70:window.document.body.clientWidth;   
var hscrll=(ns||ns6)?window.pageYOffset:document.body.scrollTop;   
var wscrll=(ns||ns6)?window.pageXOffset:document.body.scrollLeft;   
for (i=0; i < Amount; i++){   
sy = Speed[i]*Math.sin(90*Math.PI/180);   
sx = Speed[i]*Math.cos(Cstep[i]);   
Ypos[i]+=sy;   
Xpos[i]+=sx;        
if (Ypos[i] > WinHeight){   
Ypos[i]=-60;   
Xpos[i]=Math.round(Math.random()*WinWidth);   
Speed[i]=Math.random()*5+3;   
}   
if (ns){   
document.layers['sn'+i].left=Xpos[i];   
document.layers['sn'+i].top=Ypos[i]+hscrll;   
}   
else if (ns6){   
document.getElementById("si"+i).style.left=Math.min(WinWidth,Xpos[i]);   
document.getElementById("si"+i).style.top=Ypos[i]+hscrll;   
}   
else{   
eval("document.all.si"+i).style.left=Xpos[i];   
eval("document.all.si"+i).style.top=Ypos[i]+hscrll;   
}        
Cstep[i]+=Step[i];   
}   
setTimeout('fall()',20);   
}   
        window.onload=fall   
//-->   
</script>

Работает как на IE, так и на Опере, так и на Огненное Лисе... Сам проверял!


shvedДата: Четверг, 08.01.2009, 21:50 | Сообщение # 45
Свой человек
Группа: Пользователи
Сообщений: 268
Репутация: 35
Подарки: 2
Статус: Оффлайн
Ягун, Угу кульно спс


shvedДата: Четверг, 08.01.2009, 21:51 | Сообщение # 46
Свой человек
Группа: Пользователи
Сообщений: 268
Репутация: 35
Подарки: 2
Статус: Оффлайн
а картинки можно попробовать заменить?


shvedДата: Четверг, 08.01.2009, 21:55 | Сообщение # 47
Свой человек
Группа: Пользователи
Сообщений: 268
Репутация: 35
Подарки: 2
Статус: Оффлайн
короче смотрите я взял код Ягуна, всё шикарно работает но я провёл эксперимент!
если ктото хочет чтобы заместо снежинок падали другие картинки просто вот вам код
Этот код вставлять между в боди сайта
Code
<script language="JavaScript1.2">    
         grphcs=new Array(2)    
Image0=new Image();    
Image0.src=grphcs[0]="Ссылку на картинку";    
Image1=new Image();    
Image1.src=grphcs[1]="Ссылку на картинку";    
         Amount=25;         
Ypos=new Array();    
Xpos=new Array();    
Speed=new Array();    
Step=new Array();    
Cstep=new Array();    
ns=(document.layers)?1:0;    
ns6=(document.getElementById&&!document.all)?1:0;    
         if (ns){    
for (i = 0; i < Amount; i++){    
var P=Math.floor(Math.random()*grphcs.length);    
rndPic=grphcs[P];    
document.write("<LAYER NAME='sn"+i+"' LEFT=0 TOP=0><img src="+rndPic+"></LAYER>");    
}    
}    
else{    
document.write('<div style="position:absolute;top:0px;left:0px"><div style="position:relative">');    
for (i = 0; i < Amount; i++){    
var P=Math.floor(Math.random()*grphcs.length);    
rndPic=grphcs[P];//osw    
document.write('<img id="si'+i+'" src="'+rndPic+'" style="position:absolute;top:0px;left:0px">');    
}    
document.write('</div></div>');    
}    
WinHeight=(ns||ns6)?window.innerHeight:window.document.body.clientHeight;    
WinWidth=(ns||ns6)?window.innerWidth-70:window.document.body.clientWidth;//fantasyflash.ru    
for (i=0; i < Amount; i++){         
         Ypos[i] = Math.round(Math.random()*WinHeight);    
         Xpos[i] = Math.round(Math.random()*WinWidth);    
         Speed[i]= Math.random()*5+3;    
         Cstep[i]=0;    
         Step[i]=Math.random()*0.1+0.05;    
}    
function fall(){    
var WinHeight=(ns||ns6)?window.innerHeight:window.document.body.clientHeight;    
var WinWidth=(ns||ns6)?window.innerWidth-70:window.document.body.clientWidth;    
var hscrll=(ns||ns6)?window.pageYOffset:document.body.scrollTop;    
var wscrll=(ns||ns6)?window.pageXOffset:document.body.scrollLeft;    
for (i=0; i < Amount; i++){    
sy = Speed[i]*Math.sin(90*Math.PI/180);    
sx = Speed[i]*Math.cos(Cstep[i]);    
Ypos[i]+=sy;    
Xpos[i]+=sx;         
if (Ypos[i] > WinHeight){    
Ypos[i]=-60;    
Xpos[i]=Math.round(Math.random()*WinWidth);    
Speed[i]=Math.random()*5+3;    
}    
if (ns){    
document.layers['sn'+i].left=Xpos[i];    
document.layers['sn'+i].top=Ypos[i]+hscrll;    
}    
else if (ns6){    
document.getElementById("si"+i).style.left=Math.min(WinWidth,Xpos[i]);    
document.getElementById("si"+i).style.top=Ypos[i]+hscrll;    
}    
else{    
eval("document.all.si"+i).style.left=Xpos[i];    
eval("document.all.si"+i).style.top=Ypos[i]+hscrll;    
}         
Cstep[i]+=Step[i];    
}    
setTimeout('fall()',20);    
}    
         window.onload=fall    
//-->    
</script>

Работает на всех браузерах



Весенний Форум. Общение на любые темы » Мастерская » Web-дизайн » Как сделать чтоб на сайте падали снежинки (Как сделать чтоб на сайте падали снежинки)
  • Страница 5 из 5
  • «
  • 1
  • 2
  • 3
  • 4
  • 5
Поиск:

Сегодня к нам заходили:

kapriolctk, kapriolfps, kapriollmw

Мини-чат:


Аватарочка © 2024
Сайт управляется системой uCoz