我正在使用 mCustomScrollbar 来设置滚动条的样式,但遇到了一些问题。当我动态更改页面时,效果不会出现。
<link rel="stylesheet" href="css/jquery.mCustomScrollbar.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="js/jquery.mCustomScrollbar.concat.min.js"></script>
我使用这个功能来改变页面。
function processResponse() {
if (request.readyState == 4) {
if (request.status == 200) {
var response = request.responseText;
document.getElementById("content").innerHTML = response;
}
}
}
我没有更改 js 文件中的任何代码。此外,如果我直接进入页面,它的工作。我需要在 processResponse 函数中添加任何函数吗?
在动态页面中:我添加了 mCustomScrollbar 所需的名为“内容 mCustomScrollbar”的类
<div id="content" style="position: absolute;left: 7%;right: 7%">
<div id="id_div_paragraph" class="content mCustomScrollbar" style="position: absolute;left: 450px;float:left;/*padding:20px 28px;*/padding-top: 20px;padding-left: 28px;padding-bottom: 20px;padding-right: 15px;font-size:18px;overflow: auto;background-color:#FFFFFF;opacity:0.75;">
Content Here....
</div>
谢谢你。