AlreadyM / jscrollpane

Automatically exported from code.google.com/p/jscrollpane
0 stars 0 forks source link

append does not work for jScrollpane #200

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. adding append on the jScrollPane
2.
3.

What is the expected output? What do you see instead?

No jScrolLpane appears on my DIV

What version of the jScrollPane are you using? On what browser? And
operating system?
latest as of this post: vista 64 bit. firefox. 3.6.3.

Please provide a URL to a page displaying the problem.

Please provide any additional information below.

When I add text using this script:
<script type="text/javascript">
    $("#ok").click(function() {
     $('#game').append("YOU DID SOMEETHING!@!!<br />");
    });
</script>
The jScrollpane will NOT appear when It needs to be.

Original issue reported on code.google.com by jsf...@gmail.com on 3 Jun 2010 at 4:06

GoogleCodeExporter commented 9 years ago
Your code doesn't show any use of jScrollPane at all so I'm not sure what your
problem is...

Maybe you are forgetting to re-initialise the jScrollPane after you have added
content to it? You can see an example of doing so here:

http://www.kelvinluck.com/assets/jquery/jScrollPane/ajax_example.html

If your problem is something else then please provide a URL demonstrating the 
problem
and maybe I can help...

Original comment by kelvin.l...@gmail.com on 3 Jun 2010 at 7:41

GoogleCodeExporter commented 9 years ago
i have the same problem...
$('#scrollpane').jScrollPane({showArrows: true});

but when appended like so..
$("#maindiv").append($("#scrollpane"));

..it doesn't show. but checking the html raw file via view source, it's there. 
tried to reinitialise but doesn't work as well.

Original comment by sftMusic...@gmail.com on 20 Apr 2012 at 7:58

GoogleCodeExporter commented 9 years ago
Please see here for where to get support for jScrollPane:
http://jscrollpane.kelvinluck.com/#support

The issue you are running into is because jScrollPane needs to wrap the element 
you apply it to so that it can place the scrollbars in the document. So when 
you append the element elsewhere in the document you loose all of the wrapping. 
Also, jScrollPane needs to know where the element is sitting so that it can 
correctly calculate the size of the element you are applying it to. For these 
reasons I would suggest first appending the element to the correct place in the 
document and then initialising jScrollPane...

Original comment by kel...@lucklaboratories.com on 23 Apr 2012 at 9:09