首先,我搜索了一段时间,找不到对我有用的答案。
我正在为客户开发一个网站。我正在使用jScrollPane jQuery插件,但它没有显示。我起初担心可能其他一些jQuery插件正在影响它,但是当我将.scroll-pane类应用于某些东西时,它会拉伸div的高度以显示没有滚动条的所有内容。我不知道,它可能仍然与它有关,我不知道。当我与所有客户签订保密协议时,我无法显示该网站,但我可以显示相关代码。
这些是我标题中的脚本链接:
<link rel="stylesheet" href="css/global.css" type="text/css" media="screen" />
<link rel="stylesheet" type="text/css" media="all" href="css/jScrollPane.css" />
<link rel="shortcut icon" href="favicon.ico" />
<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="js/supersized.3.1.3.min.js"></script>
<script type="text/javascript" src="js/jquery.mousewheel.js"></script>
<script type="text/javascript" src="js/jScrollPane.js"></script>
这是嵌套DIV的相关HTML:
<!--INFO TAB-->
<div id="infocontainer">
<div id="infobox">
</div>
<div id="infomenu">
</div>
<div id="inforule">
</div>
<div id="infocontent" class="scroll-pane">
TEXTTEXTT EXTTEXTTEXTTEXT TEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEX TTEXTTEXTT EXTTEXTTEXTT EXTTEXT TEXTTEXTTEXTTEXTT EXTTEXTT EXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEX TTEXTTEXTTEX TTEXTTEXTTEXTTEXTTEXTTEXTTE XTTE XTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEX TTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXT
</div>
</div>
这是在正文结束前调用函数的脚本:
<script>
$(function()
{
$('.scroll-pane').jScrollPane();
});
</script>
相关CSS:
#infocontainer {
position:absolute;
top:30px;
left:350px;
height:385px;
width:625px;
z-index:1;
}
#infobox {
background-color:#f4f4f4;
position:absolute;
height:100%;
width:100%;
z-index:-1;
}
#infomenu {
padding-top:44px;
padding-left:49px;
text-align:left;
z-index:1;
}
#inforule {
margin-left:239px;
margin-top:-175px;
z-index:5;
}
#infocontent {
line-height:18px;
margin-left:290px;
margin-top:-287px;
height:284px;
overflow:auto;
width:270px;
text-align:left;
z-index:1;
}
DIV的不透明度最初为0,然后我写的一些自定义javascript在页面加载时将它们带到100%。我也在使用Supersize jQuery设置全屏适合的背景图像。
我不知道为什么它不起作用,我已经尝试将所有其他javascript和jQuery使用,仅使用jScrollPane,它仍然无法正常工作或更糟。任何帮助将不胜感激。
答案 0 :(得分:3)
对于踢,尝试将你的jquery恢复到以前的版本,比如1.5.2。看看这个:code.google.com/p/jscrollpane/issues/detail?id=207#c2 - julie p
答案 1 :(得分:1)
将Div的内容包含在
标记中,如
<p>
TEXTTEXTT EXTTEXTTEXTTEXT TEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEX TTEXTTEXTT EXTTEXTTEXTT EXTTEXT TEXTTEXTTEXTTEXTT EXTTEXTT EXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEX TTEXTTEXTTEX TTEXTTEXTTEXTTEXTTEXTTEXTTE XTTE XTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEX TTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXT
</p>