Search code examples
jqueryjscrollpanejquery-jscrollpane

JQuery jScrollPane reinitialise


I'm using the JQuery plugin jScrollPane

I'm intialising it as follows.. It works initially but when I try and change the settings and reinitialise it it doesnt work properly it kindof flickers and then returns to it's previous state, any ideas?

$(document).ready(function() {
     var api = $('.viewer').jScrollPane().data('jsp');
     api.reinitialise({
         showArrows: true
     }); 
});

Here is my test example

http://www.jsfiddle.net/VxYdJ/

Thanks


Solution

  • It looks like this is a known issue with jScrollPane. You could modify the source code as one commenter describes in the link above:

    reinitialise: function(s)
    {
        s = $.extend({}, settings, s);
        initialise(s);
    },
    

    That seems to fix the problem: http://www.jsfiddle.net/pNvky/ (The ton of code up front is just the modified plugin)