0

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
    });
});
2
  • Hey you confused me. :) The list item "Changes Saved!" wont appear until the button is clicked because it is being appended correct? So what are you hiding? Commented Mar 23, 2010 at 5:06
  • @thatryan, Well instead of appending it can I hide it? I told you I was new :) Commented Mar 23, 2010 at 5:08

2 Answers 2

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

Is that what you need?

Sign up to request clarification or add additional context in comments.

Comments

0

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(){

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.