jquery animieren abzuschließen

<div class="factuuradres"></br><h3></h3></div>
<div class="factuuradresbutton">Meer Informatie</div>           

<script type="text/javascript">
    $(".factuuradresbutton").toggle(function(){
        $(".factuuradres").animate({
            height: "310px"
        }, 500 );
        complete: function() {
            $(".factuuradresbutton").html("Toch geen factuuradres")
            $(".factuuradres").html('<h2>Factuuradres</h2><div class="title_textbox3"><h3>Postcode:</h3></div><div class="textbox3"><input type="text" class="postcode" name="Postcode" value=""/></div><div class="title_textbox4"><h3>Huisnummer:</h3></div><div class="textbox4"><input type="text" class="huisnummer" name="Huisnummer" value=""/></div><div class="title_textbox"><h3>Straat:</h3></div><div class="textbox"><input type="text" class="field" name="Straat" value=""/></div><div class="title_textbox"><h3>Plaats:</h3></div><div class="textbox"><input type="text" class="field" name="Plaats" value=""/></div>')
        }
    },

    function(){
        $(".factuuradres").animate({
            height: "160px"
        }, 500 );
        $(".factuuradresbutton").html("Ander factuuradres?")
        $(".factuuradres").html("Factuuradres")
    });
</script>

Frage ich mich, warum die complete: function() funktioniert nicht, wer kann mir einen Rat geben?

Außerdem ist das die arbeiten Skript, aber es bricht, wenn Sie einmal auf die Schaltfläche. Nach ein oder zwei Sekunden, es funktioniert wie beabsichtigt.

    <script type="text/javascript">
    $(".factuuradresbutton").toggle(function(){
    $(".factuuradres").animate({
        height: "610px"
    }, 500 );
    $(".factuuradresbutton").html("Toch geen factuuradres")
    $(".factuuradres").html('<h2>Factuuradres</h2><div class="title_textbox3"><h3>Postcode:</h3></div><div class="textbox3"><input type="text" class="postcode" name="Postcode" value=""/></div><div class="title_textbox4"><h3>Huisnummer:</h3></div><div class="textbox4"><input type="text" class="huisnummer" name="Huisnummer" value=""/></div><div class="title_textbox"><h3>Straat:</h3></div><div class="textbox"><input type="text" class="field" name="Straat" value=""/></div><div class="title_textbox"><h3>Plaats:</h3></div><div class="textbox"><input type="text" class="field" name="Plaats" value=""/></div>')
    },
    function(){
    $(".factuuradres").animate({
        height: "160px"
    }, 500 );
    $(".factuuradresbutton").html("Ander factuuradres?")
    $(".factuuradres").html("Factuuradres")
    });
    </script>
wo sind Sie aufrufen der Funktion abschließen ? Ihre animate-Aufruf geschlossen wird ); nach der 500
Überprüfen Sie die Konsole. Ihre Antwort wird sein, die syntax-Fehler drin.
Ihre syntax ist falsch. Führen Sie den code durch JSHint.
versuchen Sie, machen Erfolg Funktion als callback-Funktion zu animieren.
jsfiddle.net/t3ttW derzeit benutze(und funktionierende) script.

InformationsquelleAutor Mr chinpansee | 2013-01-15

Schreibe einen Kommentar