Hei..Voisiko joku olla niin kiva että neuvoisi mihin kohtaan tuohon laitetaan se "url" osoite että tuo lumihiutale näkyy?
Olen yrittänyt laittaa sen tuohon mitä ohjeessakin sanotaan ihan oikein on ollut "url" osoite mutta mitään ei näy..eli varmaan väärässä kohtaa..
Alla koko koodirykelmä sellaisenaan kuin se kopsattukkin ilmaan mitään muutoksia..
/******************************************
* 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="snow.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("");
} else {
document.write("");
}
}
}
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; i0)
setTimeout("hidesnow()", hidesnowtime*1000)
}
Terv:SweetHot
Olen yrittänyt laittaa sen tuohon mitä ohjeessakin sanotaan ihan oikein on ollut "url" osoite mutta mitään ei näy..eli varmaan väärässä kohtaa..
Alla koko koodirykelmä sellaisenaan kuin se kopsattukkin ilmaan mitään muutoksia..
/******************************************
* 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="snow.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("");
} else {
document.write("");
}
}
}
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; i0)
setTimeout("hidesnow()", hidesnowtime*1000)
}
Terv:SweetHot
Vastaukset 8
Vanhimmat
//Configure below to change URL path to the snow image
var snowsrc="snow.gif"
Siis tuon snowsrc-muuttujan arvoksi täytyy laittaa se URL-osoite, josta lumihiutalekuva löytyy. Esimerkiksi
var snowsrc="http://www.omasivu.com/kuvat/snow.gif "
Laitetaanko se tuohon kohtaan -->snowsrc=(snowsrc.indexOf("dynamicdrive.com")!=-1)? "snow.gif" siis vaihdetaan se oikea osoite mistä kuva tulee?
Anteeksi tyhmyyteni..
SweetHot
Kuvan osoite laitetaan aivan sinne alkuun.
/******************************************
* 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="snow.gif"
tuo vaikka tein ohjeen mukaan..ei näkynyt mitään..
SweetHot
Oletko varmasti lisännyt JavaScript-koodin sivun BODY-osioon? Itse kokeilin alla olevaa mallisivua, joka omien testieni perusteella toimii moitteetta ainakin Operalla, Firefoxilla ja Internet Explorerilla. Testaamista varten kopioin kuvan http://www.dynamicdrive.com/dynamicindex3/snow.gif samaan hakemistoon mallisivun kanssa, joten lumisadekoodi ei vaatinut mitään muutoksia.
Testi
/******************************************
* 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="snow.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("");
} else {
document.write("");
}
}
}
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; i0)
setTimeout("hidesnow()", hidesnowtime*1000)
}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
Kiitos hyvistä ohjeista mutta kun kopsasin tuon testijutun allaolevan tuollaisenaan niin näkyy samallaista eli lumisateen tilalla punasia ristiä tippuilee..Olen ladannut lumihiutaleen omalle kotisivupalvelimelle siellä olevaan kuvatiedostoon ja mulla on "snow3.gif" siellä..
Mihin kohtaan tarkalleen se "URL osoite" tulee?
osaan kyllä tavallista kuvaa linkittää sivuille jne. niin mikähän tässä on niin vaikeeta..:-)
Tuossa on mun testilumihiutaleen osoite,tuolta siellä näyttää,vielä..-->http://koti.mbnet.fi/jengas1/lumihiutale.html
harjoittelen tuossa niinkauan kuin onnistuu ja sitten vasta siirrän varsinaiselle kotisivulle.:-)
SweetHot
... ja oksettaa tällaset javaskriptihässäkät, mut katsoin et mitä täs on värkätty.
No, koodissa on "snow.gif" mutta sellaista ei hakemistossa ole. Hakemistossa on kyllä tuo mainitsemasi "snow3.gif".
Tuossa taisikin jo edellinen kirjoittaja antaa vastauksen, mutta toisto on opintojen isä. Eli jos kerran olet kopioinut tiedoston snow3.gif omalle palvelimellesi, niin silloin JavaScript-koodissa täytyy lukea seuraavaa:
var snowsrc="snow3.gif"
Jos käytössä onkin kuvatiedosto snow.gif (kuten esimerkkisivullani), koodin täytyy olla muodossa
var snowsrc="snow.gif"
Kyseinen rimpsu löytyy siis aivan sieltä koodin alkupäästä kohdasta, jossa snowsrc mainitaan ensimmäisen kerran (JavaScript-koodin kymmenes rivi).