添加与回显(下)——通过toggle实现jQuery动画

思想:如果回复的内容为空,则显示不出下面一块,若存在回复内容,点击“查看回复信息”出现下面的回复内容,再次点击会将内容收回去(通过toggle实现)。

//获取客服回复信息
    function showBack(that) {
        var feed_id = $(that).closest('.comment_manage_li').attr('data_feedback_id');
        $(that).closest('.comment_manage_li').find(".admin_replay_li").remove();
        operation.operation_ajax_async("/operate/customer/get/response", "get", {feed_id: feed_id}, function () {
            if (global_data.data.length == 0) {
                $(that).closest('.comment_manage_li').find('.admin_replay_box').hide();
            } else {
                $(that).closest('.comment_manage_li').find('.admin_replay_box').toggle();
            }
            global_data.data.map(function (v) {
                $(that).closest('.comment_manage_li').find('.admin_replay_box').append('<div class="admin_replay_li">' +
                    '<div class="admin_replay_time">' + v.feedback_created + '</div>' +
                    '<div class="admin_replay_content">回复:' + v.feedback_content + '</div>' +
                    '</div>')
            })
        })
    }

猜你喜欢

转载自blog.csdn.net/inmarry/article/details/81079026