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 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<html>
<body>
<!-- Bouton radio de la question 1 -->
<form name="question1">
Choix 1 <input type="radio" name="question1" value="radio">
Choix 2 <input type="radio" name="question1" value="radio">
Choix 3 <input type="radio" name="question1" value="radio">
Choix 4 <input type="radio" name="question1" value="radio">
Choix 5 <input type="radio" name="question1" value="radio">
Choix 6 <input type="radio" name="question1" value="radio">
<input type="button" name="bout" value="Tester" onClick="teste()">
</form>
<SCRIPT language="javascript"> // Fonction qui récupére les résultats
function teste() {
var m=0;
for (i=0;i<6;i++) {
if (document.forms.question1.question1[i].checked==true) {
m=i;
alert("C'est le choix "+Number(i+1)+" qui est sélectionné");
localStorage.setItem('data1', +Number(i+1));
var myVar = localStorage.getItem('data1');
break;
}
}
}
</script>
<form name="question2"> <!-- Idem que la question 1 -->
Choix 1 <input type="radio" name="question2" value="radio">
Choix 2 <input type="radio" name="question2" value="radio">
Choix 3 <input type="radio" name="question2" value="radio">
Choix 4 <input type="radio" name="question2" value="radio">
Choix 5 <input type="radio" name="question2" value="radio">
Choix 6 <input type="radio" name="question2" value="radio">
<input type="button" name="bout" value="Tester" onClick="teste1()">
</form>
<SCRIPT language="javascript">
function teste1() {
var m=0;
var myVar;
for (i=0;i<6;i++) {
if (document.forms.question2.question2[i].checked==true) {
m=i;
alert("C'est le choix "+Number(i+1)+" qui est sélectionné");
localStorage.setItem('data2', +Number(i+1));
var myVar = localStorage.getItem('data2');
break;
}
}
}
</script>
<script type="text/javascript"> // Fonction pour cacher le schéma
function afficher_cacher(id)
{
if(document.getElementById(id).style.visibility=="hidden")
{
document.getElementById(id).style.visibility="visible";
document.getElementById('bouton_'+id).innerHTML='Cacher le texte';
}
else
{
document.getElementById(id).style.visibility="hidden";
document.getElementById('bouton_'+id).innerHTML='Afficher le texte';
}
return true;
}
</script>
<span class="bouton" id="bouton_texte" onclick="javascript:afficher_cacher('texte');">Afficher le texte</span>
<div id="texte" class="texte">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas nisl. Phasellus
<script src="http://www.amcharts.com/lib/3/amcharts.js" type="text/javascript">// data du schéma radar</script>
<script src="http://www.amcharts.com/lib/3/radar.js" type="text/javascript"></script>
<div id="chartdiv" style="width: 100%; height: 362px;"></div>
<script type="text/javascript">
var chart;
var chartData = [
{
"country": "Czech Republic",
"litres": 15
},
{
"country": "Ireland",
"litres": 131.1
},
{
"country": "Germany",
"litres": 115.8
},
{
"country": "Australia",
"litres": 109.9
},
{
"country": "Austria",
"litres": 108.3
},
{
"country": "UK",
"litres": 99
}
];
AmCharts.ready(function () {
// RADAR CHART
chart = new AmCharts.AmRadarChart();
chart.dataProvider = chartData;
chart.categoryField = "country";
chart.startDuration = 2;
// VALUE AXIS
var valueAxis = new AmCharts.ValueAxis();
valueAxis.axisAlpha = 0.15;
valueAxis.minimum = 0;
valueAxis.dashLength = 3;
valueAxis.axisTitleOffset = 20;
valueAxis.gridCount = 5;
chart.addValueAxis(valueAxis);
// GRAPH
var graph = new AmCharts.AmGraph();
graph.valueField = "litres";
graph.bullet = "round";
graph.balloonText = "[[value]] litres of beer per year";
chart.addGraph(graph);
// WRITE
chart.write("chartdiv");
});
</script>
</div>
<script type="text/javascript">
//<!--
afficher_cacher('texte');
//-->
</script>
</body>
</html> |
Partager