| |||||||
| Développement web Pour les webmasters qui utilisent PHP, MySQL, AJAX, CSS, JavaScript, etc. |
![]() |
| | Outils de la discussion | Modes d'affichage |
| | | #1 | ||||||
| Accro à MacG Date d'inscription: 12/07/04 Localisation: $PWD
Messages: 4598
Disco: ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Bonjour. Je voudrais, pour une des pages de mon site (pas encore en ligne), qui comporte un tableaux, que quand on coche un checkbox, la ligne du tableau correspondante change de couleur de fond. Voilà mon code qui ne marche pas : Code: <table>
<tr style="backgound-color:#fff;" name="row1">
<td><input type="checkbox" onclick="row1.style.value='backgound-color:#ff9;'" /></td>
<td>azertyw</td>
<td>uiopqsd</td>
<td>fghjklm</td>
</tr>
</table>
Savez vous comment faire cela ?? merci | |||||||
| -------------------- | ||||||||
| | | |||||||
| | #2 | |||||||
| Accro à MacG Date d'inscription: 12/07/04 Localisation: $PWD
Messages: 4598
Disco: ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Personne ne peut m'aider ??
| |||||||
| -------------------- | ||||||||
| | | |||||||
| | #3 | ||
| Membre émérite Date d'inscription: 24/07/03 Localisation: Ottawa
Messages: 562
Disco: ![]() | Citation:
À placer dans le Head Code: <script language="JavaScript">
<!--
var backColor = new Array();
//mettre tes couleur ici
backColor[0] = '#FFFFFF';
backColor[1] = '#00FF00';
backColor[2] = '#0000FF';
backColor[3] = '#FFFFFF';
function changeBG(whichColor){
document.bgColor = backColor[whichColor];
}
//-->
</script>
Code: <!-- Pour un MouseOver Insere le chiffre de ta couleur que tu veux dans () de ChangeBG() //--> <a href="#" onMouseOver="javascript:changeBG(2)">Change</a> <!--Avec un clic de souris Insere le chiffre de ta couleur que tu veux dans () de ChangeBG() //--> <a href="javascript:changeBG(1)">Change</a> | ||
|
--------------------
----- It's nice to be important but it's more important to be nice.... | |||
| | | ||
| | #4 | |||||||
| Accro à MacG Date d'inscription: 12/07/04 Localisation: $PWD
Messages: 4598
Disco: ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
ton script marche, mais pas appliqué à mon problème : je n'arrive pas à accéder à ma ligne de tableau (comme on utilise document pour accéder à la page) Y a personne qui sait faire ça ? | |||||||
| -------------------- | ||||||||
| | | |||||||
| | #5 | ||
| Membre émérite Date d'inscription: 24/07/03 Localisation: Ottawa
Messages: 562
Disco: ![]() | Citation:
Code: <style>
.td1 { background-color: #990000;color : #ffffff; }
.td2 { background-color: #ffffcc;color : #336699; }
</style>
<table width=200 border=1>
<tr id="t1" class=td1 onClick=javascript:appelfn('t1')><td>ton texte</td><tr>
<tr id="t2" class=td1 onClick=javascript:appelfn('t2')><td>ton texte</td><tr>
<tr id="t3" class=td1 onClick=javascript:appelfn('t3')><td>ton texte</td><tr>
<tr id="t4" class=td1 onClick=javascript:appelfn('t4')><td>ton textet</td><tr>
</table>
<script language=javascript>
function appelfn(rno) {
for (i=1;i<=4;i++) {
document.getElementById('t'+i).className='td1';
}
var tmp = document.getElementById(rno);
tmp.className='td2';
}
</script>
| ||
|
--------------------
----- It's nice to be important but it's more important to be nice.... Dernière modification par Marc-André ; 24/11/2005 à 20h35. | |||
| | | ||
| | #6 | |||||||
| Accro à MacG Date d'inscription: 12/07/04 Localisation: $PWD
Messages: 4598
Disco: ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
youpi merci ^^ | |||||||
| -------------------- | ||||||||
| | | |||||||
![]() |
| Utilisateurs regardant la discussion actuelle : 1 (0 membre(s) et 1 invité(s)) | |
| Outils de la discussion | |
| Modes d'affichage | |
| |
Discussions similaires | ||||
| Discussion | Auteur | Forum | Réponses | Dernier message |
| Menu déroulant CSS + JS | @ybee | Développement web | 9 | 05/12/2006 13h26 |
| [CSS] Background url + color | tumb | Développement web | 4 | 26/01/2006 19h45 |
| Processus Automator qui clique sur le lien à l'intérieur d'un mail? | WebOliver | Mac OS X | 3 | 31/08/2005 10h42 |
| css et background | tumb | Développement web | 8 | 19/07/2004 10h37 |
| Dream affichage partiel background CSS | loudjena | Arts graphiques | 3 | 06/07/2004 15h14 |