Comment afficher du texte d'après une liste déroulante

Résolu
freesbee06 - 3 juil. 2013 à 18:07
 freesbee06 - 3 juil. 2013 à 22:23
Comment faire un diaporama pour afficher du texte dans un cadre(à la place d'une photo)d'après une liste déroulante. Je suis débutant, hé oui ! Si quelqu'un peut m'aider...Si je peux trouver un script tout fait (ou à modifier), ce serait super...N'étant pas capable de le faire moi-même mais toutefois étant capable de le modifier...

2 réponses

@karamel Messages postés 1854 Date d'inscription vendredi 9 mai 2008 Statut Modérateur Dernière intervention 8 avril 2024 153
3 juil. 2013 à 19:21
bonjour


quelque chose dans ce genre

<!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>

<script type="text/javascript">

var tbt= new Array("It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).",
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release ofLetraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",
"making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially"
);


function cate(lui){


document.getElementById('descriptif').firstChild.nodeValue=tbt[lui.value]  

dec++

if(dec>=tbt.length){
dec=0
}

}


</script> 
</head>


<select onchange='cate(this)'>

<option value=0>texte1</option>
<option value=1>texte2</option>
<option value=2>texte3</option>

</select>






Lorem Ipsum is simply dummy text of the printing and typesetting industry. 
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,
 when an unknown printer took a galley of type and scrambled it to make a type specimen book. 
 It has survived not only five centuries, but also the leap into electronic typesetting, 
 remaining essentially unchanged. It was popularised in the 1960s with the release of
 Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing 
 software like Aldus PageMaker including versions of Lorem Ipsum.







</html>


on pourait aussi utiliser innerHTML a la place de firstChild.nodeValue
3
Merci ! Super ! J'ai une base pour "travailler"...
0
Rejoignez-nous