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?
开发者_C百科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
});
});
$('#changes-saved').append('<li>Changes saved!</li>').show().pause(1000).hide();
Is that what you need?
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(){
精彩评论