tags:

views:

66

answers:

1

Is it possible to use .slideUp, but the object only slideUp by (For instance) by 20px instead of disappearing off screen?

HTML:

<div class="toolbar">
  <p>Hide</p>
   <ul>
    <li>Tab 1</li>
    <li>Tab 2</li>
   </ul>
</div>

JQUERY:

$(".toolbar p").click(function() {
    $(".toolbar").slideUp(); 
});
+1  A: 

Use animate instead.

$('#myDiv').animate(
    {
        top: "-=20px"
    }, 300);

Slides your div up 20 pixels in 300 ms.

Jan Jongboom
Does the div need to be position:absolute for this to work?
danit