jscrollpane content is shown 3 times
using jscrollpane my content is duplicated 3 times. to see what i mean go to: http://www.facesoflyme.com/view_pets/profile/pet_webpage.php?pet_id=1676 and view the scrolling content under "Casey's Lyme Disease Journey"
here is the same page wi开发者_如何学Gothout using jscrollpanel. Notice the content is only shown one time. use the url below to view the page that works pet_webpage_11302010.php?pet_id=1676
If anyone can help figure out how to fix this it would be much appreciated.
It seems that you're adding this content there 3 times:
<script type="text/javascript" id="sourcecode">
$(function()
{
// Initialise the scrollpanes
$('.scroll-pane').jScrollPane();
// Add some content to #pane2
var pane2api = $('#pane2').data('jsp');
var originalContent = pane2api.getContentPane().html();
pane2api.getContentPane().html(originalContent + originalContent + originalContent);
// Reinitialise the #pane2 scrollpane
pane2api.reinitialise();
});
</script>
This line:
pane2api.getContentPane().html(originalContent + originalContent + originalContent);
The content is already there as a static HTML, the only thing you need to do is use this:
$('.scroll-pane').jScrollPane();
that will do for most of the implementations
Cheers
G.
精彩评论