javascript: .scrollLeft(); - Method expression is not of function type

Hi there,

when I use the following jQuery javascript snippet in my code, the code works fine:

controlScrollLeft = $('#' + outerID).scrollLeft();

(controlScrollLeft variable keeps the pixels given by scrollLeft function).

BUT: An error is thrown in the javascript - editor: "Method expression is not of function type"...

Ok, so when I remove the brackets (), like: controlScrollLeft = $('#' + outerID).scrollLeft;
Then, no error is thrown, but the function does not work anymore.

Where is my mistake?

Thanks, Adrian.

4 comments
Comment actions Permalink

Hi Adrian,
It seems you haven't configured jQuery library in your project. Please follow these instructions.

Regards,
Konstantin

0
Comment actions Permalink

Hello,
thanks for your answer.
But I already configured it, at libriries jQuery UI 1.8.14 is activated, when I press on edit, http://jqueryui.com/demos is specified and loaded. Is there another documentation librires for scrollLeft?

Thanks, Adrian.

0
Comment actions Permalink

You should also enable jQuery library, as jQuery UI is designed to be used with jQuery, and scrollLeft method is defined in jQuery library, not jQuery UI.

0
Comment actions Permalink

Hello Konstantin,
yep, you were right, that helped. Now everything is fine.
Thank you a lot!
Sincerely, Adrian.

0

Please sign in to leave a comment.