views:

60

answers:

3

Since there's a lot of code, I won't post it here. Rather, you can find it all here. That way you can play around with it and run it.

The problem happens when the 'Drop me down!' link is clicked. The DIV slides down as expected, but makes a sudden 'jump' right at the end.

Why does it do this, and how can I make it go away?

A: 

Give the hidden div a set height. jsfiddle


Edit. Found some answers here. You can store the height of each element, and then reapply it. Not ideal for your situation, but maybe a starting point

hookedonwinter
But what if the content changes and it no longer fits on the line? The snippet in my example is part of a larger page that has lots of those lines and they're not guaranteed to be one-liners.
George Edison
Whoa, don't use min-height. That's just funky.. Trying other options now.
hookedonwinter
+2  A: 

demo

codes link

.hidden_data {
    overflow: hidden;
    display:none; /* <--- remove this */
    padding: 10px;
    font-style: italic;
    color: #777;
}​

similar problem answered

Reigel
Yes! It works! So the problem is that it needs to have an explicit height set beforehand?
George Edison
yeap!.. that's the problem... ;)
Reigel
Wish I could give you +2 :) Thanks a million!
George Edison
A: 

Actually you don't need any of this. Just give your hidden element a width:

.hidden_data {
    display: none;
    padding: 10px;
    font-style: italic;
    color: #777;
    width: 300px;
}

It will just works!

PS: I spent all the weekend on this...

Victor Teixeira