![](https://img-blog.csdn.net/20180803102153662?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3h1dG9uZ2Jhbw==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>mCustomScrollbar 漂亮的滚动条插件 适应内容自动更新</title>
<link href="https://cdn.bootcss.com/malihu-custom-scrollbar-plugin/3.1.5/jquery.mCustomScrollbar.css" rel="stylesheet">
<style type="text/css">
.content{position: relative;background: #ffffff; 740px;height: 400px;border: 1px solid #dddddd;overflow: auto;}
.m-item{height: 50px;line-height: 50px;}
</style>
</head>
<body>
<div id="m-warpper" class="content">
<div id="m-inner"></div>
</div>
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/malihu-custom-scrollbar-plugin/3.1.5/jquery.mCustomScrollbar.js"></script>
<script type="text/javascript">
$(function() {
$("#m-warpper").mCustomScrollbar({
theme:"minimal-dark"
});
setInterval(function () {
var html = $('<div class="m-item">' + new Date() + '</div>')
$("#m-inner").append(html);
}, 1000);
})
</script>
</body>
</html>