<! DOCTYPEhtml>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MCustomScrollbar beautiful scrollbar plug-in ADAPTS content to automatically update</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;width: 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>'The $()"#m-inner").append(html);
}, 1000);
})
</script>
</body>
</html>
Copy the code