SLAPme
SLAPme

Reputation: 39

JQuery Coding Question?

I'm kind of new to JQuery i really don't know how to code in the .hide() so that it hides the following code from begin displayed until clicked <li>Changes saved!</li> and then have it fade in using the .fadeIn. Can some one show me how to code in the .hide() and .fadeIn correctly into my JQuery code?

Here is the JQuery code.

$(function() {
    $(".save-button").click(function() {
        $.post($("#contact-form").attr("action"), $("#contact-form").serialize(), function(html) {
            $("div.contact-info-form").html(html);
            $('#changes-saved').append('<li>Changes saved!</li>');
        });
        return false; // prevent normal submit
    });
});

Upvotes: 0

Views: 88

Answers (2)

Pieter Germishuys
Pieter Germishuys

Reputation: 4886

Have you ensured that your submit button has the class of "save-button". If that is your button's name, you might want to do something like

$("save-button").click(function(){

Upvotes: 0

Amy B
Amy B

Reputation: 17977

$('#changes-saved').append('<li>Changes saved!</li>').show().pause(1000).hide();

Is that what you need?

Upvotes: 1

Related Questions