html - slidedown menu, synchronise sliding content jquery -
hi have built simple slide down menu jquery , can found @ http://testsiteproject.bugs3.com/
my question rises when click on grey top button, want black button follow down menu instead of appearing after div has slided down. there way achieve this?
<div id="topmenu"> <div id="top-top"></div> <a href='javascript:slidemenuup();'> <div id="top-bottom"></div> </a> </div>
i should slide down "topmenu" includes both "top-top" , "top-bottom". slides "top-top".
function slidemenu(){ if ($("#topmenu").is(":hidden")) { $("#topmenu").slidedown("slow"); } else { $("#topmenu").hide(); } }
what if try positioning whole #topmenu
div off screen (with negative top value), animating on top
property instead of slidedown
.
a quick mockup of mean:
fiddle:
http://jsfiddle.net/vleyf/
js:
$("#topmenu").animate({top: 0}, "slow");
then here can animate whatever top
property had before etc. however, looking @ spokey's answer, you'll still need part of (switch #top-bottom
position:absolute
position:relative
).