I have a problem with a jquery custom scrollbar. My document is made of different iframes. In particular, there're two: one containing a Table Of Contents (toc_iframe) and another one showing the content of the topic selected in the TOC (main_iframe). The toc_iframe is using a jquery custom scrollbar, applied to an element with id "#content", and I'm trying to get a reference to the scrollbar from the main_iframe in order to call a function of its api.
To do so, I'm using the jquery selector:
$("#content",parent.window.frames[0].document)
The selector works fine (tested with console.log), but when I call a function of the scrollbar on it, I get the classic error "Uncaught TypeError: undefined is not a function".
$("#content",parent.window.frames[0].document).mCustomScrollbar("scrollTo",myElt);
Anyone knows what I'm doing wrong? Thanks.