jQuery event bestellen und warten, bis die animation abgeschlossen

Habe ich eine slider-animation, aber auf clX.klicken Sie auf event #close div verbirgt, bevor es animiert wird -250px Links. Wie zu warten, bis die animation abgeschlossen ist, und dann verstecken #close div?

    $(document).ready(function() {
        $("#open").click(function() {
            if ($("#close").is(":hidden")) {
                $("#open").animate({
                    marginLeft: "-32px"
                }, 200);

                $("#close").show();
                $("#close").animate({
                    marginLeft: "250px"
                }, 500);
            }
        });
        $("#clX").click(function() {
            $("#close").animate({
                marginLeft: "-250px"
            }, 500);

            $("#open").animate({
                marginLeft: "0px"
            }, 200);

            $("#close").hide();
        });
    });
InformationsquelleAutor HasanG | 2010-03-09
Schreibe einen Kommentar