StormBreaker ми помогна с един код, но незнам нещо не работи както трябва сега. Като натисна единия бутон всичко е наред, но като натисна втория той се скрива вместо да се показва. Ето кода:
Код:
<script src="../jquery-1.3.2.js" type="text/javascript"></script>
<script>
var shown = false;
function toggleMenu(div) {
if ( shown ) hideMenu(div);
else showMenu(div);
}
function showMenu(div) {
$(div).animate({"left": "+=110px"}, "slow");
shown = true;
}
function hideMenu(div) {
$(div).animate({"left": "-=110px"}, "slow");
shown = false;
}
</script>
</script>
<style>
#aa {
width: 200px;
height: 40px;
background: url("../images/stripes.png");
position: fixed;
left: -150px;
font-family: Times New Roman;
font-size: 20px;
}
#bb {
width: 200px;
height: 40px;
background: url("../images/stripes.png");
position: fixed;
left: -150px;
font-family: Times New Roman;
font-size: 20px;
text-align: left;
}
#cc {
width: 200px;
height: 40px;
background: url("../images/stripes.png");
position: fixed;
left: -150px;
font-family: Times New Roman;
font-size: 20px;
}
</style>
<div id="aa" align="center" onclick="toggleMenu('#aa')">
<a href="#">Текст</a>
</div><br/><br/>
<div id="bb" align="center" onclick="toggleMenu('#bb')">
<a href="#">Текст 2</a>
</div><br/><br/>
<div id="cc" align="center" onclick="toggleMenu('#cc')">
<a href="#">Текст 3</a>
</div><br/><br/>