Tulos
Koodi
Tämä tulee BODY-osastoon
<script type="text/javascript">
<!--
// Original: Premshree Pillai & Dynamic Drive
// http://www.qiksearch.com/javascripts.htm
// Modified: Osmo Saarikumpu 2002-05-17
// Otsikot:
var Viestit = new Array(
"JavaScript-esimerkkejä ja generaattoreja",
"DHTML-esimerkkejä",
"Hakutyökaluja tehokkaaseen tiedonhakuun",
"Sekalaisia viritelmiä" ); // ei pilkkua viimeisen jälk.
// Otsikoita vastaavat osoitteet:
var Linkit = new Array(
"http://weppipakki.com/js.htm",
"http://weppipakki.com/dhtml.htm",
"http://weppipakki.com/haut.htm",
"http://weppipakki.com/avut.htm" ); // ei pilkkua viimeisen jälk.
var Leveys=350 // tangon leveys kuvapisteinä
var Viive=6000 // viestien väli millisekuntteina
var VariOn='#E1FFE1' // osoitinpäälläväri
var VariOut='#FFFFFF' // oletusväri
var count=0;
var ns6=document.getElementById&&!document.all
var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1
if (ie4||ns6){
document.write('<form name="Tanko"><input type="button" value="<-" onclick="Siirry(0)" style="width:2em;height:23px;border-right-width:0px;" name="prev" title="Edellinen"><input type="button" name="Nappi" onclick="Nouda();" style="color:#000;background:#FFF;width:'+Leveys+'px;height:22px;border-width:1px; border-color:#000;cursor:hand" onmouseover="this.style.background=VariOn" onmouseout="this.style.background=VariOut"><input type="button" value="->" onclick="Siirry(1)" style="width:2em;height:23px;border-left-width:0px;" name="next" title="Seuraava"></form>');
}
else{
document.write('<form name="Tanko"><input type="button" value="<-" onclick="Siirry(0)">')
if (navigator.userAgent.indexOf("Opera")!=-1)
document.write('<input type="button" name="Nappi" onclick="Nouda();" style="width:'+Leveys+'px" border="0">')
else
document.write('<input type="button" name="Nappi" onclick="Nouda();" width="'+Leveys+'px" border="0">')
document.write('<input type="button" value="->" onclick="Siirry(1)"></form>')
}
function init_Tanko(){
document.Tanko.Nappi.value=Viestit[count];
}
function Siirry(Miten){
if (Miten==1){ //eteenpäin
if (count<Viestit.length-1)
count++
else
count=0
}
else{ //taaksepäin
if (count==0)
count=Viestit.length-1
else
count--
}
document.Tanko.Nappi.value=Viestit[count];
}
setInterval("Siirry(1)",Viive)
function Nouda(){
location.href=Linkit[count];
}
init_Tanko();//-->
</script>
