Skip to content

Commit 11205d8

Browse files
committed
Added destroy method to remove the slimScroll
1 parent aa6d0f5 commit 11205d8

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

jquery.slimscroll.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
33
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
44
*
5-
* Version: 1.0.7
5+
* Version: 1.0.8
66
*
77
*/
88
(function($) {
@@ -72,6 +72,14 @@
7272
// jump by value pixels
7373
offset += parseInt(o.scrollBy);
7474
}
75+
else if ('destroy' in options)
76+
{
77+
// remove slimscroll elements
78+
bar.remove();
79+
rail.remove();
80+
me.unwrap();
81+
return;
82+
}
7583

7684
// scroll content by the given offset
7785
scrollContent(offset, false, true);

jquery.slimscroll.min.js

Lines changed: 9 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)