0

不知何故,我不明白如何设置 jScrollPane 的高度。

http://tinyw.in/BLrg点击时事通讯 546。现在您看到滚动条,手动滚动它。你看,它深入到虚无之中。我怎样才能让它和包装纸一样大?(600 像素)

它是一个带有 div 作为 jScrollPane 包装器的 UL。我已将此包装器的高度设置为 600 像素,我尝试了一些东西,但不知何故我无法让它工作。

这个 div 稍后会被隐藏,我知道我必须重新初始化,但也许这很重要。:)

它不应该采用它所连接的元素的高度吗?

谢谢!

如果时事通讯被删除(似乎人们这样做很有趣)只需按创建新

4

1 回答 1

1

I believe within your initJScrollPane function in the logic.frontend.js you have height being set with javascript after css is set:

var width = $('#elementsContainer ul').width();
var height = $('#elementsContainer ul').height();

$('#jScrollPane_Wrapper').css({'height' : height, 'width' : width});
$('#jScrollPane_Wrapper').jScrollPane({
    height: 600
});

I think, this could be getting the height of the whole content(<ul>), which is causing the wrong height to be set that you want.

Maybe changing it to this will fix it:

var height = $('#elementsContainer').height();

As that is set to 600px which I believe is what you are wanting it set too.

于 2012-04-23T15:39:27.120 回答