views:

25

answers:

1

I have a paragraph set with the following style:

.design_info_box p.design_info_desc
{
    height:30px;
    text-overflow: ellipsis;
    overflow:hidden;
}

With this, you can see the first 2 lines of text with a button to "read more" which expands the paragraph to show the rest of the text.

Here is the code for the button:

$(".read-more div").click(function(){
    $(this).parent().parent().children("p").removeClass("design_info_desc", "slow");
    $(this).hide();
});

This does remove the class and the entire paragraph is revealed. However, it does not animate. According to the docs removeClass should have a duration for animation. I also tried substituting "slow" with a number like 10000.

Is there a reason why it is not animating?

+4  A: 

The reason this isn't working (I believe) is that this is a feature of jQueryUI, not the core jQuery library. Include a reference to jQueryUI in your page, and this should begin to work.

Check out a live demo here: http://jsfiddle.net/YaSh6/

Ender
+1 Yep that was it!
John Isaacks