So what you're trying to do is ensure that the slideToggle is done
animating before you add/remove a class? If so, you'd do something
like this:

$('.open-post-info').click(function() {
                var id = $(this).attr('id');
                $('.post-info-' + id).slideToggle("medium", function()
                {
                    $(this).toggleClass("toggled");
                });
                return false;
});

This is where you'd implement the callback, and it's very useful with
animations (all of the "effects" allow callbacks as the last
parameter).

On Apr 22, 9:08 pm, Chris <cpot...@siolon.com> wrote:
> I have this simple slide toggle.
>
> $('.open-post-info').click(function() {
>                 var id = $(this).attr('id');
>                 $('.post-info-' + id).slideToggle("medium");
>                 return false;
>
> });
>
> What I want is when I run the function that after it runs to add CSS
> class and when I close/toggle up that the class gets removed.  Help
> please.

Reply via email to