Forum www.forum.fora.pl Strona Główna

www.forum.fora.pl
Nieoficjalne forum pomocy serwisu fora.pl
 

błąd skryptu na walentynki...

 
Napisz nowy temat   Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi    Forum www.forum.fora.pl Strona Główna -> Pomoc i pytania
Zobacz poprzedni temat :: Zobacz następny temat  
Autor Wiadomość
mmarta132
Amator postów
Amator postów



Dołączył: 29 Lis 2006
Posty: 56
Przeczytał: 0 tematów

Ostrzeżeń: 1/5
Skąd: Olsztyn

PostWysłany: Czw 10:21, 14 Lut 2008    Temat postu: błąd skryptu na walentynki...

Podajcie proszę prawidłowy skrypt na walentynki.
Znalazłam tu tylko taki ale on nie działa

<script language="JavaScript1.2">

/*
Snow Effect Script
Submitted by Altan d.o.o. (snow@altan.hr, [link widoczny dla zalogowanych])
Permission granted to Dynamicdrive.com to feature script in archive
For full source code to this script, visit [link widoczny dla zalogowanych]
*/


//Configure below to change URL path to the snow image
var snowsrc="http://img476.imageshack.us/img476/1262/79cceacb46cbqx4.png"
// Configure below to change number of snow to render
var no = 15;

var ns4up = (document.layers) ? 1 : 0; // browser sniffer
var ie4up = (document.all) ? 1 : 0;
var ns6up = (document.getElementById&&!document.all) ? 1 : 0;

var dx, xp, yp; // coordinate and position variables
var am, stx, sty; // amplitude and step variables
var i, doc_width = 800, doc_height = 400;

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\"><a href=\"http://dynamicdrive.com/\"><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;\"><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 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>


Post został pochwalony 0 razy
Powrót do góry
Zobacz profil autora
kamilk
Administrator
Administrator



Dołączył: 13 Lut 2008
Posty: 1316
Przeczytał: 0 tematów

Pomógł: 61 razy
Ostrzeżeń: 0/5

Płeć: Mężczyzna

PostWysłany: Czw 10:30, 14 Lut 2008    Temat postu:

Proszę bardzo Smile


Kod:

<script language="JavaScript1.2">

//Autumn leaves- by Kurt Grigg (kurt.grigg@virgin.net)
//Modified by Dynamic Drive for NS6 functionality
//visit http://www.dynamicdrive.com for this script

//Pre-load your image below!
grphcs=new Array(3)
Image0=new Image();
Image0.src=grphcs[0]="http://img476.imageshack.us/img476/1262/79cceacb46cbqx4.png";
Image1=new Image();
Image1.src=grphcs[1]="http://img476.imageshack.us/img476/1262/79cceacb46cbqx4.png";
Image2=new Image();
Image2.src=grphcs[2]="http://img476.imageshack.us/img476/1262/79cceacb46cbqx4.png";

Amount=12; //Smoothness depends on image file size, the smaller the size the more you can use!
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;
for (i=0; i < Amount; i++){
    Ypos[i] = Math.round(Math.random()*WinHeight);
    Xpos[i] = Math.round(Math.random()*WinWidth);
    Speed[i]= Math.random()*2+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(30*Math.PI/100);
        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()*2+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>


PS. mmarta132 - usuń swojego posta o podobnej treści z innego tematu


Post został pochwalony 0 razy
Powrót do góry
Zobacz profil autora
mmarta132
Amator postów
Amator postów



Dołączył: 29 Lis 2006
Posty: 56
Przeczytał: 0 tematów

Ostrzeżeń: 1/5
Skąd: Olsztyn

PostWysłany: Czw 10:35, 14 Lut 2008    Temat postu:

Dziękuję bardzo - super serduszka.
tamten post zaraz usunę.


Post został pochwalony 0 razy
Powrót do góry
Zobacz profil autora
Wyświetl posty z ostatnich:   
Napisz nowy temat   Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi    Forum www.forum.fora.pl Strona Główna -> Pomoc i pytania Wszystkie czasy w strefie EET (Europa)
Strona 1 z 1

 
Skocz do:  
Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach


fora.pl - załóż własne forum dyskusyjne za darmo
Powered by phpBB © 2001, 2005 phpBB Group
deoxGreen v1.2 // Theme created by Sopel stylerbb.net & programosy.pl

Regulamin