Alex Rivera | Logout

slideToggle height is "jumping"

Asked 2010-02-24T17:14:52.700
29

My jQuery slideToggle() experiment

Can anybody tell me why my boxes "jump" when i open them? The first half they slide, the rest they "jump"??

Thanks, Johannes

Edit
Report

2 Answers

11

The quickest fix in your case:

.message_container { width: 361px; }

I'm not sure exactly why, but not giving the container a fixed width when containing a <p> causes issues, give it one and the jumpyness goes away.

answered 2010-02-24T17:21:59.480
5

I found this problem in many occasions in which I was animating just the height with slideToggle but not the margin/padding.

So, something like this might solve it:

$("#thediv").slideToggle().animate({"margin-bottom": "toggle"});
answered 2010-02-24T17:20:19.713

Your Answer