Pereiti prie turinio

kaip padaryti toki scripta kai darai puslapio reload....


Rekomenduojami pranešimai

kaip padaryti toki scripta kai darai puslapio Reloading The Page (refresh)nuo kiekvieno padaryto reload pasikeice index,index1,index2?

 

 

Duosiu pavizduka cia kaip su images padaro :) o man reike su index.html

 

..........................................................................

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />

<title>Untitled Document</title>

<script LANGUAGE="JavaScript">

var theImages = new Array()

 

theImages[0] = 'Picture_Index_Left_Rotate_1.jpg'

theImages[1] = 'Picture_Index_Left_Rotate_2.jpg'

theImages[2] = 'Picture_Index_Left_Rotate_3.jpg'

theImages[3] = 'Picture_Index_Left_Rotate_4.jpg'

theImages[4] = 'Picture_Index_Left_Rotate_5.jpg'

 

var j = 0

var p = theImages.length;

var preBuffer = new Array()

 

for (i = 0; i < p; i++){

preBuffer = new Image()

preBuffer.src = theImages

}

var whichImage = Math.round(Math.random()*(p-1));

function showImage(){

if(whichImage==0){

document.write('<img src="'+theImages[whichImage]+'"></a>');

}

else if(whichImage==1){

document.write('<img src="'+theImages[whichImage]+'"></a>');

}

else if(whichImage==2){

document.write('<img src="'+theImages[whichImage]+'"></a>');

}

else if(whichImage==3){

document.write('<img src="'+theImages[whichImage]+'"></a>');

}

else if(whichImage==4){

document.write('<img src="'+theImages[whichImage]+'"></a>');

}

 

}

 

 

</script>

</head>

 

<body>

<div>

 

<table width="300" height="400" border="0" cellpadding="0" cellspacing="0">

<tr>

<td><script>showImage();</script></td>

</tr>

</table>

</div>

</body>

</html>

Nuoroda į pranešimą
Dalintis kituose puslapiuose
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
<title>Untitled Document</title>
<script LANGUAGE="JavaScript">
var theImages = new Array()

theImages[0] = 'index1.html' 
theImages[1] = 'index2.html' 
theImages[2] = 'index3.html' 
theImages[3] = 'index4.html'
theImages[4] = 'index5.html'

var j = 0
var p = theImages.length;
var preBuffer = new Array()

for (i = 0; i < p; i++){
preBuffer[i] = new Image()
preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
if(whichImage==0){
document.write('<a href="'+theImages[whichImage]+'"></a>');
}
else if(whichImage==1){
document.write('<a href="'+theImages[whichImage]+'"></a>');
}
else if(whichImage==2){
document.write('<a href="'+theImages[whichImage]+'"></a>');
}
else if(whichImage==3){
document.write('<a href="'+theImages[whichImage]+'"></a>');
}
else if(whichImage==4){
document.write('<a href="'+theImages[whichImage]+'"></a>');
}

}


</script>
</head>

<body>
<div>

<table width="300" height="400" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><script>showImage();</script></td>
</tr>
</table>
</div>
</body>
</html>

Nuoroda į pranešimą
Dalintis kituose puslapiuose

function showImage(){
if(whichImage==0){
document.write('<a href="'+theImages[whichImage]+'"></a>');
}
else if(whichImage==1){
document.write('<a href="'+theImages[whichImage]+'"></a>');
}
else if(whichImage==2){
document.write('<a href="'+theImages[whichImage]+'"></a>');
}
else if(whichImage==3){
document.write('<a href="'+theImages[whichImage]+'"></a>');
}
else if(whichImage==4){
document.write('<a href="'+theImages[whichImage]+'"></a>');
}

}

What the ######? Kam to IF, jei bet kokiu atveju tą patį darai?

 

function showImage(){
document.write('<a href="'+theImages[whichImage]+'"></a>');
}

Redagavo Silke
Nuoroda į pranešimą
Dalintis kituose puslapiuose

Prisijunkite prie diskusijos

Jūs galite rašyti dabar, o registruotis vėliau. Jeigu turite paskyrą, prisijunkite dabar, kad rašytumėte iš savo paskyros.

Svečias
Parašykite atsakymą...

×   Įdėta kaip raiškusis tekstas.   Atkurti formatavimą

  Only 75 emoji are allowed.

×   Nuorodos turinys įdėtas automatiškai.   Rodyti kaip įprastą nuorodą

×   Jūsų anksčiau įrašytas turinys buvo atkurtas.   Išvalyti redaktorių

×   You cannot paste images directly. Upload or insert images from URL.

Įkraunama...
  • Dabar naršo   0 narių

    Nei vienas registruotas narys šiuo metu nežiūri šio puslapio.

  • Prisijunk prie bendruomenės dabar!

    Uždarbis.lt nariai domisi verslo, IT ir asmeninio tobulėjimo temomis, kartu sprendžia problemas, dalinasi žiniomis ir idėjomis, sutinka būsimus verslo partnerius ir dalyvauja gyvuose susitikimuose.

    Užsiregistruok dabar ir galėsi:

    ✔️ Dalyvauti diskusijose;

    ✔️ Kurti naujas temas;

    ✔️ Rašyti atsakymus;

    ✔️ Vertinti kitų žmonių pranešimus;

    ✔️ Susisiekti su bet kuriuo nariu asmeniškai;

    ✔️ Naudotis tamsia dizaino versija;

    ir dar daugiau.

    Registracija trunka ~30 sek. ir yra visiškai nemokama.

  • Naujausios temos

  • Karštos temos

×
×
  • Pasirinkite naujai kuriamo turinio tipą...