MEM MEM - 1 month ago 8
jQuery Question

Slide Up/Down with JQuery until a certain height - is this possible?

Is it possible to slide a div up (closing it) but not completely ?

I mean, slide up but leave a little of that div displayed, is that possible ?

Thanks in advance,
mem

Answer

Something like this may work:


$("#div").toggle(
function(){
   $("#div").animate( { height:"500px" }, { queue:false, duration:500 });
},
function(){
   $("#div").animate( { height:"50px" }, { queue:false, duration:500 });
});

Instead of the 500px it can just be the original size of the div, and the 30px can be however much you want to show when it's meant to be hidden.