Наш мир

Объявление



Наш форум для увлеченных людей,которые получают

большое удовольствие от любимых занятий.

Помогите нам в развитии, нажмите:

Нравится

 

 

Новости:  

Опрос: «Как вам новый дизайн форума?»



 

Разное:

Гороскоп на каждый день.               

      

 

Реклама:

«Многогранная природа»              

«Мир детства»

           

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

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


Вы здесь » Наш мир » Для оформления. » Падающие , летающие ... предметы.


Падающие , летающие ... предметы.

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

1

летающие бабочки.

Код:
<script language="JavaScript1.2">
/*
Flying Butterfly script (By BGAudioDr@aol.com)
Modified slightly/ permission granted to Dynamic Drive to feature script in archive
*/

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://s17.rimg.info/ac5effce747ba8b9f63d97111fefdc9b.gif';
floatimages[1]='http://s17.rimg.info/ac5effce747ba8b9f63d97111fefdc9b.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 ">' : '<div id="pic'+i+'" style="position:absolute; visibility:hidden;width:10px; height:10px"><a >';
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>

2

снежинки(видно только в IE)в низ

Код:
<script language="JavaScript" type="text/javascript"> 
if (top.location != location) { 
top.location.href = document.location.href ; 
} 
</script> 


<link rel="stylesheet" href="templates/snowSilver/snowSilver.css" type="text/css"> 
<script> 
// Set the number of snowflakes (more than 30 - 40 not recommended) 
var snowmax=35 

// Set the colors for the snow. Add as many colors as you like 
var snowcolor=new Array("#aaaacc","#ddddFF","#ccccDD") 

// Set the fonts, that create the snowflakes. Add as many fonts as you like 
var snowtype=new Array("Arial Black","Arial Narrow","Times","Comic Sans MS") 

// Set the letter that creates your snowflake (recommended:*) 
var snowletter="*" 

// Set the speed of sinking (recommended values range from 0.3 to 2) 
var sinkspeed=2 

// Set the maximal-size of your snowflaxes 
var snowmaxsize=30 

// Set the minimal-size of your snowflaxes 
var snowminsize=10 

// Set the snowing-zone 
// Set 1 for all-over-snowing, set 2 for left-side-snowing 
// Set 3 for center-snowing, set 4 for right-side-snowing 
var snowingzone=1 

/////////////////////////////////////////////////////////////////////////// 
// CONFIGURATION ENDS HERE 
/////////////////////////////////////////////////////////////////////////// 


// Do not edit below this line 
var snow=new Array() 
var marginbottom 
var marginright 
var timer 
var i_snow=0 
var x_mv=new Array(); 
var crds=new Array(); 
var lftrght=new Array(); 
var browserinfos=navigator.userAgent 
var ie5=document.all&&document.getElementById&&!browserinfos.match(/Opera/) 
var ns6=document.getElementById&&!document.all 
var opera=browserinfos.match(/Opera/) 
var browserok=ie5||ns6||opera 

function randommaker(range) { 
rand=Math.floor(range*Math.random()) 
return rand 
} 

function initsnow() { 
if (ie5 || opera) { 
marginbottom = document.body.clientHeight 
marginright = document.body.clientWidth 
} 
else if (ns6) { 
marginbottom = window.innerHeight 
marginright = window.innerWidth 
} 
var snowsizerange=snowmaxsize-snowminsize 
for (i=0;i<=snowmax;i++) { 
crds[i] = 0; 
lftrght[i] = Math.random()*15; 
x_mv[i] = 0.03 + Math.random()/10; 
snow[i]=document.getElementById("s"+i) 
snow[i].style.fontFamily=snowtype[randommaker(snowtype.length)] 
snow[i].size=randommaker(snowsizerange)+snowminsize 
snow[i].style.fontSize=snow[i].size 
snow[i].style.color=snowcolor[randommaker(snowcolor.length)] 
snow[i].sink=sinkspeed*snow[i].size/5 
if (snowingzone==1) {snow[i].posx=randommaker(marginright-snow[i].size)} 
if (snowingzone==2) {snow[i].posx=randommaker(marginright/2-snow[i].size)} 
if (snowingzone==3) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/4} 
if (snowingzone==4) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/2} 
snow[i].posy=randommaker(2*marginbottom-marginbottom-2*snow[i].size) 
snow[i].style.left=snow[i].posx 
snow[i].style.top=snow[i].posy 
} 
movesnow() 
} 

function movesnow() { 
for (i=0;i<=snowmax;i++) { 
crds[i] += x_mv[i]; 
snow[i].posy+=snow[i].sink 
snow[i].style.left=snow[i].posx+lftrght[i]*Math.sin(crds[i]); 
snow[i].style.top=snow[i].posy 

if (snow[i].posy>=marginbottom-2*snow[i].size || parseInt(snow[i].style.left)>(marginright-3*lftrght[i])){ 
if (snowingzone==1) {snow[i].posx=randommaker(marginright-snow[i].size)} 
if (snowingzone==2) {snow[i].posx=randommaker(marginright/2-snow[i].size)} 
if (snowingzone==3) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/4} 
if (snowingzone==4) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/2} 
snow[i].posy=0 
} 
} 
var timer=setTimeout("movesnow()",50) 
} 

for (i=0;i<=snowmax;i++) { 
document.write("<span id='s"+i+"' style='position:absolute;top:-"+snowmaxsize+"'>"+snowletter+"</span>") 
} 
if (browserok) { 
window.onload=initsnow 
} 
</script> 
<script language="Javascript" type="text/javascript"> 
<!-- 
if ( 0 ) 
{ 
window.open('privmsg.php?mode=newpm&amp;mforum=amazonka', '_phpbbprivmsg', 'HEIGHT=225,resizable=yes,WIDTH=400');; 
} 
//--> 
</script>

3

Эффект летящих звезд

Код:
<SCRIPT LANGUAGE="JavaScript"> 
  
 <!-- Begin 
 SmallStars = 30; 
 LargeStars = 10; 
 SmallYpos = new Array(); 
 SmallXpos = new Array(); 
 LargeYpos = new Array(); 
 LargeXpos = new Array(); 
 Smallspeed= new Array(); 
 Largespeed= new Array(); 
 ns=(document.layers)?1:0; 
 if (ns) { 
 for (i = 0; i < SmallStars; i++) { 
 document.write("<LAYER NAME='sn"+i+"' LEFT=0 TOP=0 BGCOLOR='#FFFFF0' CLIP='0,0,1,1'></LAYER>"); 
 } 
 for (i = 0; i < LargeStars; i++) { 
 document.write("<LAYER NAME='ln"+i+"' LEFT=0 TOP=0 BGCOLOR='#FFFFFF' CLIP='0,0,2,2'></LAYER>"); 
    } 
 } 
 else { 
 document.write('<div style="position:absolute;top:0px;left:0px">'); 
 document.write('<div style="position:relative">'); 
 for (i = 0; i < SmallStars; i++) { 
 document.write('<div id="si" style="position:absolute;top:0;left:0;width:1px;height:1px;background:#fffff0;font-size:1px"></div>'); 
 } 
 document.write('</div>'); 
 document.write('</div>'); 
 document.write('<div style="position:absolute;top:0px;left:0px">'); 
 document.write('<div style="position:relative">'); 
 for (i = 0; i < LargeStars; i++) { 
 document.write('<div id="li" style="position:absolute;top:0;left:0;width:2px;height:2px;background:#ffffff;font-size:2px"></div>'); 
 } 
 document.write('</div>'); 
 document.write('</div>'); 
 } 
 WinHeight = (document.layers)?window.innerHeight:window.document.body.clientHeight; 
 WinWidth = (document.layers)?window.innerWidth:window.document.body.clientWidth; 
 for (i = 0; i < SmallStars; i++) { 
 SmallYpos[i] = Math.round(Math.random() * WinHeight); 
 SmallXpos[i] = Math.round(Math.random() * WinWidth); 
 Smallspeed[i]= Math.random() * 5 + 1; 
 } 
 for (i = 0; i < LargeStars; i++) { 
 LargeYpos[i] = Math.round(Math.random() * WinHeight); 
 LargeXpos[i] = Math.round(Math.random() * WinWidth); 
 Largespeed[i] = Math.random() * 10 + 5; 
 } 
 function fly() { 
 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 < LargeStars; i++) { 
 LargeXpos[i] -= Largespeed[i]; 
 if (LargeXpos[i] < -10) { 
 LargeXpos[i] = WinWidth; 
 LargeYpos[i] = Math.round(Math.random() * WinHeight); 
 Largespeed[i] = Math.random() * 10 + 5; 
 } 
 if (ns) { 
 document.layers['ln'+i].left = LargeXpos[i]; 
 document.layers['ln'+i].top = LargeYpos[i] + hscrll; 
 } 
 else { 
 li[i].style.pixelLeft = LargeXpos[i]; 
 li[i].style.pixelTop = LargeYpos[i] + hscrll; 
    } 
 } 
 for (i = 0; i < SmallStars; i++) { 
 SmallXpos[i] -= Smallspeed[i]; 
 if (SmallXpos[i] < -10) { 
 SmallXpos[i] = WinWidth; 
 SmallYpos[i] = Math.round(Math.random()*WinHeight); 
 Smallspeed[i] = Math.random() * 5 + 1; 
 } 
 if (ns) { 
 document.layers['sn'+i].left = SmallXpos[i]; 
 document.layers['sn'+i].top = SmallYpos[i]+hscrll; 
 } 
 else { 
 si[i].style.pixelLeft = SmallXpos[i]; 
 si[i].style.pixelTop = SmallYpos[i]+hscrll; 
    } 
 } 
 setTimeout('fly()', 10); 
 } 
 //  End --> 
 </script>

4

снег .  ( лепить в низ )

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

5

снегопад. очь много снега. ( в низ ставить )

Код:
<script src="http://livibetter.googlepages.com/snowstorm-nocollect.js" type="text/javascript"></script>
<script src="http://livibetter.googlepages.com/snowstorm.js" type="text/javascript"></script>

6

Таракан.
Вставлять в хтмл-верх.

Код:
<script>
var no = 1;
var speed = 299;
var ns4up = (document.layers) ? 1 : 0;
var ie4up = (document.all) ? 1 : 0;
var s, x, y, sn, cs;
var a, r, cx, cy;
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;
}
x = new Array();
y = new Array();
r = new Array();
cx = new Array();
cy = new Array();
s = 8;
for (i = 0; i < no; ++ i) { 
initRain();
if (ns4up) {
if (i == 0) {
document.write("<layer name=\"dot"+ i +"\" left=\"1\" ");
document.write("top=\"1\" visibility=\"show\"><img src=\"http://i020.radikal.ru/0805/0a/afba1a30cd67.gif\" width=75 height=56>");
document.write("</layer>");
}
else {
document.write("<layer name=\"dot"+ i +"\" left=\"1\" ");
document.write("top=\"1\" visibility=\"show\"><img src=\"http://i020.radikal.ru/0805/0a/afba1a30cd67.gif\" width=75 height=56></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=\"http://i020.radikal.ru/0805/0a/afba1a30cd67.gif\" width=75 height=56></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=\"http://i020.radikal.ru/0805/0a/afba1a30cd67.gif\" width=75 height=56></div>");
    }
 }
}
function initRain() {
a = 6;
r[i] = 1;
sn = Math.sin(a);
cs = Math.cos(a);
cx[i] = Math.random() * doc_width + 1;
cy[i] = Math.random() * doc_height + 1;
x[i] = r[i] * sn + cx[i];
y[i] = cy[i];
}
function makeRain() {
r[i] = 1;
cx[i] = Math.random() * doc_width + 1;
cy[i] = 1;
x[i] = r[i] * sn + cx[i];
y[i] = r[i] * cs + cy[i];
}
function updateRain() {
r[i] += s;
x[i] = r[i] * sn + cx[i];
y[i] = r[i] * cs + cy[i];
}
function raindropNS() {
for (i = 0; i < no; ++ i) {
updateRain();
if ((x[i] <= 1) || (x[i] >= (doc_width - 20)) || (y[i] >= (doc_height - 20))) {
makeRain();
doc_width = self.innerWidth;
doc_height = self.innerHeight;
}
document.layers["dot"+i].top = y[i];
document.layers["dot"+i].left = x[i];
}
setTimeout("raindropNS()", speed);
}
function raindropIE() {
for (i = 0; i < no; ++ i) {
updateRain();
if ((x[i] <= 1) || (x[i] >= (doc_width - 20)) || (y[i] >= (doc_height - 20))) {
makeRain();
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
document.all["dot"+i].style.pixelTop = y[i];
document.all["dot"+i].style.pixelLeft = x[i];
}
setTimeout("raindropIE()", speed);
}
if (ns4up) {
raindropNS();
}
else
if (ie4up) {
raindropIE();
}
</script>

На мониторе появляется таракан, который бегает по экрану. при обновлении страницы он будет бежать в другом месте.


Вы здесь » Наш мир » Для оформления. » Падающие , летающие ... предметы.