Bonjour !

J'essaye de coder une interface graphique en html avec des scripts java.
Je voudrais faire une fonction de drag & drop mais je ne sais pas trop comment m'y prendre.
Il s'agit en fait de droper des stations (dans la colonne de gauche) sur une carte (au centre). Que la station d'efface alors de la liste et qu'elle apparaîsse à l'endroit voulu sur la carte.

Quelqu'un pour m'aider?

Je colle mon code.

Code html : 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<!DOCTYPE html>
<html>
<head><!-- En-tête de la page -->
<meta charset="utf-8" />
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link rel="stylesheet" href="styleStart.css">
<link rel="stylesheet" href="styleRadioLink.css">
<link rel="stylesheet" href="dnd.css">
 
<script language="javascript">
	function drag(target, evt) {
		evt.dataTransfer.setData("Text", target.id);
	}
	function drop(target, evt) {
		var id = evt.dataTransfer.getData("Text");
		target.appendChild(document.getElementById(id));
		evt.preventDefault();
	}
</script>
<script src="_html5detect.js"></script>
<script>isAttributeSpecified("cr", "ondragstart")</script>
 
<title>PS21e</title>
</head>
 
<body> <!-- Corps de la page -->  
<header> 
<!-- Logos-->
<img class="logo" src="Thales_logo.jpg" alt="Logo Thales" id="thales" />
<img class="logo" src="System21.jpg" alt="Logo System 21" id="S21"/><br/>
</header>
 
<nav>
<!--Barre de navigation avec les onglets et le bouton "help"-->
<ul id="onglets">
<li class="inactive" >START</li>
<li class="inactive">SAT & TRANSPONDERS</li>
<li class="active">STATIONS</li>
<li class="inactive">RADIO LINKS</li>
</ul>
</nav>
 
<section id="corpsOnglet">  
 
<label for="Direct-Connectivity" style="float: left;"> Direct-Connectivity <label/>
 
<section id="barreOutil">
<!-- Barre d'outil-->
</section>
 
<section id="cadreDnD">
<table border="1" cellspacing="1" width="30%" Style="text-align:center" align="center">
 
<tr>
<th width="30%"><span title="On-the-move terminal">Move</span></th>
<th width="30%"><span title="On-the-pause terminal">Fix</span></th>
<tr/>
 
<tr>
<td width="30%"><img src="move.png" alt="M1" title="M1" width="40" height="40" id="cr" ondragstart="drag(this, event)">M1<td/> <!-- On peut utiliser <button> -->
<td width="30%"><img src="fix.jpg" alt="F1" title="F1" width="40" height="40" id="cr" ondragstart="drag(this, event)">F1<td/>
<tr/>
 
<tr>
<td width="23%"><img src="move.png" alt="M2" title="M2" width="40" height="40" ondragstart="drag(this, event)">M2<td/>
<td width="23%"><img src="fix.jpg" alt="F2" title="F2" width="40" height="40" ondragstart="drag(this, event)">F2<td/>
<tr/>
 
<tr>
<td width="23%"><img src="move.png" alt="M3" title="M3" width="40" height="40" ondragstart="drag(this, event)">M3<td/>
<td width="23%"><img src="fix.jpg" alt="F3" title="F3" width="40" height="40" ondragstart="drag(this, event)">F3<td/>
<tr/>
 
<tr>
<td width="23%"><img src="move.png" alt="M4" title="M4" width="40" height="40">M4<td/>
<td width="23%"><img src="fix.jpg" alt="F4" title="F4" width="40" height="40">F4<td/>
<tr/>
 
<tr>
<td width="23%"><img src="move.png" alt="M5" title="M5" width="40" height="40">M5<td/>
<td width="23%"><img src="fix.jpg" alt="F5" title="F5" width="40" height="40">F5<td/>
<tr/>
 
</table>
</section>
 
<section id="cadreCentral">
<!--Carte-->
<img class="map" src="map.jpg" alt="Map" ondragover="return false" ondrop="drop(this, event)">  
</section>
 
<div style="clear:both"></div>
 
<section id="cadreStations">
<!--Fenêtre Edition d'une station-->
<h1>M1</h1>
<form method="post" action="traitement.php">
<p>
<label class="labelFormulaire" for="Latitude">Latitude (°)</label>
<input type=number name="latitude"><br>
<label class="labelFormulaire" for="Longitude">Longitude (°)</label>
<input type=number name="longitude"><br>   
<label class="labelFormulaire" for="Bandwidth">Altitude (m)</label>
<input type=number name="altitude"><br>
</p>
 
 
<fieldset>
<legend>Geographic advantage</legend> <!-- Titre du fieldset -->
<label class="labelFormulaire" for="Uplink">Uplink (dB)</label>
<input type=number name="uplink"><br>
<label class="labelFormulaire" for="Downlink">Downlink (dB)</label>
<input type=number name="downlink"><br>   
</fieldset>
 
<input class="button boutonFenetre" type="submit" value="Save"/>
<p id="Next" style="text-align: right"><input type="button" value="Next"></p>
 
 
</form>
</section>
 
</section>
 
 </body>
</html>

les css :

styleRadioLink
Code css : 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
.map{
 height : 100%;
 width : 100%;
}
 
/*Barre d'outil*/
label{
 display : inline-block; 
 height : 30px;
 border-radius : 3px;
 text-decoration: none;
 text-align : center;
 font: bold 12px Verdana, arial, serif;
 color : rgba(175, 65, 10, 0.8); 
 margin-left : 80px;
}
 
.labelFormulaire
 {
  margin : 0px; 
  width : 100px;
  padding-left : 5px;
 }
 
 
#findStation{
 width : 70px;
}
 
#cadreSubnet{
 display : inline-block;
 position : absolute;
 left : 1210px; 
 top : 170px; 
 height : 70%;
 width : 300px;
 background : rgba(175, 65, 10, 0.3);
 border-radius : 20px;
}
 
#cadreStations{
 display : inline-block;
 position : absolute;
 left : 1210px; 
 top : 270px; 
 height : 38%;
 width : 300px;
 background : rgba(175, 65, 10, 0.3);
 border-radius : 20px;
}
 
#cadreDnD{
display : inline-block;
position : absolute;
left : 50px; 
top : 170px; 
height : 70%;
width : 200px;
background : rgba(175, 65, 10, 0.3);
border-radius : 20px;
}
 
 .boutonFenetre
 {  position : absolute;
  margin-top : 20px;
  right : 10px;
 }
 
 #Next{
position: fixed;
right: 110px;
bottom: 0px;
z-index: 1;
}

styleStart
Code css : 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
.map{
 height : 100%;
 width : 100%;
}
 
/*Barre d'outil*/
label{
 display : inline-block; 
 height : 30px;
 border-radius : 3px;
 text-decoration: none;
 text-align : center;
 font: bold 12px Verdana, arial, serif;
 color : rgba(175, 65, 10, 0.8); 
 margin-left : 80px;
}
 
.labelFormulaire
 {
  margin : 0px; 
  width : 100px;
  padding-left : 5px;
 }
 
 
#findStation{
 width : 70px;
}
 
#cadreSubnet{
 display : inline-block;
 position : absolute;
 left : 1210px; 
 top : 170px; 
 height : 70%;
 width : 300px;
 background : rgba(175, 65, 10, 0.3);
 border-radius : 20px;
}
 
#cadreStations{
 display : inline-block;
 position : absolute;
 left : 1210px; 
 top : 270px; 
 height : 38%;
 width : 300px;
 background : rgba(175, 65, 10, 0.3);
 border-radius : 20px;
}
 
#cadreDnD{
display : inline-block;
position : absolute;
left : 50px; 
top : 170px; 
height : 70%;
width : 200px;
background : rgba(175, 65, 10, 0.3);
border-radius : 20px;
}
 
 .boutonFenetre
 {  position : absolute;
  margin-top : 20px;
  right : 10px;
 }
 
 #Next{
position: fixed;
right: 110px;
bottom: 0px;
z-index: 1;
}

dnd
Code css : 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
.dropper {
    width: 100%;
    height: 100%;
    background-color: #555;
    border: 1px solid #111;
 
    -moz-border-radius: 10px;
    border-radius: 10px;
 
    -moz-transition: all 200ms linear;
    -webkit-transition: all 200ms linear;
    -o-transition: all 200ms linear;
    transition: all 200ms linear;
}
 
.drop_hover {
    -moz-box-shadow: 0 0 30px rgba(0, 0, 0, 0.8) inset;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8) inset;
}
 
.draggable {
    display: inline-block;
    text-align: center;
    cursor: move;
 
    -moz-transition: all 200ms linear;
    -webkit-transition: all 200ms linear;
    -o-transition: all 200ms linear;
    transition: all 200ms linear;
 
    -moz-user-select: none;
    -khtml-user-select: none;
    -webkit-user-select: none;
    user-select: none;
}