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
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="fr">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type" />
<script src="js/jquery.js" type="text/javascript"></script>
<title>page de test</title>
<script type="text/javascript">
<!--
$(document).ready(function() {
$("ul").not(":first").children("li").hide();
$("ul:first").addClass("actif");
$("h4").click(function() {
if ($(this).next("ul").hasClass("actif")) {
$(this).next("ul").children("li").slideUp("slow");
$(this).next("ul").removeClass("actif");
} else {
$("h4").next("ul")
.removeClass("actif")
.children("li").slideUp("slow");
$(this).next("ul")
.addClass("actif")
.children("li").slideDown("slow");
}
});
});
//-->
</script>
</head>
<body>
<h4>titre1</h4>
<ul>
<li id="a">blabla</li>
<li id="aa">blabla</li>
<li>blabla</li>
</ul>
<h4>titre2</h4>
<ul id="b">
<li id="c">blabla</li>
<li id="e">blabla</li>
<li>blabla</li>
</ul>
</body>
</html> |