I'm using this plugin to scroll a div - https://github.com/thomd/jquery-scroll I'm not using it quite as it's written because it's geared toward a fixed height div. The height of my div grows so therefore I have to call the repaint method when the div resizes.
The issue I'm running into is that I don't always need scrollbars when the page first loads but upon resizing the page I do. So, when the page loads I'm getting the error - Uncaught TypeError: Cannot call method 'repaint' of undefined
I know that if I want to test to see if an element exists I can do something like $('.selector').length > 0 but in this case I want to see if the scrollbar object exists. I tried $('.selector').scrollbar.length and I'm getting back 1. So, I'm not quite sure what's going on. Does the object exist and if so, why can't I call the repaint method? Or does it not exist and if not, why is it returning 1? Or am I testing for it incorrectly? Thanks.