[jQuery] Animating marginBottom not working
Dear All,
I have written the following code, which slides the div #menu away
from view 'below' the browser window.
The first part, triggered by #hidemenu, works perfectly. However, the
second part, triggered by #showmenu, has no effect at all?!
I need the div #menu to be restored back to its original position when
#showmenu is hovered over. How can I achieve this?
<script language="javascript">
$(document).ready(function() {
$("#hidemenu").hover(function(){
$("#menu").animate({
opacity: 0.4,
marginBottom: "-72px"
}, 1000 );
});
$("#showmenu").hover(function(){
$("#menu").animate({
opacity: 1.0,
marginBottom: "0px"
}, 1000 );
});
});
</script>
Thank you for your help. I'm open to any recommendations - I know my
code is poor quality!