Zdravim,
Potreboval jsem na stranky dat slideshow, .. img, ve kterem se zhruba po 2-3 sekundach prekresluje asi 5 ruznych pictures.
Na netu jsem nasel jedno, ktery mi vygenerovalo tenhle kod:
<!-- zacatek scriptu na slideshow pro head-->
<script language="JavaScript1.1" type="text/javascript">
var slideimages=new Array()
/* var slidelinks=new Array() */
function slideshowimages(){
for (i=0;i<slideshowimages.arguments.length; i++){
slideimages[i]=new Image()
slideimages[i].src=slideshowimages.arguments[i]
}
}
function slideshowlinks(){
for (i=0;i<slideshowlinks.arguments.length;i++)
slidelinks[i]=slideshowlinks.arguments[i]
}
function gotoshow(){
if (!window.winslide||winslide.closed)
winslide=window.open(slidelinks[whichlink])
else
winslide.location=slidelinks[whichlink]
winslide.focus()
}
</script >
<!-- konec scriptu na slideshow pro head -->
<!-- zacatek slideshow body -->
<a href="javascript:gotoshow()"><img src="images/banners/banner1.png" name="slide" border="0" width="950" alt=""></a>
<script>
slideshowimages("images/banners/banner1.png","images/banners/banner2.png","images/banners/banner3.png","images/banners/banner4.png")
// slideshowlinks("http://blabla1","http://blabla2","http://blabla3","http://blabla4")
//configure the speed of the slideshow, in miliseconds
var slideshowspeed=2000
var whichlink=0
var whichimage=0
function slideit(){
if (!document.images)
return
document.images.slide.src=slideimages[whichimage].src
whichlink=whichimage
if (whichimage<slideimages.length-1)
whichimage++
else
whichimage=0
setTimeout("slideit()",slideshowspeed)
}
slideit()
</script>
<!-- konec slideshow body -->
jenze pri validaci na http://validator.w3.org/ mi to haze treba tyhle chyby:
a podobne, vypis vsech chyb je tady http://validator.w3.org/check?uri=www.dyzon.xf.cz&charset=%28detect+automatically%29&doctype=Inline&group=0
javascript moc neovladam a nevim, jak tyhle chyby odstranit.poradite mi prosim nekdo co s tim ??
nebo mozna jeste lip, treba nejakej jednodussi validni script na meneni 5 obrazku po 2 sekundach s tim, ze obrazky jsou s pruhlednym pozadim, takze pred jejich prepsanim je potreba ten predchozi smazat. nechci zadny efekty ani zbytecny sipky a podobne, chci jen dokola menit par fotek v jednom Img.
budu moc vdecny, dekuji.