Eklablog Tous les blogs
Editer l'article Suivre ce blog Administration + Créer mon blog
MENU

Masquer/afficher


Par Rimoussitta :)

Voici un code assez sympa qui permet en cliquant sur le bouton d'afficher un autre texte ou une image !

Voici le code :

<div style="text-align: center;">
<div class="c1" onclick="pchild=this.getElementsByTagName('p'); if(pchild[0].style.visibility!='hidden'){pchild[0].style.visibility='hidden'; pchild[0].style.height='0';}else{pchild[0].style.visibility=''; pchild[0].style.height=''}"><span style="color: #000000; font-weight: bold;"><span style="font-family: georgia;"> <input class="voteJoueur ui-button ui-widget ui-state-default ui-corner-all" type="submit" value="Clique ici" /></span></span><br style="color: #ffffff;" />
<p style="text-align: center; font-family: georgia;"><span style="font-family: arial,helvetica,sans-serif;"><strong><span style="color: #333333;">Surprise !</span></strong></span></p>

 

  • Les champs en jaune sont essentiellement ceux qui doivent être modifiés, la phrase "Clique ici" sera sur le bouton et la phrase "Surprise!" sera celle qui apparaitra quand on clique sur le bouton. 
  • On peut faire a même chose avec une image ou avec plusieurs codes divers, par exemple le code de l'image :

 

<div style="text-align: center;">
<div class="c1" onclick="pchild=this.getElementsByTagName('p'); if(pchild[0].style.visibility!='hidden'){pchild[0].style.visibility='hidden'; pchild[0].style.height='0';}else{pchild[0].style.visibility=''; pchild[0].style.height=''}"><span style="color: #000000; font-weight: bold;"><span style="font-family: georgia;"> <input class="voteJoueur ui-button ui-widget ui-state-default ui-corner-all" type="submit" value="Clique ici" /></span></span><br style="color: #ffffff;" />
<p style="text-align: center; font-family: georgia;"><span style="font-family: arial,helvetica,sans-serif;"><strong><span style="color: #333333;"><img src="L'adresse de l'image" alt="" /></span></strong></span></p>
Retour à l'accueil
Partager cet article
Repost0
Pour être informé des derniers articles, inscrivez vous :
Commenter cet article
L
je vais essayer
Répondre
M
Je ne voudrais pas faire de la pub négative, mais ce code est dans le blog de LiseFleur...
Répondre
M
tu l'a ?!
Répondre
M
ce serai cool ^^
Répondre
R
D'accord je vais le chercher ! ^^
Répondre