Форум А и О (скрипты, дизайн, общение)

Информация о пользователе

Привет, Гость! Войдите или зарегистрируйтесь.


Вы здесь » Форум А и О (скрипты, дизайн, общение) » Дизайн форумов » Скрипты-украшаем форум


Скрипты-украшаем форум

Сообщений 1 страница 17 из 17

1

ЛЕТЯЩИЕ БАБОЧКИ-по страничке летят понимаешь(правда не во всех браузерах отображаются нормально)

Код:
<script language="JavaScript1.2">

var Ymax=8; //MAX # OF PIXEL STEPS IN THE "X" DIRECTION
var Xmax=8; //MAX # OF PIXEL STEPS IN THE "Y" DIRECTION
var Tmax=10000; //MAX # OF MILLISECONDS BETWEEN PARAMETER CHANGES

//FLOATING IMAGE URLS FOR EACH IMAGE. ADD OR DELETE ENTRIES. KEEP ELEMENT NUMERICAL ORDER STARTING WITH "0" !!

var floatimages=new Array();
floatimages[0]='http://www.designsib.ru/script/fly/butterfly2.gif';
floatimages[1]='http://www.designsib.ru/script/fly/butterfly2.gif';

//*********DO NOT EDIT BELOW***********

var NS4 = (navigator.appName.indexOf("Netscape")>=0 && parseFloat(navigator.appVersion) >= 4 && parseFloat(navigator.appVersion) < 5)? true : false;
var IE4 = (document.all)? true : false;
var NS6 = (parseFloat(navigator.appVersion) >= 5 && navigator.appName.indexOf("Netscape")>=0 )? true: false;
var wind_w, wind_h, t='', IDs=new Array();
for(i=0; i<floatimages.length; i++){
t+=(NS4)?'<layer name="pic'+i+'" visibility="hide" width="10" height="10"><a href="javascript:hidebutterfly()">' : '<div id="pic'+i+'" style="position:absolute; visibility:hidden;width:10px; height:10px"><a href="javascript:hidebutterfly()">';
t+='<img src="'+floatimages[i]+'" name="p'+i+'" border="0">';
t+=(NS4)? '</a></layer>':'</a></div>';
}
document.write(t);

function moveimage(num){
if(getidleft(num)+IDs[num].W+IDs[num].Xstep >= wind_w+getscrollx())IDs[num].Xdir=false;
if(getidleft(num)-IDs[num].Xstep<=getscrollx())IDs[num].Xdir=true;
if(getidtop(num)+IDs[num].H+IDs[num].Ystep >= wind_h+getscrolly())IDs[num].Ydir=false;
if(getidtop(num)-IDs[num].Ystep<=getscrolly())IDs[num].Ydir=true;
moveidby(num, (IDs[num].Xdir)? IDs[num].Xstep : -IDs[num].Xstep , (IDs[num].Ydir)? IDs[num].Ystep: -IDs[num].Ystep);
}

function getnewprops(num){
IDs[num].Ydir=Math.floor(Math.random()*2)>0;
IDs[num].Xdir=Math.floor(Math.random()*2)>0;
IDs[num].Ystep=Math.ceil(Math.random()*Ymax);
IDs[num].Xstep=Math.ceil(Math.random()*Xmax)
setTimeout('getnewprops('+num+')', Math.floor(Math.random()*Tmax));
}

function getscrollx(){
if(NS4 || NS6)return window.pageXOffset;
if(IE4)return document.body.scrollLeft;
}

function getscrolly(){
if(NS4 || NS6)return window.pageYOffset;
if(IE4)return document.body.scrollTop;
}

function getid(name){
if(NS4)return document.layers[name];
if(IE4)return document.all[name];
if(NS6)return document.getElementById(name);
}

function moveidto(num,x,y){
if(NS4)IDs[num].moveTo(x,y);
if(IE4 || NS6){
IDs[num].style.left=x+'px';
IDs[num].style.top=y+'px';
}}

function getidleft(num){
if(NS4)return IDs[num].left;
if(IE4 || NS6)return parseInt(IDs[num].style.left);
}

function getidtop(num){
if(NS4)return IDs[num].top;
if(IE4 || NS6)return parseInt(IDs[num].style.top);
}

function moveidby(num,dx,dy){
if(NS4)IDs[num].moveBy(dx, dy);
if(IE4 || NS6){
IDs[num].style.left=(getidleft(num)+dx)+'px';
IDs[num].style.top=(getidtop(num)+dy)+'px';
}}

function getwindowwidth(){
if(NS4 || NS6)return window.innerWidth;
if(IE4)return document.body.clientWidth;
}

function getwindowheight(){
if(NS4 || NS6)return window.innerHeight;
if(IE4)return document.body.clientHeight;
}

function init(){
wind_w=getwindowwidth();
wind_h=getwindowheight();

for(i=0; i<floatimages.length; i++){
IDs[i]=getid('pic'+i);
if(NS4){
IDs[i].W=IDs[i].document.images["p"+i].width;
IDs[i].H=IDs[i].document.images["p"+i].height;
}
if(NS6 || IE4){
IDs[i].W=document.images["p"+i].width;
IDs[i].H=document.images["p"+i].height;
}
getnewprops(i);
moveidto(i , Math.floor(Math.random()*(wind_w-IDs[i].W)), Math.floor(Math.random()*(wind_h-IDs[i].H)));

if(NS4)IDs[i].visibility = "show";
if(IE4 || NS6)IDs[i].style.visibility = "visible";
startfly=setInterval('moveimage('+i+')',Math.floor(Math.random()*100)+100);
}}

function hidebutterfly(){
for(i=0; i<floatimages.length; i++){
if (IE4)
eval("document.all.pic"+i+".style.visibility='hidden'")
else if (NS6)
document.getElementById("pic"+i).style.visibility='hidden'
else if (NS4)
eval("document.pic"+i+".visibility='hide'")
clearInterval(startfly)
}
}

if (NS4||NS6||IE4){
window.onload=init;
window.onresize=function(){ wind_w=getwindowwidth(); wind_h=getwindowheight(); }
}

</script>

да и код длиннющий

0

2

Скрипт для заднего фона (ставить хтмл ВЕРХ) , КАРТИНКУ меняем на свое

Код:
<style type="text/css">
HTML, BODY {background-image: url("КАРТИНКА")!important; background-repeat: repeat !important;background-attachment: fixed;}
</style>


СКРИПТ ЗАДНИЙ ФОН- НЕ ПРОКРУЧИВАЕТСЯ

Код:
<style type="text/css">
HTML, BODY {background-image: url("ссылка")!important; background-repeat: repeat !important;background-attachment: fixed;}
</style>

Остановка заднего фона: Вверх

Код:
<style type="text/css">
BODY {background: fixed;}
</style>

0

3

РАДИО

Код:
<script src="http://bestof.ucoz.ru/js/AC_RunActiveContent.js" type="text/javascript"></script>
  <script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','600','height','110','src','http://bestof.ucoz.ru/radio/snick/radio01','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','http://bestof.ucoz.ru/radio/snick/radio01' ); //end AC code
</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="600" height="110">
    <param name="movie" value="http://bestof.ucoz.ru/radio/snick/radio01.swf">
    <param name="quality" value="high">
    <embed src="http://bestof.ucoz.ru/radio/snick/radio01.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="600" height="110"></embed>
</object></noscript>

0

4

<style type="text/css">
#pun-announcement .container {background-image: url("http://s56.radikal.ru/i154/0811/75/f390d328103f.jpg"); }
#pun .tcl {background-image: url("http://s56.radikal.ru/i154/0811/75/f390d328103f.jpg"); }
#pun .tcr {background-image: url("http://s56.radikal.ru/i154/0811/75/f390d328103f.jpg"); }
#pun-stats .container {background-image: url("http://s56.radikal.ru/i154/0811/75/f390d328103f.jpg");}
</style>


ФОН  ВНУТРИ ФОРУМА(В ДАННОМ СЛУЧАЕ СНЕЖИНКИ)

0

5

Иконка для фора(в окошке браузера)

Код:
<link rel="shortcut icon" href="http://www.fantasyflash.ru/ico/image/icon2.ico">.

в данном случае с http://www.fantasyflash.ru

0

6

Переливающие ссылки.ХТМЛ верх

<script language="JavaScript">
    var rate = 20;
    var obj;
    var act = 0;
    var elmH = 0;
    var elmS = 128;
    var elmV = 255;
    var clrOrg;
    var TimerID;
    if (navigator.appName.indexOf("Microsoft",0) != -1 && parseInt(navigator.appVersion) >= 4) {
    Browser = true;
    } else {
    Browser = false;}
    if (Browser) {
    document.onmouseover = doRainbowAnchor;
    document.onmouseout = stopRainbowAnchor;}
    function doRainbow(){
    if (Browser && act != 1) {
    act = 1;
    obj = event.srcElement;
    clrOrg = obj.style.color;
    TimerID = setInterval("ChangeColor()",100);}}
    function stopRainbow(){
    if (Browser && act != 0) {
    obj.style.color = clrOrg;
    clearInterval(TimerID);
    act = 0;}}
    function doRainbowAnchor(){
    if (Browser && act != 1) {
    obj = event.srcElement;
    while (obj.tagName != 'A' && obj.tagName != 'BODY') {
    obj = obj.parentElement;
    if (obj.tagName == 'A' || obj.tagName == 'BODY')
    break;}
    if (obj.tagName == 'A' && obj.href != '') {
    act = 1;//osw
    clrOrg = obj.style.color;
    TimerID = setInterval("ChangeColor()",100);}}}
    function stopRainbowAnchor(){
    if (Browser && act != 0) {
    if (obj.tagName == 'A') {
    obj.style.color = clrOrg;
    clearInterval(TimerID);
    act = 0;}}}
    function ChangeColor(){
    obj.style.color = makeColor();}
    function makeColor(){
    if (elmS == 0) {
    elmR = elmV; elmG = elmV; elmB = elmV;}
    else {
    t1 = elmV;
    t2 = (255 - elmS) * elmV / 255;
    t3 = elmH % 60;
    t3 = (t1 - t2) * t3 / 60;
    if (elmH < 60) {
    elmR = t1; elmB = t2; elmG = t2 + t3;}
    else if (elmH < 120) {
    elmG = t1; elmB = t2; elmR = t1 - t3;}
    else if (elmH < 180) {
    elmG = t1; elmR = t2; elmB = t2 + t3;}
    else if (elmH < 240) {
    elmB = t1; elmR = t2; elmG = t1 - t3;}
    else if (elmH < 300) {
    elmB = t1; elmG = t2; elmR = t2 + t3;}
    else if (elmH < 360) {
    elmR = t1; elmG = t2; elmB = t1 - t3;}
    else {
    elmR = 0; elmG = 0; elmB = 0;}}
    elmR = Math.floor(elmR);//fantasyflash.ru
    elmG = Math.floor(elmG);
    elmB = Math.floor(elmB);
    clrRGB = '#' + elmR.toString(16) + elmG.toString(16) + elmB.toString(16);
    elmH = elmH + rate; if (elmH >= 360) elmH = 0;
    return clrRGB;}</script>

0

7

Amber написал(а):

Скрипт для заднего фона (ставить хтмл ВЕРХ) , КАРТИНКУ меняем на свое

не знаете почему он у меня не работает(((? :'(

0

8

Пупся написал(а):

не знаете почему он у меня не работает(((?

хоть бы написали какой скрипт)) ну пост № какой, а то всю тему придецца щас просматривать))
нашла))

Скрипт для заднего фона (ставить хтмл ВЕРХ) , КАРТИНКУ меняем на свое.

у меня все рабит как часы, хтмл верх, картинку взяла поставила фон, тут же появился, проверьте правильность-туда ли ставите, на месте ли кавычки

0

9

скрипт для размера форума( сужения форума процентно)

<style type="text/css">
#pun {width : 90%;
margin: auto;}
</style>

% меняем на свое

0

10

Студентка написал(а):

проверьте правильность-туда ли ставите, на месте ли кавычки

картинку заливаешь на радикал????уменьшаешь её или нет????

0

11

Пупся написал(а):

картинку заливаешь на радикал????уменьшаешь её или нет????

я тупо взяла картинку с  темы -фоны для фотошопа

вот мой скрипт-

<style type="text/css">
HTML, BODY {background-image: url("http://s40.radikal.ru/i087/0903/d4/738b8f66a411.gif")!important; background-repeat: repeat !important;background-attachment: fixed;}
</style>

+1

12

http://s52.radikal.ru/i135/0906/a7/9001dc4b4118t.jpg

0

13

NATTY76 вы название темы видели?
картинки в другом раздееле

0

14

NATTY76 :crazyfun:  ага, оч похоже на скрипт)))

0

15

А  можно спросить нет ли у Вас когда для того что бы снежинки летели на форуме?

0

16

LEDOKOL написал(а):

А  можно спросить нет ли у Вас когда для того что бы снежинки летели на форуме?

Новогодний снег,нескольких видов

Администрирование - Настройка -HTML  верх или низ

Первая версия

Свернутый текст
Код:
<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>

Вторая версия

Свернутый текст
Код:
<SCRIPT language=JavaScript>
<!--
Amount=15; 

Image0=new Image();
Image0.src="http://fantasyflash.ru/script/web/image/sneg1.gif";

grphcs=new Array(1)
grphcs[0]="http://fantasyflash.ru/script/web/image/sneg1.gif"

Ypos=new Array();
Xpos=new Array();
Speed=new Array();
Step=new Array();
Cstep=new Array();
ns=(document.layers)?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];
document.write('<img id="si" src="'+rndPic+'" style="position:absolute;top:0px;left:0px">');
}
document.write('</div></div>');
}
WinHeight=(document.layers)?window.innerHeight:window.document.body.clientHeight;
WinWidth=(document.layers)?window.innerWidth:window.document.body.clientWidth;
for (i=0; i < Amount; i++){
 Ypos[i] = Math.round(Math.random()*WinHeight);
 Xpos[i] = Math.round(Math.random()*WinWidth);
 Speed[i]= Math.random()*3+2;
 Cstep[i]=0;//osw
 Step[i]=Math.random()*0.1+0.05;
}
function fall(){
var WinHeight=(document.layers)?window.innerHeight:window.document.body.clientHeight;
var WinWidth=(document.layers)?window.innerWidth:window.document.body.clientWidth;
var hscrll=(document.layers)?window.pageYOffset:document.body.scrollTop;
var wscrll=(document.layers)?window.pageXOffset:document.body.scrollLeft;//fantasyflash.ru 
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+2;
}
if (ns){
document.layers['sn'+i].left=Xpos[i];
document.layers['sn'+i].top=Ypos[i]+hscrll;
}
else{
si[i].style.pixelLeft=Xpos[i];//osw
si[i].style.pixelTop=Ypos[i]+hscrll;
}
Cstep[i]+=Step[i];
}
setTimeout('fall()',50);
}
fall()
//-->
</SCRIPT>[/quote]
[/spoiler]


[b]Третья версия  -  Не забываем загрузить функцию fall() внутрь тега body![/b]
[spoiler]
[quote]<SCRIPT language=JavaScript>
Amount=20; 
Image0=new Image();
Image0.src="http://fantasyflash.ru/script/web/image/sneg2.gif";
Image1=new Image();
Image1.src="http://fantasyflash.ru/script/web/image/sneg2.gif";
Image2=new Image();
Image2.src="http://fantasyflash.ru/script/web/image/sneg2.gif";
Image3=new Image();
Image3.src="http://fantasyflash.ru/script/web/image/sneg2.gif";
Image4=new Image();
Image4.src="http://fantasyflash.ru/script/web/image/sneg2.gif";
grphcs=new Array(5)
grphcs[0]="http://fantasyflash.ru/script/web/image/sneg2.gif"
grphcs[1]="http://fantasyflash.ru/script/web/image/sneg2.gif"
grphcs[2]="http://fantasyflash.ru/script/web/image/sneg2.gif"
grphcs[3]="http://fantasyflash.ru/script/web/image/sneg2.gif"
grphcs[4]="http://fantasyflash.ru/script/web/image/sneg2.gif"
grphcs[5]="http://fantasyflash.ru/script/web/image/sneg2.gif"
grphcs[6]="http://fantasyflash.ru/script/web/image/sneg2.gif"
Ypos=new Array();
Xpos=new Array();
Speed=new Array();
Step=new Array();
Cstep=new Array();
Ypos=new Array();
ns=(document.layers)?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++){

4  версия-

Свернутый текст
Код:
<SCRIPT language=JavaScript>
Amount=25; 

Image0=new Image();
Image0.src="http://fantasyflash.ru/script/web/image/sneg3.gif";

grphcs=new Array(1)
grphcs[0]="http://fantasyflash.ru/script/web/image/sneg3.gif"

Ypos=new Array();
Xpos=new Array();
Speed=new Array();
Step=new Array();
Cstep=new Array();
ns=(document.layers)?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];
document.write('<img id="si" src="'+rndPic+'" style="position:absolute;top:0px;left:0px">');
}
document.write('</div></div>');
}
WinHeight=(document.layers)?window.innerHeight:window.document.body.clientHeight;
WinWidth=(document.layers)?window.innerWidth:window.document.body.clientWidth;
for (i=0; i < Amount; i++){
 Ypos[i] = Math.round(Math.random()*WinHeight);
 Xpos[i] = Math.round(Math.random()*WinWidth);
 Speed[i]= Math.random()*3+2;
 Cstep[i]=0;//osw
 Step[i]=Math.random()*0.1+0.05;
}//fantasyflash.ru
function fall(){
var WinHeight=(document.layers)?window.innerHeight:window.document.body.clientHeight;
var WinWidth=(document.layers)?window.innerWidth:window.document.body.clientWidth;
var hscrll=(document.layers)?window.pageYOffset:document.body.scrollTop;
var wscrll=(document.layers)?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;//osw
Xpos[i]+=sx;
if (Ypos[i] > WinHeight){
Ypos[i]=-60;
Xpos[i]=Math.round(Math.random()*WinWidth);
Speed[i]=Math.random()*5+2;
}
if (ns){
document.layers['sn'+i].left=Xpos[i];
document.layers['sn'+i].top=Ypos[i]+hscrll;
}
else{
si[i].style.pixelLeft=Xpos[i];
si[i].style.pixelTop=Ypos[i]+hscrll;
}
Cstep[i]+=Step[i];
}
setTimeout('fall()',35);
}
fall()
</SCRIPT>[/quote]
[/spoiler]


[b]Пятая версия[/b]
[spoiler]
[quote]<SCRIPT language=JavaScript1.2>
var no = 25; 
var speed = 6; 
var snowflake = "http://fantasyflash.ru/script/web/image/sneg1.gif";

var ns4up = (document.layers) ? 1 : 0;
var ie4up = (document.all) ? 1 : 0;
var dx, xp, yp; 
var am, stx, sty; 
var i, doc_width = 800, doc_height = 600;
if (ns4up) {
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;         
xp[i] = Math.random()*(doc_width-50); 
yp[i] = Math.random()*doc_height;
am[i] = Math.random()*20;//osw         
stx[i] = 0.02 + Math.random()/10; 
sty[i] = 0.7 + Math.random();   
if (ns4up) {                  
if (i == 0) {
document.write("<layer name=\"dot"+ i +"\" left=\"15\" ");
document.write("top=\"15\" visibility=\"show\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></layer>");
} else {
document.write("<layer name=\"dot"+ i +"\" left=\"15\" ");
document.write("top=\"15\" visibility=\"show\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></layer>");
   }
} else if (ie4up) {
if (i == 0) {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
document.write("visible; TOP: 15px; LEFT: 15px;\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></div>");
} else {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
document.write("visible; TOP: 15px; LEFT: 15px;\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></div>");
      }
   }
}
function snowNS() { 
for (i = 0; i < no; ++ i) {  
yp[i] += sty[i];//osw
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()", speed);
}
function snowIE() { 
for (i = 0; i < no; ++ i) { 
yp[i] += sty[i];
if (yp[i] > doc_height-50) {
xp[i] = Math.random()*(doc_width-am[i]-30);
yp[i] = 0;//fantasyflash.ru
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
dx[i] += stx[i];
document.all["dot"+i].style.pixelTop = yp[i];
document.all["dot"+i].style.pixelLeft = xp[i] + am[i]*Math.sin(dx[i]);
}
setTimeout("snowIE()", speed);
}
if (ns4up) {
snowNS();
} else if (ie4up) {
snowIE();
}
</SCRIPT>

6 версия

Свернутый текст
Код:
<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]; 
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()*0.5+1; 
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()*0.5+1; 
} 
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>

7 версия-

Свернутый текст
Код:
<script type="text/javascript">

/******************************************
* Snow Effect Script- By Altan d.o.o. (http://www.altan.hr/snow/index.html)
* Visit Dynamic Drive DHTML code library (http://www.dynamicdrive.com/) for full source code
* Last updated Nov 9th, 05' by DD. This notice must stay intact for use
******************************************/
  
  //Configure below to change URL path to the snow image
  var snowsrc="http://tcse-cms.com/sneg/sneg.gif"
  // Configure below to change number of snow to render
  var no = 10;
  // Configure whether snow should disappear after x seconds (0=never):
  var hidesnowtime = 0;
  // Configure how much snow should drop down before fading ("windowheight" or "pageheight")
  var snowdistance = "pageheight";

///////////Stop Config//////////////////////////////////

  var ie4up = (document.all) ? 1 : 0;
  var ns6up = (document.getElementById&&!document.all) ? 1 : 0;

    function iecompattest(){
    return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
    }

  var dx, xp, yp;    // coordinate and position variables
  var am, stx, sty;  // amplitude and step variables
  var i, doc_width = 800, doc_height = 600; 
  
  if (ns6up) {
    doc_width = self.innerWidth;
    doc_height = self.innerHeight;
  } else if (ie4up) {
    doc_width = iecompattest().clientWidth;
    doc_height = iecompattest().clientHeight;
  }

  dx = new Array();
  xp = new Array();
  yp = new Array();
  am = new Array();
  stx = new Array();
  sty = new Array();
  snowsrc=(snowsrc.indexOf("dynamicdrive.com")!=-1)? "snow.gif" : snowsrc
  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 (ie4up||ns6up) {
      if (i == 0) {
        document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><a href=\"http://dynamicdrive.com\"><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 snowIE_NS6() {  // IE and NS6 main animation function
    doc_width = ns6up?window.innerWidth-10 : iecompattest().clientWidth-10;
        doc_height=(window.innerHeight && snowdistance=="windowheight")? window.innerHeight : (ie4up && snowdistance=="windowheight")?  iecompattest().clientHeight : (ie4up && !window.opera && snowdistance=="pageheight")? iecompattest().scrollHeight : iecompattest().offsetHeight;
    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();
      }
      dx[i] += stx[i];
      document.getElementById("dot"+i).style.top=yp[i]+"px";
      document.getElementById("dot"+i).style.left=xp[i] + am[i]*Math.sin(dx[i])+"px";  
    }
    snowtimer=setTimeout("snowIE_NS6()", 10);
  }

    function hidesnow(){
        if (window.snowtimer) clearTimeout(snowtimer)
        for (i=0; i<no; i++) document.getElementById("dot"+i).style.visibility="hidden"
    }
        

if (ie4up||ns6up){
    snowIE_NS6();
        if (hidesnowtime>0)
        setTimeout("hidesnow()", hidesnowtime*1000)
        }

</script>

8 версия

Код:
<script src="http://s2.wordpress.com/wp-content/plugins/snow/snowstorm.js?ver=2" type="text/javascript"></script>

проверяла не все, так что могут и не работать, н проверила только пару последних, вроде 8 версия нормальная

0

17

Таис написал(а):

проверяла не все, так что могут и не работать, н проверила только пару последних, вроде 8 версия нормальная

благодарю Вас http://www.kolobok.us/smiles/he_and_she/give_rose.gif

0


Вы здесь » Форум А и О (скрипты, дизайн, общение) » Дизайн форумов » Скрипты-украшаем форум


Сервис форумов BestBB © 2016-2020. Создать форум бесплатно