Hello,

j'utilise Mootools et j'ai un conflit entre ces fonctions:


js:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
window.addEvent('domready', function() {
 
	var highlight = $$('.highlighting');
 
	highlight.each(function(h) {
		h.addEvent('click', function(e) {
			e = new Event(e);
			this.highlight('#eeeeaa');
			e.stop();
		});
	});
 
});
 
 
window.addEvent('domready', function() {
	$('format').getElements('input').addEvent('click', function() {
	$('selection-format').innerHTML = this.id;
	});
});
html:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
<fieldset id="format">
	<p><label class="highlighting">
	<img src="js/chk_on.png" id="img_radio_cd" alt="Bouton radio" />
	<input id="cd" onclick="turnImgRadio3(this)" type="radio" checked="checked" value="cd" name="format" /><strong>édition CD</strong>
	</label> ou</p>
	<p><label class="highlighting">
	<img src="js/chk_off.png" id="img_radio_dvd" alt="Bouton radio" />
	<input id="dvd" onclick="turnImgRadio3(this)" type="radio" value="dvd" name="format" /><strong>édition DVD</strong>
	</label> ?</p>
</fieldset>
si j'enléve la fonction highlight (pour faire un effet d'opacité au click sur <label> ), la fonction pour connaitre quel input est selectionné (qui va inscrire le résultat dans un <span id="selection-format"></span>) fonctionne... j'en déduit un problème mais je ne vois pas ou :/

merci


[edit: je précise qu'au départ, les deux fonctions ensemble ne fonctionne pas.]

++