Permalink
Browse files

Merge pull request #12 from mertonium/master

Added an 'unscrollbar' method.
  • Loading branch information...
2 parents d0bbf65 + c0b1312 commit f9f15b7b32eddf836b211fd6f17a0406241f9f4b @thomd committed Sep 21, 2011
Showing with 26 additions and 1 deletion.
  1. +26 −1 jquery.scroll.js
View
@@ -152,7 +152,9 @@ Changelog:
//
repaint: function(){
return this.each(function(){
- this.scrollbar.repaint();
+ if(this.scrollbar) {
+ this.scrollbar.repaint();
+ }
});
},
@@ -171,6 +173,19 @@ Changelog:
return this.each(function(){
this.scrollbar.scrollto(to);
});
+ },
+
+ // Remove the scrollbar (and the generated HTML elements).
+ //
+ // usage:
+ // $('selector').scrollbar("unscrollbar");
+ //
+ unscrollbar: function() {
+ return this.each(function() {
+ if(this.scrollbar) {
+ this.scrollbar.unscrollbar();
+ }
+ });
}
}
@@ -474,6 +489,16 @@ Changelog:
this.setHandlePosition();
this.setContentPosition();
},
+
+ //
+ // Remove scrollbar dom elements
+ //
+ unscrollbar: function() {
+ var holder = this.container.find('.scrollbar-pane').find('*');
+ this.container.empty();
+ this.container.append(holder);
+ this.container.attr('style','');
+ },
// ---------- event handler ---------------------------------------------------------------

1 comment on commit f9f15b7

Please sign in to comment.