jscrollpane没有滚动条

发布于 2024-11-18 17:57:19 字数 593 浏览 4 评论 0原文

我已经查看了整个堆栈,也许我没有看到它,但我遇到了 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

夕嗳→ 2024-11-25 17:57:19

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

長街聽風 2024-11-25 17:57:19

我遇到了同样的问题,这是我最初初始化它的代码:

$('.p_desc').jScrollPane();

我通过添加 - autoReinitialise: true 修复了它 - 所以现在它看起来像这样并且工作完美

$('.p_desc').jScrollPane({ autoReinitialise: true });

I had the same exact problem this was my code to initialize it at first:

$('.p_desc').jScrollPane();

I fixed it by adding - autoReinitialise: true - so now it looks like this and works perfectly

$('.p_desc').jScrollPane({ autoReinitialise: true });
韬韬不绝 2024-11-25 17:57:19

这很难回答你的问题。但是,如果我正确阅读您的代码,您是否正在尝试将内容写入 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 :-)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文