mzubala / jquery-custom-scrollbar

189 stars 102 forks source link

"remove" API method does not work as expected #57

Open Erika31 opened 8 years ago

Erika31 commented 8 years ago

When calling "remove", the private method "removeScrollbarComponents" unwraps the element, instead of its initial content.

A solution could be :

      removeScrollbarComponents: function () {
        this.removeScrollbar("vertical");
        this.removeScrollbar("horizontal");
        if (this.overviewAdded)
          this.$overview.contents().unwrap();  // Here...
        if (this.viewPortAdded)
          this.$viewPort.contents().unwrap();  // ...and here
      },
de-arnst commented 8 years ago

I confirm the error and its solution.

gcirone commented 8 years ago

I think the solution of Jevedor is better https://github.com/mzubala/jquery-custom-scrollbar/issues/44