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
| <!DOCTYPE html>
<html>
<head>
<meta charset="iso-8859-1" />
<style>
/* #element */
/* { */
/* background-color: lightblue; */
/* width:35px; */
/* height:20px; */
/* } */
/* .drag1 */
/* { */
/* background-color: lightblue; */
/* width:35px; */
/* height:20px; */
/* } */
/* .drag2 */
/* { */
/* background-color: blue; */
/* width:35px; */
/* height:20px; */
/* } */
/* #invalid,#resultat, */
/* #accordeon */
/* { */
/* background-color: lightblue; */
/* left:200px; */
/* width:135px; */
/* height:120px; */
}
#invalid
{
background-color: lightblue;
left:200px;
width:35px;
height:20px;
}
.ui-selecting{
background:white;
}
.ui-selected{
background:black;
color:#fff;
}
#selection{
background-color: green;
left:500px;
width:80px;
height:80px;
}
.help{
border : 1px solid #1877D5;
background : #84BEFD;
opacity : 0.3;}
</style>
<title>Votre titre</title>
<!-- inclusion du style CSS de base -->
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/themes/smoothness/jquery-ui.css" />
</head>
<body>
<ul id="accordeon">
<li class="titre"><a href="#">Section 1</a></li>
<li>Contenu de la section 1</li>
<li class="titre"><a href="#">Section 2</a></li>
<li>Contenu de la section 2</li>
<li class="titre"><a href="#">Section 3</a></li>
<li>Contenu de la section 3</li>
</ul>
<script src="jquery3.4.1"></script>
<!-- inclusion des libraries jQuery et jQuery UI (fichier principal et plugins) -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/jquery-ui.min.js"></script>
<script>
$(document).ready(function(){
// $('#element').draggable(); // appel du plugin
// $('.drag1').draggable({
// });
// // le bloc ayant pour classe la valeur "drag1" ne pourra être déplacé qu'au niveau horizontal
// $('.drag2').draggable({
// });
// $('#selection').selectable({
// stop : function(){
// $('#resultat').empty(); // je vide mon bloc de réception, au cas où il contiendrait déjà des informations (vous pouviez aussi utiliser la méthode text())
// $('.ui-selected').each(function(){
// $('#resultat').append( $(this).text() + ' ; ' ); // j'ajoute les données dans mon bloc grâce à append()
// });
// }
// });
// $('#selection').selectable({
// unselected : function(){
// alert('Vous venez de désélectionner un élément.');
// }
// });
// $('#accordeon').accordion(); // appel du plugin
// $('#accordeon').accordion({
// header : '.titre'
// });
// });
$('#accordeon').accordion({
header : '.titre'
});
});
</script>
</body>
</html> |
Partager