jQuery表fadeIn无法正常工作

时间:2014-07-17 15:51:12

标签: javascript jquery

选中输入框时,我的表似乎没有淡入。

jQuery代码:

$(document).ready(function () {

var weightSetArray = ["HH_Cancer", "Global Warming", "Acidification", "HH_Respiratory", "HH_Noncancer", "Ozone Depletion", "Eutrophication", "Smog", "Embodied Energy", "Land Use", "Water Consumption", "Sum"];
$("#weightsetcheckbox").click(function () {
    if ($("#weightsetcheckbox").is(':checked')) {
        $("#weightsetContainer").append("<table class=table id=weightsetTable></table>");
        $.each(weightSetArray, function (index, value) {
            name = value;
            name = name.replace(/\s+/g, '');
            $("#weightsetTable").append('<tr><td>' + value + '</td><td><input type=number min=0 max=100 placeholder=0 name=name></td></tr>');
        });
        $("#weightsetTable").fadeIn('slow');
    }
    else {
        $('#weightsetTable').remove();
    }
});

});

0 个答案:

没有答案