jscrollpane没有滚动条
我已经查看了整个堆栈,也许我没有看到它,但我遇到了 Jscrollpane 的问题。我有一些代码可以弹出打开一个 div 并使用数据库中的内容加载它:
$('.jobDetails').live('click', function() {
var showID = $(this).attr('id');
$.get('../internal/databaseInfo.cfm?getMoreInfo&' + (new Date()).getTime(),{showID:showID}, function(data,status) {
$('#showMore' + showID).toggle(),
$('.moreJobDetails').not('#showMore' + showID).hide();
$('#showMore' + showID).html(data);
$('.scroll-pane').jScrollPane();
});
});
问题是,当 div 加载内容时,它会在正确的高度将其切断,但滚动条没有显示。我是否将 jscrollpane 代码放在上面的正确位置?
I've had a look all over stack and maybe i'm not seeing it but I am having a problem with Jscrollpane. I have some code that pops open a div and loads it with content from a database:
$('.jobDetails').live('click', function() {
var showID = $(this).attr('id');
$.get('../internal/databaseInfo.cfm?getMoreInfo&' + (new Date()).getTime(),{showID:showID}, function(data,status) {
$('#showMore' + showID).toggle(),
$('.moreJobDetails').not('#showMore' + showID).hide();
$('#showMore' + showID).html(data);
$('.scroll-pane').jScrollPane();
});
});
The problem is that when the div loads the content it cuts it off at the correct height but the scrollbars arent showing. Have I put the jscrollpane code in the correct place above?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
jScrollPane 可以与动态内容区域结合使用。 有一些属性/方法可以实现这一点:-
autoReinitialise:每隔“autoReinitialiseDelay”毫秒自动重新初始化滚动条。感谢 Eric Imthorn,jScrollPane autoReinitialise 和 animateScroll
或者,您可以使用“reinitialise”,如此处所示http://jscrollpane.kelvinluck.com/dynamic_content.html
jScrollPane can be usedin conjunction with a dynamic content area. There are a few properties/methods that make this possible:-
autoReinitialise: which automatically reinitialises the scrollBar every 'autoReinitialiseDelay' milliseconds. Credit to Eric Imthorn here jScrollPane autoReinitialise and animateScroll
Alternatively, you can use 'reinitialise' as demonstrated here http://jscrollpane.kelvinluck.com/dynamic_content.html
我遇到了同样的问题,这是我最初初始化它的代码:
我通过添加 -
autoReinitialise: true
修复了它 - 所以现在它看起来像这样并且工作完美I had the same exact problem this was my code to initialize it at first:
I fixed it by adding -
autoReinitialise: true
- so now it looks like this and works perfectly这很难回答你的问题。但是,如果我正确阅读您的代码,您是否正在尝试将内容写入 JScrollbar 启用区域并使滚动条动态生效?
如果我是对的,我必须告诉你这是行不通的。我遇到了完全相同的问题,经过几个小时的实验,我发现 JScrollbar 只有在页面加载时有内容时才会感到高兴。它似乎不喜欢动态ajax样式加载。
…………但是,我仍在寻找解决方法:-)
This is hardly an answer to your problem. However, if I am reading your code correctly, You are attempting to write content into the JScrollbar enabled area and for the scrollbar to dynamically take effect?
If I am right I have to tell you it doesn't work. I have the exact same problem and after hours of experiemnting, I found JScrollbar only seems to be happy when there is content in it as the page loads. It doesn't seem to like dynamic ajax style loading.
............ however, I am still looking into a work around :-)