开发者

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?

开发者_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(){
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜