maincg,
добавил
Сообщение от maincg
|
(parent/not parent)
|
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<style type="text/css">
dd{
display: none;
}
.arrow_right{
background-color: #FF3300;
}
.arrow_down{
background-color: #FFFF33;
}
</style>
</head>
<body>
<dl id="left_menu">
<dt>Item 1</dt>
<dt>Item 2</dt>
<dd>SubItem 2.1</dd>
<dt>Item 3</dt>
<dd>SubItem 3.1</dd>
<dt>Item 4</dt>
<dt>Item 5</dt>
<dd>SubItem 5.1</dd>
</dl>
<script>
$ ("dt").prev("dt").addClass("arrow_right");
$ ("dd").prev("dt").addClass("arrow_down")
.click(function (event) {
$(this).nextUntil('dt').slideToggle()
})
</script>
</body>
</html>