开发者

jscrollpane no scrollbars

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' + 开发者_如何学GoshowID).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?


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


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 });


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 :-)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜