11

I have added a NiceScroll bar to a div:

$("#div-name").niceScroll();

How can I remove/destroy it?

I have tried the following, but it doesn't work:

$("#div-name").getNiceScroll().stop();

The following is also not a solution:

$("#div-name").getNiceScroll().resize();
$("#div-name").getNiceScroll().hide();

EDIT: I found the problem! When adding NiceScroll to divs that are automatically generated by the JQuery Multiselect plugin, on iPad I have some visualization problems on other NiceScroll divs. So it's probably an issue relating to the integration of the two plugins(NiceScroll and JQuery MultiSelect).

Diego87
  • 1,617
  • 3
  • 17
  • 20

1 Answers1

23

But this works $("#ID").getNiceScroll().remove();

Try to execute in console on nicescroll demo page: $("#boxscroll2").getNiceScroll().remove() and you'll see that first div This is a simple scrollable DIV will change from nicescroll scrollbars to native browser ones.

Gromo
  • 1,609
  • 1
  • 13
  • 14
  • Yes you are right. I will investigate where is the problem, sure it's caused by nicescroll but probably there is one conflict with other plugin or code. For you i must delete the question? – Diego87 Jul 24 '14 at 10:57
  • 4
    Nope, do not remove it. Maybe someone else will face this problem and will find answer here. – Gromo Jul 24 '14 at 11:29
  • 1
    @Diego87 like I found, after half hour effort, landed here :) – Abdul Hameed Dec 27 '16 at 10:49