tags:

views:

57

answers:

1

When doing

$('.mydiv').show('slide', {direction:up}, 1500); //syntax may be a little off

jQuery seems to - just before starting the animation - make room for the soon to be showed div. This creates a non-smooth effect making all elements below the showed div shift away in one big go.

I would like to see the elements below the div move away as the div is animated/showed. The jQuery native hide()/show() function works like this, how come the slide effect of hide/show doesn't?

Anyone knows how to fix it?

A: 

Maybe you could try to use slideDown effect instead? (http://docs.jquery.com/Effects/slideDown)

rochal
I've tried, but it doesn't animate the way I want. slideDown changes the height and to me that's not a "true" slide. A "true" slide effect for me is when the entire content moves away, clipping the area of the content that is not supposed to be visible. I'm guessing that's how hide with the slide effect works.
Tommy
http://docs.jquery.com/UI/Effects/Slide - 'Hides element by sliding it down'. So I believe this could be achieved using animate() function – create parent div with overflow:hidden, slide child down (increase margin-top) and finally, hide parent element?
rochal