Matt 0

I'm making a see more button like on facebook, and I want one final effect.

When you load the page you see a shortened version of the comment, then when you click See More it changes the contents of the element to include the entire comment. Basically, this:

$(commentElement).html( entireComment ).slideDown('fast');

Obviously, just adding slideDown to the end doesn't actually do anything because the element is already showing. I just want the element to expand with the slide down effect when it adds the new content, instead of just expanding instantly.

1 answer


You can use two separate divs. The first one will contain the first half of your comment (or as many lines as you wish), and when the "Read More" button is pressed the second div would slide down.

Answered over 8 years ago by poscaman