When I click on a Div Ul that I've inserted, it displays. Here's the corresponding code snippet:
<div class="menu-item">menu title</div>
<div class="plus"></div>
<div class="minus"></div>
<ul class="sub-item-menu">
<a href="index.php"><li>text</li></a>
<a href="index.php"><li>text</li></a>
<a href="index.php"><li>text</li></a>
<a href="index.php"><li>text</li></a>
<a href="index.php"><li>text</li></a>
<a href="index.php"><li>text</li></a>
</ul>
<div class="menu-item">title</div>
<div class="plus"></div>
<div class="minus"></div>
<ul class="sub-item-menu">
<a href="index.php"><li>text</li></a>
<a href="index.php"><li>text</li></a>
<a href="index.php"><li>text</li></a>
</ul>
</div>
Using jQuery:
$('.plus').click(function () {
$('.sub-item-menu').slideDown();
$('.plus').fadeOut(200);
$('.minus').fadeIn(1000);
});
$('.minus').click(function () {
$('.minus').fadeOut(2);
$('.sub-item-menu').slideUp();
$('.plus').fadeIn(1000);
});
CSS Style:
.plus {
width:22px;
height:22px;
background:url(images/plus.png) no-repeat;
float:left;
margin-top:-27px;
margin-left:-5px;
cursor:pointer;
}
.minus {
width:22px;
height:22px;
background:url(images/minus.png) no-repeat;
float:left;
margin-top:-27px;
margin-left:-5px;
display:none;
cursor:pointer;
}
.menu-item {
background:url(images/menu-asli.png) repeat-x;
width:197px;
height:30px;
margin-top:1px;
font-family:"B Yekan";
font-size:16px;
padding-top:3px;
padding-right:3px;
margin-bottom:-2px;
}
.sub-item-menu, .sub-item-menu2 {
margin-top:3px;
width:198px;
margin-right:1px;
display:none;
font-family:"B Yekan";
font-size:14px;
}
.sub-item-menu a:link {
text-decoration:none;
}
.sub-item-menu li {
background:#ff0084;
margin-bottom:1px;
padding-right:3px;
color:#FFF;
}
However, clicking on one of the menus and sub-menus causes both to be displayed simultaneously.
Thanks.