Bonsoir,
J'ai un souci d'héritage des événements en javascript.
Pouvez-vous prendre un peu de votre temps pour m'aider ?
la fonction "envoiDetails()" ne doit pas s'exécuter quand je clique sur comparer (case + label) !
Je retourne le code dans tous les sens, je n'y arrive pas !
Ceci doit fonctionner sous IE7+, FF, Chrome, Opera, safari...
Pouvez-vous m'aider ?
D'avance, un immense merci !
Voici le code :
Code js : 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
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78 function liretablejson(jtable) { oTable = "<table cellpadding='0' cellspacing='0' border='0'>"; oTable += "<tbody>"; oCol = 0; oLig = 0; aData = jtable.aaData; triref = jtable.iTotalDisplayRecords; maxref = jtable.iTotalRecords; if (triref < (oFinArticle+1)) { oFinArticle = triref - 1; } for (var ilire = oDebArticle; ilire <= oFinArticle; ilire++) { Data = aData[ilire]; finition = Data[1]; switch (finition) { case "WG": matiere = "Or blanc"; break; case "YG": matiere = "Or jaune"; break; case "PT": matiere = "Platine"; break; default: matiere = "nc"; break; } description = Data[4]; oCol++; if (oCol == 1) { oTable += '<tr>'; oLig++; } oCellule = "<td>"; oCellule += "<div class='case' onmouseover='search(" + oLig + ", " + oCol + ", \"" + Data[0] + "\");' onmouseout='nosearch();' onClick='envoiDetails(\"" + Data[0] + "\");'>"; oCellule += " <img class='image_1m invisible' src='" + dossvue02+Data[11] + "' alt='bague' />"; oCellule += " <img class='image_1 invisible' src='" + dossvue02+Data[11] + "' alt='bague' />"; oCellule += " <img class='image_0' src='" + dossvue01+Data[10] + "' alt='bague' />"; oCellule += " <div class='comp' id='tag" + Data[0] + "' alt='recherche'>"; oCellule += " <input id='comparer[\"" + Data[0] + "\"]' type='checkbox' class='curseur' onClick='acomparer(\"" + Data[0] + "\");'>"; oCellule += " <label for='comparer[\"" + Data[0] + "\"]'> Comparer</label>"; oCellule += " </div>"; oCellule += " <img class='loupe invisible' src='diamants/images/general/loupenoire.gif' alt='recherche' />"; oCellule += " <div class='informations'>"; oCellule += " <p class='case01'>"+Data[2]+" - <span class='grisfonce c11'>" + matiere + "</span></p>"; oCellule += " <p class='case02'><span class='grisfonce'>" + description.slice(0,70) + "...</span></p>"; oCellule += " <p class='case03'>"+Data[6]+" €</p>"; oCellule += " </div>"; oCellule += "</div>"; oCellule += "</td>"; oTable += oCellule; if (oCol == mCol || ilire == oFinArticle) { oCol = 0; oTable += '</tr>'; } } oTable += "</tbody>"; oTable += "</table>"; document.getElementById("bloc3102").innerHTML=oTable; } function acomparer(sref) { alert(sref); var swTrouve=-1; for (var k=0; k<ckComparer.length; k++) { if (ckComparer[k] == sref) { swTrouve=k; k=ckComparer.length; } } if (swTrouve < 0) { ckComparer.push(sref); } else { ckComparer[swTrouve] = 0; } }
Partager