我遇到mCustomScrollbar的问题,这是我的代码,但不起作用。
function createChat(){
$("#chatview").load("chat/refresh.php",function(){
$(this).mCustomScrollbar("scrollTo", "bottom");
});
}
$(window).load(function(){
setInterval("createChat()",9000);
createChat();
});
答案 0 :(得分:1)
我会尝试将插件附加到聊天视图元素:
//cache variable
var $chatView = $("#chatview");
function createChat(){
$chatView.load("chat/refresh.php",function(){
$chatView.mCustomScrollbar("scrollTo", "bottom");
});
}
$(window).load(function(){
setInterval("createChat()",9000);
createChat();
});