If i install the jScrollPanel it works fine, but when i try to catch content from ajax, it doesn’t make the scrollbar, because it still thinks there is no content in.
So my question is, how can i re-render the jScrollPanel, so it now it has to put scrollbar on/off?
Here is my catching script:
"chatlog": function() {
$.ajax({url: '?chatlog=&' + new Date(),success: function(data){
if ( nagoom.trim(data) != "") {
$('#__chatlog').html(data);
}
}});
}
Here is where i install it:
$('aside .chat-entity').jScrollPane({
showArrows: true,
verticalGutter: -13,
autoReinitialise: true
});
I am using this script http://jscrollpane.kelvinluck.com/less_basic.html
Evidently there is a reinitialise method on the API object. Include this in your response function. More information on this can be found here
EDIT: I have not used this script before so I hesitate to provide code, but I assume it would work something like this:
where jScrollPaneObjectReference is the object returned when you constructed the panel
EDIT: I will clarify further. jScrollPaneObjectReference should refer to the object returned when you do this:
Try putting this at the top of your code:
EDIT: Try removing the autoReinitialise parameter.