jamesflorentino / nanoScrollerJS

A jQuery plugin that offers a simplistic way of implementing Lion OS scrollbars.
http://jamesflorentino.github.com/nanoScrollerJS/
MIT License
2.69k stars 502 forks source link

nanoScroller can't be destroyed multiple times #286

Open freakyleaf opened 9 years ago

freakyleaf commented 9 years ago

I'm using nanoScroller on a responsive site where under 700px page width nanoScroller isn't required. I've set things up so that if nanoScroller has been initialised and the viewport width changes to below 700px it gets destroyed. It seems that if it is once again initialised, it then cannot be destroyed again.

I've set up a JS fiddle: http://jsfiddle.net/qrmv2Lqr/2/

If you play with the width of the pane, you see that after one 'destroy' it starts to act up.

kristerkari commented 9 years ago

Thanks for reporting!

kristerkari commented 9 years ago

@freakyleaf I had a look at your demo, but I wasn't seeing anything weird. Which browser are you using to reproduce the bug?

nordfjord commented 9 years ago

using his fiddle I was able to reproduce on chrome 42 on linux,

Simply drag the viewport so its size gets below 500px, then drag it back out. Nano Scroller should now have been destroyed once. Now drag the viewport again so its below 500px and see that nano scroller was not destroyed again.

kristerkari commented 9 years ago

@nordfjord Thanks, I'll try to do that