jap
jap

Reputation: 25

toggle + fadein

I have a jquery function to toggle a div class, is it possible to have the "toggle" combined with a "fadein" effect?

function showDiv() {
    $("#mydiv").animate({
        "height": "toggle"
    }, {
        duration: 300
    })
}

Any help would be appreciated

Upvotes: 0

Views: 2489

Answers (2)

Mike Veigel
Mike Veigel

Reputation: 3815

I would take a look at: .fadeToggle()

Upvotes: 2

thecodeparadox
thecodeparadox

Reputation: 87073

$("#mydiv").animate({
        "height": "toggle"
    }, {
        duration: 300
    }, function(){
        $("#mydiv").fadeIn();
    }).

Upvotes: 0

Related Questions