I encountered a slow script warning in IE 9 while using jscrollpane on a page containing a scrollable (i.e. some jscrollpanes inside) overlay with a bunch of content. In Firefox 8 everything works fine and the page is build up quickly. On IE it takes a lot of time (about a minute) and collapsing/expanding one of the scrolled regions (i.e. showing/hiding) causes the page to freeze again for long time. Obviously this is only a problem in conjunction with IE.
The same page but without the .jscrollpane()'s added is in IE as fast as in Firefox.
I'm using jscrollpane 2.0.0.beta10 and jquery 1.7, but it happens to be the same with jquery 2.0.0.beta9 and jquery 1.6.
Posting user1047487's answer from the comment so it is easier to find (also adding some formatting).
In jquery.jscrollpane.js, function
initialiseVerticalScroll()
uses a very inperformant selection (at least for IE) to resize the vertical scrollbar:This is especially slow when container contains a lot of elements.
A fix is very simple, due to the fact that
.jspVerticalBar
is already known asverticalBar
:Same Problem/Solution should apply to the corresponding horizontal bar.