I installed jScrollPane on my website and cannot make it work.
My site works as follows: from the main page, pages are loaded dynamically using the jQuery load() method. On the download page, I have the following script to run jScrollPane:
$(function(){ $('.scroll-pane').jScrollPane(); });
It seems to be called. There are no problems at the moment. The problem is that the page at the beginning is not long enough to need a scroll bar. I have hidden content that is displayed only on certain actions (for example, clicking a button shows the contents of a certain paragraph), and when I click to show the contents of a hidden div, the scroll bar does not appear.
I also tried calling $('.scroll-pane').jScrollPane(); , since I am showing new content (i.e. in the case where .show() triggers on a hidden div I also call $('.scroll-pane').jScrollPane(); ), but I also did not succeed.
Can anybody help me?
thanks
EDIT:
I forgot to mention the structure of the page: I have a div that has class="scroll-pane" and is loaded by loading the page, and contains small hidden divs that appear when you click on certain areas. I would like to add a scrollbar to the div with the class scrollbar so that the contents of the displayed div scrolls (right now the content remains in the size of the div, but it doesn't scroll as the jScrollPane scroll bar is not shown).
Update:
I tried putting $('.scroll-pane').jScrollPane(); in the callback of the .show() method of .show() and tried to put class="scroll-pane" in those divs that appear, but nothing is displayed again (the scroll bar does not display, and the div does not scroll).
source share