jQuery jScrollPane: how to disable?
I need a command that would disable jQuery jScro开发者_运维技巧llPane 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!
var a = false;
var api = $('.scroll-pane').jScrollPane({/*params*/});
if(a !== true)
{
api.destroy();
}
Documentation on destroy();
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
精彩评论