0

I need a command that would disable jQuery jScrollPane when a certain condition is met.

Couldn't find it anywhere online, hope someone on StackOverflow knows the solution.

I would appreciate your sharing it with me!

Dimitri Vorontzov
  • 7,834
  • 12
  • 48
  • 76

2 Answers2

2
var a = false;
var api = $('.scroll-pane').jScrollPane({/*params*/});

if(a !== true)
{
    api.destroy();
}

Documentation on destroy();

AlienWebguy
  • 76,997
  • 17
  • 122
  • 145
  • Hey Webguy! Thanks for being ready to help. jScrollPaneRemove(); doesn't work: the scrollbar stays. You wouldn't happen to know any other command that would do the trick? Or maybe you could suggest a statement that disables the mousewheel - in that case I would hide the scrollbar and diable the mousewheel. Would appreciate your help. – Dimitri Vorontzov Jul 15 '11 at 02:19
  • Thank you. This is perfect. You saved me a great deal of time, and I learned something useful. – Dimitri Vorontzov Jul 15 '11 at 03:05
1
var a = false;
var api = $('.scroll-pane').data('jsp');

if(a !== true)
{
    api.destroy();
}

To update @AlienWebguy 's answer, in 2015 this is the way to destroy jScrollPane

istavros
  • 138
  • 5