我正在尝试使用 jScrollPane 在动态 div 中滚动,但我遇到了一些麻烦...
这是我的结构
<div id="DynamicDivHeightAndWidth">
<div id="Content">
<div id="TextContent"></div>
</div>
</div>
我只有这个 CSS 属性(仅适用于必须具有动态高度和动态宽度的主要 div)
.DynamicDivHeightAndWidth{
color:#FFF;
float:left;
margin-left:30px;
-webkit-border-radius:20px;
-moz-border-radius:20px;
background-color:#000;
border:solid #FF6C00 3px;
display:none;
z-index:10;
overflow:hidden;
width:21%;
height:21%;}
我的 jScrollPane 是这样声明的:
$(function()
{
$('#Content').each(
function()
{
$(this).jScrollPane(
{
showArrows: $(this).is('.arrow')
}
);
var api = $(this).data('jsp');
var throttleTimeout;
$(window).bind(
'resize',
function()
{
if ($.browser.msie) {
// IE fires multiple resize events while you are dragging the browser window which
// causes it to crash if you try to update the scrollpane on every one. So we need
// to throttle it to fire a maximum of once every 50 milliseconds...
if (!throttleTimeout) {
throttleTimeout = setTimeout(
function()
{
api.reinitialise();
throttleTimeout = null;
},
50
);
}
} else {
api.reinitialise();
}
}
);
}
)
});
现在我的问题是我的“DynamicDivHeightAndWidth”具有动态宽度,但高度保持固定,我不知道为什么?
我已经尝试了很多问题,但还是不行......
感谢您的帮助^^
最佳答案
你把html和body heights设置成100%了吗 另外只需检查您的 CSS,您将动态 div 定义为类而不是 id
关于JQuery - jScrollPane - 动态高度保持固定,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7912940/