malihu/malihu-custom-scrollbar-plugin — pull request #185 by vtabary (2014-07-08 10:59:28+00:00)
Title: Check if the scrollbar is ready to use mousewheel events

Sometimes the plugin throws this error :
"Uncaught TypeError: Cannot read property 'opt' of undefined"
Chrome 34 / Ubuntu 14.004

It could happen when we destroy the plugin before it is totally ready. It can be reproduce if you click repeatedly on "Destroy/Rebuild scrollbar" fastly on this page : http://manos.malihu.gr/repository/custom-scrollbar/demo/examples/disable_destroy_example.html

or simplier here (look at the console errors) :

http://codepen.io/vtabary/pen/wiqAf

This is just a workaround, maybe there is a better way to do this.