YOLO v5 Series - Redis Client
var triggerSend = function(index) {
var context = $('#appMessage').val();
var msgList = $('.nk-chat-panel').find('.simplebar-content');
var newMe = mkMessage(const_me, context);
msgList.append(newMe);
$.ajax({
type: 'GET',
url: '/api/redis/command?cmd="' + context + '"',
success: function(data) {
data = data.replaceAll('\n', '');
var alpha = JSON.parse(data);
var newYou = mkMessage(const_you, alpha.data);
msgList.append(newYou);
triggerTop();
},
error: function(data) {
}
});
};
var triggerTop = function() {
var msgList = $('.nk-chat-panel').find('.simplebar-content');
var divHeight = msgList.prop('scrollHeight');
$(msgList.parent()).scrollTop(divHeight);
$(msgList.parent()).scrollTop(divHeight + 25);
};
原文地址:https://blog.csdn.net/unix2linux/article/details/145118945
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!